[dovecot-cvs] dovecot/src/auth passdb-sql.c,1.3,1.4

cras at dovecot.org cras at dovecot.org
Mon Oct 18 22:23:51 EEST 2004


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

Modified Files:
	passdb-sql.c 
Log Message:
Don't require boolean flags to be 'Y' for yes, only to be non-NULL.



Index: passdb-sql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-sql.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- passdb-sql.c	18 Oct 2004 19:21:40 -0000	1.3
+++ passdb-sql.c	18 Oct 2004 19:23:49 -0000	1.4
@@ -46,12 +46,15 @@
 		name = sql_result_get_field_name(result, i);
 		value = sql_result_get_field_value(result, i);
 
+		if (value == NULL)
+			continue;
+
 		if (strcmp(name, "password") == 0)
 			continue;
 
 		if (strcmp(name, "nodelay") == 0) {
 			/* don't delay replying to client of the failure */
-			auth_request->no_failure_delay = *value == 'Y';
+			auth_request->no_failure_delay = TRUE;
 			continue;
 		}
 
@@ -59,28 +62,23 @@
 			str = str_new(auth_request->pool, 64);
 
 		if (strcmp(name, "nologin") == 0) {
-			if (*value == 'Y') {
-				/* user can't actually login - don't keep this
-				   reply for master */
-				auth_request->no_login = TRUE;
-				if (str_len(str) > 0)
-					str_append_c(str, '\t');
-				str_append(str, name);
-			}
+			/* user can't actually login - don't keep this
+			   reply for master */
+			auth_request->no_login = TRUE;
+			if (str_len(str) > 0)
+				str_append_c(str, '\t');
+			str_append(str, name);
 		} else if (strcmp(name, "proxy") == 0) {
-			if (*value == 'Y') {
-				/* we're proxying authentication for this
-				   user. send password back if using plaintext
-				   authentication. */
-				auth_request->proxy = TRUE;
-				if (str_len(str) > 0)
-					str_append_c(str, '\t');
-				str_append(str, name);
+			/* we're proxying authentication for this user. send
+			   password back if using plaintext authentication. */
+			auth_request->proxy = TRUE;
+			if (str_len(str) > 0)
+				str_append_c(str, '\t');
+			str_append(str, name);
 
-				if (*sql_request->password != '\0') {
-					str_printfa(str, "\tpass=%s",
-						    sql_request->password);
-				}
+			if (*sql_request->password != '\0') {
+				str_printfa(str, "\tpass=%s",
+					    sql_request->password);
 			}
 		} else {
 			if (str_len(str) > 0)



More information about the dovecot-cvs mailing list