omniti-labs/reconnoiter — Issue #34: run as root failed
Author: pedia
Created: 2011-12-08 08:45:01+00:00
State: open

root user run notid like
notid -u xxx -g xxx

failed like:
[2011-12-08 15:12:33.688739] Cannot find user '0'
[2011-12-08 15:12:33.688751] Failed to regain privileges, exiting.

I found reason why. In src/util/noit_security.c

static inline int isuinteger(const char *user) {
char *cp;
if (user == NULL || *user == '\0' || isblank(*user)) return 0;
if (strtol (user, &cp, 10) < 0) return 0;
return (cp == '\0');
}

Maybe cp == '\0' should be *cp == '\0'

Thanks