Dr. Werner Fink 2016-06-24 10:08:15 +00:00 committed by Git OBS Bridge
parent 24448a7ce8
commit 105760fe7d
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 24 10:06:32 UTC 2016 - werner@suse.de
- Give man(1) command a home that is let pager less(1) handle its
history (boo#986211)
-------------------------------------------------------------------
Mon Mar 21 15:04:48 UTC 2016 - bwiedemann@suse.com

View File

@ -102,6 +102,8 @@ int main (int argc, char **argv, char *envp[])
printf ("%s\n", wlp->run);
#endif
if (ruid == 0 || euid == 0) {
static char *dummy_environ[] = { NULL };
extern char **environ;
struct passwd *pwd;
char *cwd;
@ -142,6 +144,16 @@ int main (int argc, char **argv, char *envp[])
return -EACCES;
}
free(cwd);
cwd = getenv("TERM");
environ = dummy_environ;
setenv("HOME", pwd->pw_dir, 1);
setenv("PATH", "/bin:/usr/bin", 1);
setenv("USER", pwd->pw_name, 1);
setenv("LOGNAME", pwd->pw_name, 1);
if (cwd)
setenv("TERM", cwd, 1);
envp = environ;
}
execve (wlp->run, argv, envp);
perror ("execve");