Comments
Patch
Common subdirectories: vdr-1.7.40.org/libsi and vdr-1.7.40/libsi
Common subdirectories: vdr-1.7.40.org/PLUGINS and vdr-1.7.40/PLUGINS
Common subdirectories: vdr-1.7.40.org/po and vdr-1.7.40/po
Common subdirectories: vdr-1.7.40.org/symbols and vdr-1.7.40/symbols
@@ -104,16 +104,20 @@ static bool SetUser(const char *UserName
return false;
}
if (setuid(user->pw_uid) < 0) {
fprintf(stderr, "vdr: cannot set user id %u: %s\n", (unsigned int)user->pw_uid, strerror(errno));
return false;
}
if (UserDump && prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) < 0)
fprintf(stderr, "vdr: warning - cannot set dumpable: %s\n", strerror(errno));
+ setenv("HOME", user->pw_dir, 1);
+ setenv("USER", user->pw_name, 1);
+ setenv("LOGNAME", user->pw_name, 1);
+ setenv("SHELL", user->pw_shell, 1);
}
return true;
}
static bool DropCaps(void)
{
// drop all capabilities except selected ones
cap_t caps = cap_from_text("= cap_sys_nice,cap_sys_time,cap_net_raw=ep");