2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Instead of setprogname(), add initprogname() which gets the program

name for getprogname() using /proc or pstat() if possible.
This commit is contained in:
Todd C. Miller
2013-12-01 19:12:21 -07:00
parent 902215a8c0
commit 0d81263e26
21 changed files with 147 additions and 108 deletions

View File

@@ -138,11 +138,9 @@ policy_open(unsigned int version, sudo_conv_t conversation,
if (strncmp(*ui, "runas_group=", sizeof("runas_group=") - 1) == 0) {
runas_group = *ui + sizeof("runas_group=") - 1;
}
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME)
if (strncmp(*ui, "progname=", sizeof("progname=") - 1) == 0) {
setprogname(*ui + sizeof("progname=") - 1);
initprogname(*ui + sizeof("progname=") - 1);
}
#endif
/* Check to see if sudo was called as sudoedit or with -e flag. */
if (strncmp(*ui, "sudoedit=", sizeof("sudoedit=") - 1) == 0) {
if (strcasecmp(*ui + sizeof("sudoedit=") - 1, "true") == 0)