mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
actions: Use separate IPC for communicating results
Currently privileged actions use stdout for returning the results. If any of the sub-processes accidentally output to stdout, decoding errors occur. Prevent this by opening a pipe to the privileged action and returning the output in that pipe. Tests: - Run unit tests - Functional tests for other apps pass Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
585092ca63
commit
6f5410931e
7 files changed
+190
-55
No files matched your search
@@ -650,8 +650,10 @@ def _setup_users(image_file):
|
||||
str(gid), 'plinth'], stdout=subprocess.DEVNULL)
|
||||
|
||||
logger.info('In container: Setting up sudo for users "fbx" and "plinth"')
|
||||
sudo_config = 'plinth ALL=(ALL:ALL) NOPASSWD:SETENV : ' \
|
||||
'/usr/share/plinth/actions/* , /freedombox/actions/*\n' \
|
||||
sudo_config = 'Cmnd_Alias FREEDOMBOX_ACTION_DEV = /usr/share/plinth/' \
|
||||
'actions/actions, /freedombox/actions/actions\n' \
|
||||
'Defaults!FREEDOMBOX_ACTION_DEV closefrom_override\n' \
|
||||
'plinth ALL=(ALL:ALL) NOPASSWD:SETENV : FREEDOMBOX_ACTION_DEV\n' \
|
||||
'fbx ALL=(ALL:ALL) NOPASSWD : ALL\n'
|
||||
_runc(image_file, ['tee', '/etc/sudoers.d/01-freedombox-development'],
|
||||
input=sudo_config.encode(), stdout=subprocess.DEVNULL)
|
||||
|
||||
Reference in new issue
Block a user