diff -uprk.orig popt-20020315.orig/findme.c popt-20020315/findme.c --- popt-20020315.orig/findme.c 2003-05-01 12:49:21 +0400 +++ popt-20020315/findme.c 2003-05-01 12:51:49 +0400 @@ -10,7 +10,7 @@ #include "findme.h" const char * findProgramPath(const char * argv0) { - char * path = getenv("PATH"); + char * path = __secure_getenv("PATH"); char * pathbuf; char * start, * chptr; char * buf; diff -uprk.orig popt-20020315.orig/popt.c popt-20020315/popt.c --- popt-20020315.orig/popt.c 2003-05-01 12:49:21 +0400 +++ popt-20020315/popt.c 2003-05-01 12:57:24 +0400 @@ -402,7 +402,8 @@ static int execCommand(poptContext con) argv[argc] = NULL; #ifdef __hpux - rc = setresuid(getuid(), getuid(),-1); + rc = setresgid(getgid(), getgid(), -1); + rc = setresuid(getuid(), getuid(), -1); if (rc) return POPT_ERROR_ERRNO; #else /* @@ -411,9 +412,13 @@ static int execCommand(poptContext con) * XXX from Norbert Warmuth */ #if defined(HAVE_SETUID) + rc = setgid(getgid()); + if (rc) return POPT_ERROR_ERRNO; rc = setuid(getuid()); if (rc) return POPT_ERROR_ERRNO; #elif defined (HAVE_SETREUID) + rc = setregid(getgid(), getgid()); + if (rc) return POPT_ERROR_ERRNO; rc = setreuid(getuid(), getuid()); /*hlauer: not portable to hpux9.01 */ if (rc) return POPT_ERROR_ERRNO; #else diff -uprk.orig popt-20020315.orig/poptconfig.c popt-20020315/poptconfig.c --- popt-20020315.orig/poptconfig.c 2003-05-01 12:49:21 +0400 +++ popt-20020315/poptconfig.c 2003-05-01 12:58:06 +0400 @@ -172,9 +172,8 @@ int poptReadDefaultConfig(poptContext co rc = poptReadConfigFile(con, "/etc/popt"); if (rc) return rc; - if (getuid() != geteuid()) return 0; - if ((home = getenv("HOME"))) { + if ((home = __secure_getenv("HOME"))) { fn = alloca(strlen(home) + 20); strcpy(fn, home); strcat(fn, "/.popt");