Merge authors:
  James Hunt (jamesodhunt)
Related merge proposals:
  https://code.launchpad.net/~jamesodhunt/upstart/bug-1356824/+merge/230777
  proposed by: James Hunt (jamesodhunt)
------------------------------------------------------------
revno: 1660 [merge]
committer: Dimitri John Ledkov <[email protected]>
branch nick: trunk
timestamp: Fri 2014-08-15 22:32:57 +0100
message:
  Merge lp:~jamesodhunt/upstart/bug-1356824
modified:
  ChangeLog
  init/control.c


--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk

Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'ChangeLog'
--- ChangeLog	2014-07-16 16:38:24 +0000
+++ ChangeLog	2014-08-14 11:19:43 +0000
@@ -1,3 +1,8 @@
+2014-08-14  James Hunt  <[email protected]>
+
+	* init/control.c: Disallow modifying system jobs via SetEnv,
+	  UnsetEnv or ResetEnv calls (LP: #1356824).
+
 2014-07-16  James Hunt  <[email protected]>
 
 	* 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:19:43 +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
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to