forked from soccera/rdo
Change HOME to /root on exec
This affected some programs like vim, which put root-owned swap files into the normal user's swap directory, since $HOME didn't change. Fixes #11
This commit is contained in:
parent
599aa73a8c
commit
c82d7e777e
1 changed files with 3 additions and 1 deletions
4
rdo.c
4
rdo.c
|
@ -40,7 +40,9 @@ void runprog(char** program_argv) {
|
|||
if (setgid(0) < 0)
|
||||
err(1, "Could not setgid");
|
||||
|
||||
// NOTE: this does not return when no error occurred.
|
||||
putenv("HOME=/root");
|
||||
|
||||
// NOTE: this does not return when no error occurred.
|
||||
execvp(program_argv[0], program_argv);
|
||||
|
||||
err(1, program_argv[0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue