Merge lp:~jamesodhunt/upstart/bug-1356824 into lp:upstart

Proposed by James Hunt on 2014-08-14
Status: Merged
Merged at revision: 1660
Proposed branch: lp:~jamesodhunt/upstart/bug-1356824
Merge into: lp:upstart
Diff against target: 88 lines (+26/-15)
2 files modified
ChangeLog (+5/-0)
init/control.c (+21/-15)
To merge this branch: bzr merge lp:~jamesodhunt/upstart/bug-1356824
Reviewer Review Type Date Requested Status
Upstart Reviewers 2014-08-14 Pending
Review via email: mp+230777@code.launchpad.net

Description of the change

* init/control.c: Disallow modifying system jobs via SetEnv,
  UnsetEnv or ResetEnv calls (LP: #1356824).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2014-07-16 16:38:24 +0000
3+++ ChangeLog 2014-08-14 11:30:47 +0000
4@@ -1,3 +1,8 @@
5+2014-08-14 James Hunt <james.hunt@ubuntu.com>
6+
7+ * init/control.c: Disallow modifying system jobs via SetEnv,
8+ UnsetEnv or ResetEnv calls (LP: #1356824).
9+
10 2014-07-16 James Hunt <james.hunt@ubuntu.com>
11
12 * NEWS: Release 1.13.1
13
14=== modified file 'init/control.c'
15--- init/control.c 2014-06-05 22:35:01 +0000
16+++ init/control.c 2014-08-14 11:30:47 +0000
17@@ -1359,16 +1359,18 @@
18 return -1;
19 }
20
21+ if (getpid () == 1) {
22+ nih_dbus_error_raise_printf (
23+ DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
24+ _("Not permissible to modify PID 1 job environment"));
25+ return -1;
26+ }
27+
28 if (job_details[0]) {
29 job_name = job_details[0];
30
31 /* this can be a null value */
32 instance = job_details[1];
33- } else if (getpid () == 1) {
34- nih_dbus_error_raise_printf (
35- DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
36- _("Not permissible to modify PID 1 job environment"));
37- return -1;
38 }
39
40 /* Verify that job name is valid */
41@@ -1509,16 +1511,18 @@
42 return -1;
43 }
44
45+ if (getpid () == 1) {
46+ nih_dbus_error_raise_printf (
47+ DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
48+ _("Not permissible to modify PID 1 job environment"));
49+ return -1;
50+ }
51+
52 if (job_details[0]) {
53 job_name = job_details[0];
54
55 /* this can be a null value */
56 instance = job_details[1];
57- } else if (getpid () == 1) {
58- nih_dbus_error_raise_printf (
59- DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
60- _("Not permissible to modify PID 1 job environment"));
61- return -1;
62 }
63
64 /* Verify that job name is valid */
65@@ -1817,16 +1821,18 @@
66 return -1;
67 }
68
69+ if (getpid () == 1) {
70+ nih_dbus_error_raise_printf (
71+ DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
72+ _("Not permissible to modify PID 1 job environment"));
73+ return -1;
74+ }
75+
76 if (job_details[0]) {
77 job_name = job_details[0];
78
79 /* this can be a null value */
80 instance = job_details[1];
81- } else if (getpid () == 1) {
82- nih_dbus_error_raise_printf (
83- DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
84- _("Not permissible to modify PID 1 job environment"));
85- return -1;
86 }
87
88 /* Verify that job name is valid */

Subscribers

People subscribed via source and target branches