version 1.37, 2015/08/20 18:42:11 |
version 1.38, 2015/08/22 16:01:05 |
|
|
int i, ch; |
int i, ch; |
int sflag = 0; |
int sflag = 0; |
int nflag = 0; |
int nflag = 0; |
|
char cwdpath[PATH_MAX]; |
|
const char *cwd; |
|
|
uid = getuid(); |
uid = getuid(); |
|
|
|
|
LOGIN_SETUSER) != 0) |
LOGIN_SETUSER) != 0) |
errx(1, "failed to set user context for target"); |
errx(1, "failed to set user context for target"); |
|
|
syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command as %s: %s", |
if (getcwd(cwdpath, sizeof(cwdpath)) == NULL) |
myname, pw->pw_name, cmdline); |
cwd = "(failed)"; |
|
else |
|
cwd = cwdpath; |
|
|
|
syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s", |
|
myname, cmdline, pw->pw_name, cwd); |
|
|
if (setenv("PATH", safepath, 1) == -1) |
if (setenv("PATH", safepath, 1) == -1) |
err(1, "failed to set PATH '%s'", safepath); |
err(1, "failed to set PATH '%s'", safepath); |
execvpe(cmd, argv, envp); |
execvpe(cmd, argv, envp); |