Merge lp:~stgraber/upstart/upstart-user-cwd into lp:upstart

Proposed by Stéphane Graber
Status: Merged
Merged at revision: 1430
Proposed branch: lp:~stgraber/upstart/upstart-user-cwd
Merge into: lp:upstart
Diff against target: 18 lines (+5/-3)
1 file modified
init/job_process.c (+5/-3)
To merge this branch: bzr merge lp:~stgraber/upstart/upstart-user-cwd
Reviewer Review Type Date Requested Status
James Hunt Approve
Review via email: mp+147468@code.launchpad.net

Description of the change

The default code in upstart was to chdir to / all jobs that don't have
an explicit chdir stanza. This isn't the wanted behaviour for user jobs
where we want CWD to be inherited.

This change simply adds an explicit check for user sessions.

To post a comment you must log in.
Revision history for this message
James Hunt (jamesodhunt) wrote :

LGTM. Merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'init/job_process.c'
2--- init/job_process.c 2013-01-25 09:08:09 +0000
3+++ init/job_process.c 2013-02-08 20:44:27 +0000
4@@ -765,9 +765,11 @@
5 * configured in the job, or to the root directory of the filesystem
6 * (or at least relative to the chroot).
7 */
8- if (chdir (class->chdir ? class->chdir : "/") < 0) {
9- nih_error_raise_system ();
10- job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CHDIR, 0);
11+ if (class->chdir || user_mode == FALSE) {
12+ if (chdir (class->chdir ? class->chdir : "/") < 0) {
13+ nih_error_raise_system ();
14+ job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CHDIR, 0);
15+ }
16 }
17
18 /* Change the user and group of the process to the one

Subscribers

People subscribed via source and target branches