2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +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

@@ -162,8 +162,6 @@ static int NewArgc;
static char **NewArgv;
/* XXX */
extern int Argc;
extern char **Argv;
extern char **environ;
/* error.c */
@@ -1228,6 +1226,12 @@ deserialize_info(char * const settings[], char * const user_info[])
continue;
}
#endif /* HAVE_BSD_AUTH_H */
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME)
if (MATCHES(*cur, "progname=")) {
setprogname(*cur + sizeof("progname=") - 1);
continue;
}
#endif
}
for (cur = user_info; *cur != NULL; cur++) {