Add cmnd_base to struct sudo_user and set it in init_vars().
Add cmnd_stat to struct sudo_user and set it in sudo_goodpath(). No longer use gross statics in command_matches(). Also rename some variables for improved clarity.
This commit is contained in:
@@ -47,8 +47,9 @@ static const char rcsid[] = "$Sudo$";
|
||||
* Verify that path is a normal file and executable by root.
|
||||
*/
|
||||
char *
|
||||
sudo_goodpath(path)
|
||||
sudo_goodpath(path, sbp)
|
||||
const char *path;
|
||||
struct stat *sbp;
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
@@ -65,5 +66,7 @@ sudo_goodpath(path)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (sbp != NULL)
|
||||
(void) memcpy(sbp, &sb, sizeof(struct stat));
|
||||
return((char *)path);
|
||||
}
|
||||
|
Reference in New Issue
Block a user