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
2
rdo.c
2
rdo.c
|
@ -40,6 +40,8 @@ void runprog(char** program_argv) {
|
|||
if (setgid(0) < 0)
|
||||
err(1, "Could not setgid");
|
||||
|
||||
putenv("HOME=/root");
|
||||
|
||||
// NOTE: this does not return when no error occurred.
|
||||
execvp(program_argv[0], program_argv);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue