Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37044626
en ru br
ALT Linux repositórios
S:1.18-alt1
5.0: 1.14-alt4
4.1: 1.14-alt2
4.0: 1.7-alt16
3.0: 1.7-alt13

Group :: Sistema/Bibliotecas
RPM: libpopt

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: popt-20020315-owl-alt-env-sgid.patch
Download


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 <nwarmuth@privat.circular.de>
  */
 #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");
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009