poptItem item = con->doExec;
const char ** argv;
int argc = 0;
- int rc;
if (item == NULL) /*XXX can't happen*/
return POPT_ERROR_NOARG;
argv[argc] = NULL;
+ {
#ifdef __hpux
- rc = setresgid(getgid(), getgid(),-1);
+ int rc = setresgid(getgid(), getgid(),-1);
if (rc) return POPT_ERROR_ERRNO;
rc = setresuid(getuid(), getuid(),-1);
if (rc) return POPT_ERROR_ERRNO;
* XXX from Norbert Warmuth <nwarmuth@privat.circular.de>
*/
#if defined(HAVE_SETUID)
- rc = setgid(getgid());
+ int 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());
+ int rc = setregid(getgid(), getgid());
if (rc) return POPT_ERROR_ERRNO;
rc = setreuid(getuid(), getuid());
if (rc) return POPT_ERROR_ERRNO;
; /* Can't drop privileges */
#endif
#endif
+ }
if (argv[0] == NULL)
return POPT_ERROR_NOARG;
*oe++ = '\0';
/* XXX longArg is mapped back to persistent storage. */
longArg = origOptString + (oe - localOptString);
- }
+ } else
+ oe = NULL;
opt = findOption(con->options, optString, '\0', &cb, &cbData,
singleDash);
if (!opt && !singleDash)
return POPT_ERROR_BADOPT;
+ if (!opt && oe)
+ oe[-1] = '='; /* restore overwritten '=' */
}
if (!opt) {
con->os->nextCharArg = origOptString + 1;
+ longArg = NULL;
} else {
if (con->os == con->optionStack &&
opt->argInfo & POPT_ARGFLAG_STRIP)
origOptString++;
if (*origOptString != '\0')
- con->os->nextCharArg = origOptString;
+ con->os->nextCharArg = origOptString + (*origOptString == '=');
}
/*@=branchstate@*/