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
=== modified file 'ChangeLog'
--- ChangeLog 2014-07-16 16:38:24 +0000
+++ ChangeLog 2014-08-14 11:30:47 +0000
@@ -1,3 +1,8 @@
12014-08-14 James Hunt <james.hunt@ubuntu.com>
2
3 * init/control.c: Disallow modifying system jobs via SetEnv,
4 UnsetEnv or ResetEnv calls (LP: #1356824).
5
12014-07-16 James Hunt <james.hunt@ubuntu.com>62014-07-16 James Hunt <james.hunt@ubuntu.com>
27
3 * NEWS: Release 1.13.18 * NEWS: Release 1.13.1
49
=== 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 @@
1359 return -1;1359 return -1;
1360 }1360 }
13611361
1362 if (getpid () == 1) {
1363 nih_dbus_error_raise_printf (
1364 DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1365 _("Not permissible to modify PID 1 job environment"));
1366 return -1;
1367 }
1368
1362 if (job_details[0]) {1369 if (job_details[0]) {
1363 job_name = job_details[0];1370 job_name = job_details[0];
13641371
1365 /* this can be a null value */1372 /* this can be a null value */
1366 instance = job_details[1];1373 instance = job_details[1];
1367 } else if (getpid () == 1) {
1368 nih_dbus_error_raise_printf (
1369 DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1370 _("Not permissible to modify PID 1 job environment"));
1371 return -1;
1372 }1374 }
13731375
1374 /* Verify that job name is valid */1376 /* Verify that job name is valid */
@@ -1509,16 +1511,18 @@
1509 return -1;1511 return -1;
1510 }1512 }
15111513
1514 if (getpid () == 1) {
1515 nih_dbus_error_raise_printf (
1516 DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1517 _("Not permissible to modify PID 1 job environment"));
1518 return -1;
1519 }
1520
1512 if (job_details[0]) {1521 if (job_details[0]) {
1513 job_name = job_details[0];1522 job_name = job_details[0];
15141523
1515 /* this can be a null value */1524 /* this can be a null value */
1516 instance = job_details[1];1525 instance = job_details[1];
1517 } else if (getpid () == 1) {
1518 nih_dbus_error_raise_printf (
1519 DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1520 _("Not permissible to modify PID 1 job environment"));
1521 return -1;
1522 }1526 }
15231527
1524 /* Verify that job name is valid */1528 /* Verify that job name is valid */
@@ -1817,16 +1821,18 @@
1817 return -1;1821 return -1;
1818 }1822 }
18191823
1824 if (getpid () == 1) {
1825 nih_dbus_error_raise_printf (
1826 DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1827 _("Not permissible to modify PID 1 job environment"));
1828 return -1;
1829 }
1830
1820 if (job_details[0]) {1831 if (job_details[0]) {
1821 job_name = job_details[0];1832 job_name = job_details[0];
18221833
1823 /* this can be a null value */1834 /* this can be a null value */
1824 instance = job_details[1];1835 instance = job_details[1];
1825 } else if (getpid () == 1) {
1826 nih_dbus_error_raise_printf (
1827 DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1828 _("Not permissible to modify PID 1 job environment"));
1829 return -1;
1830 }1836 }
18311837
1832 /* Verify that job name is valid */1838 /* Verify that job name is valid */

Subscribers

People subscribed via source and target branches