[dovecot-cvs] dovecot/src/auth db-passwd-file.c, 1.22, 1.23 db-passwd-file.h, 1.12, 1.13

cras at dovecot.org cras at dovecot.org
Sat Mar 25 12:19:13 EET 2006


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv11239

Modified Files:
	db-passwd-file.c db-passwd-file.h 
Log Message:
Allow empty uid/gid fields, they're required if we want to set extra fields
for passdb. Also removed some unused code.



Index: db-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-passwd-file.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- db-passwd-file.c	26 Feb 2006 10:04:59 -0000	1.22
+++ db-passwd-file.c	25 Mar 2006 10:19:10 -0000	1.23
@@ -63,7 +63,7 @@
 		}
 	}
 
-	if (*args != NULL) {
+	if (*args != NULL && **args != '\0') {
 		pu->uid = userdb_parse_uid(NULL, *args);
 		if (pu->uid == 0 || pu->uid == (uid_t)-1) {
 			i_error("passwd-file %s: User %s has invalid UID %s",
@@ -71,9 +71,10 @@
 			return;
 		}
 		args++;
-	}
+	} else if (*args != NULL)
+		args++;
 
-	if (*args != NULL) {
+	if (*args != NULL && **args != '\0') {
 		pu->gid = userdb_parse_gid(NULL, *args);
 		if (pu->gid == 0 || pu->gid == (gid_t)-1) {
 			i_error("passwd-file %s: User %s has invalid GID %s",
@@ -86,9 +87,8 @@
 			i_error("passwd-file %s: User %s is missing "
 				"userdb info", pw->path, username);
 		}
-		if (pw->first_missing_userdb_info == NULL)
-			pw->first_missing_userdb_info = user;
-		pw->missing_userdb_info_count++;
+		if (*args != NULL)
+			args++;
 	}
 
 	/* user info */
@@ -206,9 +206,6 @@
 		pw->fd = -1;
 	}
 
-	pw->first_missing_userdb_info = NULL;
-	pw->missing_userdb_info_count = 0;
-
 	if (pw->users != NULL) {
 		hash_destroy(pw->users);
 		pw->users = NULL;

Index: db-passwd-file.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-passwd-file.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- db-passwd-file.h	20 Feb 2006 16:31:46 -0000	1.12
+++ db-passwd-file.h	25 Mar 2006 10:19:10 -0000	1.13
@@ -20,9 +20,6 @@
 	int fd;
 
 	struct hash_table *users;
-
-	const char *first_missing_userdb_info;
-	unsigned int missing_userdb_info_count;
 };
 
 struct db_passwd_file {



More information about the dovecot-cvs mailing list