version 1.76, 2019/06/12 02:50:29 |
version 1.77, 2019/06/16 18:16:34 |
|
|
errx(1, "no passwd entry for target"); |
errx(1, "no passwd entry for target"); |
|
|
if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP | |
if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP | |
|
LOGIN_SETPATH | |
LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK | |
LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK | |
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 %s as %s from %s", |
syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s", |
mypw->pw_name, cmdline, targpw->pw_name, cwd); |
mypw->pw_name, cmdline, targpw->pw_name, cwd); |
|
|
envp = prepenv(rule); |
envp = prepenv(rule, mypw, targpw); |
|
|
|
if (rule->cmd) { |
|
/* do this again after setusercontext reset it */ |
|
if (setenv("PATH", safepath, 1) == -1) |
|
err(1, "failed to set PATH '%s'", safepath); |
|
} |
execvpe(cmd, argv, envp); |
execvpe(cmd, argv, envp); |
fail: |
fail: |
if (errno == ENOENT) |
if (errno == ENOENT) |