mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'unstable' into regen-conf
This commit is contained in:
commit
a828e6d6d0
1 changed files with 3 additions and 6 deletions
|
@ -29,7 +29,6 @@ import re
|
|||
import json
|
||||
import errno
|
||||
import subprocess
|
||||
from shlex import split as arg_split
|
||||
|
||||
from moulinette.core import MoulinetteError
|
||||
from moulinette.utils.log import getActionLogger
|
||||
|
@ -314,15 +313,13 @@ def hook_exec(file, args=None):
|
|||
if arg_list:
|
||||
# Concatenate arguments and escape them with double quotes to prevent
|
||||
# bash related issue if an argument is empty and is not the last
|
||||
arg_list = [str(s) for s in arg_list]
|
||||
arg_str = '\\"{:s}\\"'.format('\\" \\"'.join(arg_list))
|
||||
arg_str = '"{:s}"'.format('" "'.join(str(s) for s in arg_list))
|
||||
|
||||
msignals.display(m18n.n('executing_script'))
|
||||
|
||||
p = subprocess.Popen(
|
||||
arg_split('su - admin -c "cd \\"{:s}\\" && ' \
|
||||
'/bin/bash -x \\"{:s}\\" {:s}"'.format(
|
||||
file_path, file, arg_str)),
|
||||
['sudo', '-u', 'admin', '-H', 'sh', '-c', 'cd "{:s}" && ' \
|
||||
'/bin/bash "{:s}" {:s}'.format(file_path, file, arg_str)],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||
shell=False)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue