2022-09-28 09:04:29 +02:00
|
|
|
Index: popt-1.19/configure.ac
|
2013-06-14 17:16:02 +02:00
|
|
|
===================================================================
|
2022-09-28 09:04:29 +02:00
|
|
|
--- popt-1.19.orig/configure.ac
|
|
|
|
+++ popt-1.19/configure.ac
|
|
|
|
@@ -9,7 +9,6 @@ AC_CONFIG_MACRO_DIR([m4])
|
2020-08-16 01:52:30 +02:00
|
|
|
AM_INIT_AUTOMAKE([1.10 foreign -Wall])
|
2022-09-28 09:04:29 +02:00
|
|
|
|
|
|
|
m4_version_prereq([2.70], [], [AC_PROG_CC_STDC])
|
2013-02-14 23:02:50 +01:00
|
|
|
-AC_PROG_CC
|
2020-08-16 01:52:30 +02:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
AM_PROG_AR
|
2022-09-28 09:04:29 +02:00
|
|
|
|
|
|
|
Index: popt-1.19/src/system.h
|
2013-06-14 17:16:02 +02:00
|
|
|
===================================================================
|
2022-09-28 09:04:29 +02:00
|
|
|
--- popt-1.19.orig/src/system.h
|
|
|
|
+++ popt-1.19/src/system.h
|
2020-08-16 01:52:30 +02:00
|
|
|
@@ -2,9 +2,7 @@
|
2022-09-28 09:04:29 +02:00
|
|
|
* @file
|
2013-02-14 23:02:50 +01:00
|
|
|
*/
|
2022-09-28 09:04:29 +02:00
|
|
|
|
2013-02-14 23:02:50 +01:00
|
|
|
-#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
-#endif
|
2022-09-28 09:04:29 +02:00
|
|
|
|
2020-08-16 01:52:30 +02:00
|
|
|
#include <ctype.h>
|
2022-09-28 09:04:29 +02:00
|
|
|
|
|
|
|
@@ -57,6 +55,8 @@ static inline char * stpcpy (char *dest,
|
2020-08-16 01:52:30 +02:00
|
|
|
#define getenv(_s) secure_getenv(_s)
|
|
|
|
#elif defined(HAVE___SECURE_GETENV)
|
|
|
|
#define getenv(_s) __secure_getenv(_s)
|
|
|
|
+#else
|
|
|
|
+#error neither secure_getenv nor __secure_getenv is available
|
2013-02-14 23:02:50 +01:00
|
|
|
#endif
|
2022-09-28 09:04:29 +02:00
|
|
|
|
2013-02-14 23:02:50 +01:00
|
|
|
#if !defined(__GNUC__) && !defined(__attribute__)
|
2022-09-28 09:04:29 +02:00
|
|
|
Index: popt-1.19/src/popt.c
|
2013-06-14 17:16:02 +02:00
|
|
|
===================================================================
|
2022-09-28 09:04:29 +02:00
|
|
|
--- popt-1.19.orig/src/popt.c
|
|
|
|
+++ popt-1.19/src/popt.c
|
|
|
|
@@ -181,7 +181,7 @@ poptContext poptGetContext(const char *
|
2013-02-14 23:02:50 +01:00
|
|
|
con->execAbsolute = 1;
|
|
|
|
con->arg_strip = NULL;
|
|
|
|
|
|
|
|
- if (getenv("POSIXLY_CORRECT") || getenv("POSIX_ME_HARDER"))
|
|
|
|
+ if (secure_getenv("POSIXLY_CORRECT") || secure_getenv("POSIX_ME_HARDER"))
|
|
|
|
con->flags |= POPT_CONTEXT_POSIXMEHARDER;
|
|
|
|
|
|
|
|
if (name)
|
2022-09-28 09:04:29 +02:00
|
|
|
@@ -418,7 +418,7 @@ const char * findProgramPath(const char
|
2013-02-14 23:02:50 +01:00
|
|
|
if (strchr(argv0, '/'))
|
|
|
|
return xstrdup(argv0);
|
|
|
|
|
|
|
|
- if ((path = getenv("PATH")) == NULL || (path = xstrdup(path)) == NULL)
|
|
|
|
+ if ((path = secure_getenv("PATH")) == NULL || (path = xstrdup(path)) == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* The return buffer in t is big enough for any path. */
|
2022-09-28 09:04:29 +02:00
|
|
|
@@ -1633,6 +1633,7 @@ const char * poptBadOption(poptContext c
|
2013-02-14 23:02:50 +01:00
|
|
|
|
|
|
|
const char * poptStrerror(const int error)
|
|
|
|
{
|
|
|
|
+ char errbuf[1024];
|
|
|
|
switch (error) {
|
|
|
|
case POPT_ERROR_NOARG:
|
|
|
|
return POPT_("missing argument");
|
2022-09-28 09:04:29 +02:00
|
|
|
@@ -1657,7 +1658,7 @@ const char * poptStrerror(const int erro
|
2013-02-14 23:02:50 +01:00
|
|
|
case POPT_ERROR_BADCONFIG:
|
|
|
|
return POPT_("config file failed sanity test");
|
|
|
|
case POPT_ERROR_ERRNO:
|
|
|
|
- return strerror(errno);
|
|
|
|
+ return strerror_r(errno, errbuf, sizeof errbuf);
|
|
|
|
default:
|
|
|
|
return POPT_("unknown error");
|
|
|
|
}
|
2022-09-28 09:04:29 +02:00
|
|
|
Index: popt-1.19/src/poptconfig.c
|
2013-06-14 17:16:02 +02:00
|
|
|
===================================================================
|
2022-09-28 09:04:29 +02:00
|
|
|
--- popt-1.19.orig/src/poptconfig.c
|
|
|
|
+++ popt-1.19/src/poptconfig.c
|
|
|
|
@@ -467,7 +467,7 @@ int poptReadDefaultConfig(poptContext co
|
2013-02-14 23:02:50 +01:00
|
|
|
if (rc) goto exit;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
- if ((home = getenv("HOME"))) {
|
|
|
|
+ if ((home = secure_getenv("HOME"))) {
|
|
|
|
char * fn = malloc(strlen(home) + 20);
|
|
|
|
if (fn != NULL) {
|
|
|
|
(void) stpcpy(stpcpy(fn, home), "/.popt");
|