1
0
Fork 0
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:
sw1tchbl4d3 2022-05-05 07:26:56 +02:00
parent 599aa73a8c
commit c82d7e777e

4
rdo.c
View file

@ -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]);