From: Timo Sirainen Date: Tue, 13 Jan 2009 00:18:56 +0000 (-0500) Subject: Auth sockets: Allow specifying user and group with numbers. X-Git-Tag: 1.2.beta1~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf3dff6e365eb080c19ceb3d96f07a73fdfb5f62;p=thirdparty%2Fdovecot%2Fcore.git Auth sockets: Allow specifying user and group with numbers. --HG-- branch : HEAD --- diff --git a/src/auth/main.c b/src/auth/main.c index b7168b2690..8a97046058 100644 --- a/src/auth/main.c +++ b/src/auth/main.c @@ -77,6 +77,8 @@ static uid_t get_uid(const char *user) if (user == NULL) return (uid_t)-1; + if (is_numeric(user, '\0')) + return strtoul(user, NULL, 10); if ((pw = getpwnam(user)) == NULL) i_fatal("User doesn't exist: %s", user); @@ -89,6 +91,8 @@ static gid_t get_gid(const char *group) if (group == NULL) return (gid_t)-1; + if (is_numeric(group, '\0')) + return strtoul(group, NULL, 10); if ((gr = getgrnam(group)) == NULL) i_fatal("Group doesn't exist: %s", group);