Ticket #139 (closed defect: fixed)

Opened 20 months ago

Last modified 20 months ago

start-stop-daemon --user root doesn't set ${HOME}

Reported by: ulm@gentoo.org Owned by: roy
Priority: major Milestone:
Component: rc Version: 0.4
Keywords: Cc:

Description

When started with the "--user root" option, s-s-d doesn't set the HOME environment variable. This isn't a problem when called interactively (where HOME is already set). However, at boot time the started process will be HOMEless.

Attached patch should fix it.

Attachments

start-stop-daemon-user-root.patch Download (650 bytes) - added by ulm@gentoo.org 20 months ago.

Change History

Changed 20 months ago by ulm@gentoo.org

comment:1 Changed 20 months ago by roy

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r1476 in a different way.
We basically ensure that $USER and $HOME exist at startup and then just set them as we encounter the options on the commandline. Makes the code a bit smaller too :)

comment:2 Changed 20 months ago by Matthias Schwarzott <zzam@gentoo.org>

I think this sequence is not correct:
if (home == NULL) {

setenv("HOME", home, 1);
home = pw->pw_dir;

}

This will call setenv with home being NULL. I think the order inside the if need to be swapped.

comment:3 Changed 20 months ago by roy

Fixed in r1480, thanks!

Note: See TracTickets for help on using tickets.