Mercurial > dovecot > original-hg > dovecot-1.2
changeset 4466:50861235f77f HEAD
Don't require valid uid/gid fields if passwd-file isn't being used as a
userdb.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 01 Jul 2006 22:42:27 +0300 |
parents | ac58b71b88d0 |
children | eaab43f6f65f |
files | src/auth/db-passwd-file.c |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/db-passwd-file.c Sat Jul 01 22:15:50 2006 +0300 +++ b/src/auth/db-passwd-file.c Sat Jul 01 22:42:27 2006 +0300 @@ -68,8 +68,9 @@ } if (*args != NULL && **args != '\0') { - pu->uid = userdb_parse_uid(NULL, *args); - if (pu->uid == 0 || pu->uid == (uid_t)-1) { + pu->uid = !pw->db->userdb ? (uid_t)-1 : + userdb_parse_uid(NULL, *args); + if ((pu->uid == 0 || pu->uid == (uid_t)-1) && pw->db->userdb) { i_error("passwd-file %s: User %s has invalid UID %s", pw->path, username, *args); return; @@ -79,8 +80,9 @@ args++; if (*args != NULL && **args != '\0') { - pu->gid = userdb_parse_gid(NULL, *args); - if (pu->gid == 0 || pu->gid == (gid_t)-1) { + pu->gid = !pw->db->userdb ? (gid_t)-1 : + userdb_parse_gid(NULL, *args); + if ((pu->gid == 0 || pu->gid == (gid_t)-1) && pw->db->userdb) { i_error("passwd-file %s: User %s has invalid GID %s", pw->path, username, *args); return;