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

@@ -299,10 +299,7 @@ main(int argc, char *argv[], char *envp[])
int
os_init_common(int argc, char *argv[], char *envp[])
{
#if !defined(HAVE_GETPROGNAME) && !defined(HAVE___PROGNAME)
if (argc > 0)
setprogname(argv[0]);
#endif
initprogname(argc > 0 ? argv[0] : "sudo");
#ifdef STATIC_SUDOERS_PLUGIN
preload_static_symbols();
#endif