Set safe_cmnd after sudoers_lookup() if it has not been set.
Previously it was set by sudo "ALL" in the parser but at that point the fully-qualified pathname has not yet been found.
This commit is contained in:
10
sudo.c
10
sudo.c
@@ -284,6 +284,8 @@ main(argc, argv, envp)
|
||||
if (!def_ignore_local_sudoers && !ISSET(validated, VALIDATE_OK))
|
||||
#endif
|
||||
validated = sudoers_lookup(pwflag);
|
||||
if (safe_cmnd == NULL)
|
||||
safe_cmnd = estrdup(user_cmnd);
|
||||
|
||||
/*
|
||||
* Look up the timestamp dir owner if one is specified.
|
||||
@@ -367,14 +369,6 @@ main(argc, argv, envp)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* This *must* have been set if we got a match but... */
|
||||
if (safe_cmnd == NULL) {
|
||||
log_error(MSG_ONLY,
|
||||
"internal error, safe_cmnd never got set for %s; %s",
|
||||
user_cmnd,
|
||||
"please report this error at http://courtesan.com/sudo/bugs/");
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYSTRACE
|
||||
if (def_monitor)
|
||||
systrace_attach(getpid());
|
||||
|
Reference in New Issue
Block a user