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
Change History
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.