diff options
Diffstat (limited to 'src/lib-popt')
-rw-r--r-- | src/lib-popt/findme.c | 2 | ||||
-rw-r--r-- | src/lib-popt/poptconfig.c | 2 | ||||
-rw-r--r-- | src/lib-popt/poptparse.c | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/lib-popt/findme.c b/src/lib-popt/findme.c index bcbe1941..a465a051 100644 --- a/src/lib-popt/findme.c +++ b/src/lib-popt/findme.c @@ -39,8 +39,10 @@ char * findProgramPath(char * argv0) { *chptr = '\0'; sprintf(buf, "%s/%s", start, argv0); +#ifndef WIN32 if (!access(buf, X_OK)) return buf; +#endif if (chptr) start = chptr + 1; diff --git a/src/lib-popt/poptconfig.c b/src/lib-popt/poptconfig.c index 67c084e5..9219e9bf 100644 --- a/src/lib-popt/poptconfig.c +++ b/src/lib-popt/poptconfig.c @@ -127,7 +127,9 @@ int poptReadDefaultConfig(poptContext con, int useEnv) { rc = poptReadConfigFile(con, "/etc/popt"); if (rc) return rc; +#ifndef WIN32 if (getuid() != geteuid()) return 0; +#endif if ((home = getenv("HOME"))) { fn = alloca(strlen(home) + 20); diff --git a/src/lib-popt/poptparse.c b/src/lib-popt/poptparse.c index 181ec1ac..6e412834 100644 --- a/src/lib-popt/poptparse.c +++ b/src/lib-popt/poptparse.c @@ -29,7 +29,7 @@ int poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) { int i, buflen; buflen = strlen(s) + 1; - bufStart = buf = alloca(buflen); + bufStart = buf = malloc(buflen); memset(buf, '\0', buflen); src = s; @@ -43,6 +43,7 @@ int poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) { src++; if (!*src) { free(argv); + free(bufStart); return POPT_ERROR_BADQUOTE; } if (*src != quote) *buf++ = '\\'; @@ -66,6 +67,7 @@ int poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) { src++; if (!*src) { free(argv); + free(bufStart); return POPT_ERROR_BADQUOTE; } /* fallthrough */ @@ -95,5 +97,6 @@ int poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) { *argvPtr = argv2; *argcPtr = argc; + free(bufStart); return 0; } |