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

Rewrite compat/getprogname.c and add setprogname().

The progname is now passed to the plugin via the settings array.
This commit is contained in:
Todd C. Miller
2010-03-19 07:52:31 -04:00
parent 0dbf4362d9
commit eec5235d19
6 changed files with 42 additions and 33 deletions

View File

@@ -163,6 +163,11 @@ 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);
}
#endif
}
if (runas_user != NULL) {
if ((pw = getpwnam(runas_user)) == NULL) {