James Hunt has proposed merging lp:~jamesodhunt/upstart/bug-1356824 into lp:upstart.
Requested reviews: Upstart Reviewers (upstart-reviewers) Related bugs: Bug #1356824 in upstart : "'initctl set-env' can be called from a system job" https://bugs.launchpad.net/upstart/+bug/1356824 For more details, see: https://code.launchpad.net/~jamesodhunt/upstart/bug-1356824/+merge/230777 * init/control.c: Disallow modifying system jobs via SetEnv, UnsetEnv or ResetEnv calls (LP: #1356824). -- https://code.launchpad.net/~jamesodhunt/upstart/bug-1356824/+merge/230777 Your team Upstart Reviewers is requested to review the proposed merge of lp:~jamesodhunt/upstart/bug-1356824 into lp:upstart.
=== modified file 'ChangeLog' --- ChangeLog 2014-07-16 16:38:24 +0000 +++ ChangeLog 2014-08-14 11:30:47 +0000 @@ -1,3 +1,8 @@ +2014-08-14 James Hunt <james.h...@ubuntu.com> + + * init/control.c: Disallow modifying system jobs via SetEnv, + UnsetEnv or ResetEnv calls (LP: #1356824). + 2014-07-16 James Hunt <james.h...@ubuntu.com> * NEWS: Release 1.13.1 === modified file 'init/control.c' --- init/control.c 2014-06-05 22:35:01 +0000 +++ init/control.c 2014-08-14 11:30:47 +0000 @@ -1359,16 +1359,18 @@ return -1; } + if (getpid () == 1) { + nih_dbus_error_raise_printf ( + DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", + _("Not permissible to modify PID 1 job environment")); + return -1; + } + if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; - } else if (getpid () == 1) { - nih_dbus_error_raise_printf ( - DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", - _("Not permissible to modify PID 1 job environment")); - return -1; } /* Verify that job name is valid */ @@ -1509,16 +1511,18 @@ return -1; } + if (getpid () == 1) { + nih_dbus_error_raise_printf ( + DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", + _("Not permissible to modify PID 1 job environment")); + return -1; + } + if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; - } else if (getpid () == 1) { - nih_dbus_error_raise_printf ( - DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", - _("Not permissible to modify PID 1 job environment")); - return -1; } /* Verify that job name is valid */ @@ -1817,16 +1821,18 @@ return -1; } + if (getpid () == 1) { + nih_dbus_error_raise_printf ( + DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", + _("Not permissible to modify PID 1 job environment")); + return -1; + } + if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; - } else if (getpid () == 1) { - nih_dbus_error_raise_printf ( - DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", - _("Not permissible to modify PID 1 job environment")); - return -1; } /* Verify that job name is valid */
-- upstart-devel mailing list upstart-devel@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel