dovecot-1.2: Auth sockets: Allow specifying user and group with ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jan 13 02:19:09 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/8bda844b1ee5
changeset: 8618:8bda844b1ee5
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jan 12 19:18:56 2009 -0500
description:
Auth sockets: Allow specifying user and group with numbers.

diffstat:

1 file changed, 4 insertions(+)
src/auth/main.c |    4 ++++

diffs (21 lines):

diff -r e3fd1a6467f2 -r 8bda844b1ee5 src/auth/main.c
--- a/src/auth/main.c	Mon Jan 12 13:26:24 2009 -0500
+++ b/src/auth/main.c	Mon Jan 12 19:18:56 2009 -0500
@@ -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);


More information about the dovecot-cvs mailing list