Merge lp:~jamesodhunt/upstart/upstart-no-inherit-env into lp:upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1435
Proposed branch: lp:~jamesodhunt/upstart/upstart-no-inherit-env
Merge into: lp:upstart
Diff against target: 93 lines (+19/-11)
4 files modified
ChangeLog (+8/-0)
init/job_process.c (+4/-4)
init/main.c (+3/-3)
init/man/init.8 (+4/-4)
To merge this branch: bzr merge lp:~jamesodhunt/upstart/upstart-no-inherit-env
Reviewer Review Type Date Requested Status
Stéphane Graber (community) Approve
Upstart Reviewers Pending
Review via email: mp+148789@code.launchpad.net

Description of the change

Changed '--inherit-env' to '--no-inherit-env' and made inheriting inits environment the default for Session Inits.

Retaining --no-inherit-env is useful for testing purposes.

To post a comment you must log in.
Revision history for this message
Stéphane Graber (stgraber) wrote :

Looks good to me.

review: Approve
Revision history for this message
James Hunt (jamesodhunt) wrote :

Thanks Stéphane - now merged.

You'll need to update /etc/X11/Xsession.d/59upstart in your PPA build when you next resync to take account of this change.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-02-08 16:55:25 +0000
3+++ ChangeLog 2013-02-15 19:00:47 +0000
4@@ -1,3 +1,11 @@
5+2013-02-15 James Hunt <james.hunt@ubuntu.com>
6+
7+ * init/job_process.c: job_process_run(): Invert meaning.
8+ * init/main.c: Change '--inherit-env' to '--no-inherit-env'
9+ such that inheriting inits environment is now the default
10+ for Session Inits.
11+ * init/man/init.8: Update for '--no-inherit-env'.
12+
13 2013-02-08 James Hunt <james.hunt@ubuntu.com>
14
15 * init/job_process.c: job_process_run(): Copy parent environment if
16
17=== modified file 'init/job_process.c'
18--- init/job_process.c 2013-02-14 02:54:10 +0000
19+++ init/job_process.c 2013-02-15 19:00:47 +0000
20@@ -116,11 +116,11 @@
21 int disable_job_logging = 0;
22
23 /**
24- * inherit_env:
25+ * no_inherit_env:
26 *
27- * If TRUE, copy init's environment to that provided to jobs.
28+ * If TRUE, do not copy the Session Inits environment to that provided to jobs.
29 **/
30-int inherit_env = FALSE;
31+int no_inherit_env = FALSE;
32
33
34 /* Prototypes for static functions */
35@@ -273,7 +273,7 @@
36 envc = 0;
37 env = NIH_MUST (nih_str_array_new (NULL));
38
39- if (user_mode && inherit_env)
40+ if (user_mode && ! no_inherit_env)
41 NIH_MUST(environ_append (&env, NULL, &envc, TRUE, environ));
42
43 if (job->env)
44
45=== modified file 'init/main.c'
46--- init/main.c 2013-02-14 13:36:06 +0000
47+++ init/main.c 2013-02-15 19:00:47 +0000
48@@ -120,7 +120,7 @@
49 **/
50 static int disable_startup_event = FALSE;
51
52-extern int inherit_env;
53+extern int no_inherit_env;
54 extern int user_mode;
55 extern int disable_sessions;
56 extern int disable_job_logging;
57@@ -141,8 +141,8 @@
58 { 0, "default-console", N_("default value for console stanza"),
59 NULL, "VALUE", NULL, console_type_setter },
60
61- { 0, "inherit-env", N_("jobs will inherit environment of init"),
62- NULL, NULL, &inherit_env ,NULL },
63+ { 0, "no-inherit-env", N_("jobs will not inherit environment of init"),
64+ NULL, NULL, &no_inherit_env ,NULL },
65
66 { 0, "logdir", N_("specify alternative directory to store job output logs in"),
67 NULL, "DIR", &log_dir, NULL },
68
69=== modified file 'init/man/init.8'
70--- init/man/init.8 2013-02-08 16:55:25 +0000
71+++ init/man/init.8 2013-02-15 19:00:47 +0000
72@@ -81,9 +81,9 @@
73 .BR console "."
74 .\"
75 .TP
76-.B \-\-inherit\-env
77-Make jobs inherit the initial environment. Impotent when running as
78-process id 1.
79+.B \-\-no\-inherit\-env
80+Stop jobs from inheriting the initial environment. Only meaningful when
81+running in user mode.
82 .\"
83 .TP
84 .B \-\-logdir \fIdirectory\fP
85@@ -102,7 +102,7 @@
86 .\"
87 .TP
88 .B \-\-no\-sessions
89-Disable user and chroot sessions.
90+Disable chroot sessions.
91 .\"
92 .TP
93 .B \-\-no\-startup\-event

Subscribers

People subscribed via source and target branches