sbonazzo / rpms / cyrus-sasl

Forked from rpms/cyrus-sasl 2 years ago
Clone

Blame SOURCES/cyrus-sasl-2.1.26-error-message-when-config-has-typo.patch

b9abc1
diff --git a/include/sasl.h b/include/sasl.h
b9abc1
index 8b8a63f..6ae153f 100755
b9abc1
--- a/include/sasl.h
b9abc1
+++ b/include/sasl.h
b9abc1
@@ -179,6 +179,7 @@
b9abc1
 				       because of some constrains/policy violation */
b9abc1
 
b9abc1
 #define SASL_BADBINDING -32  /* channel binding failure */
b9abc1
+#define SASL_CONFIGERR -33  /* error when parsing configuration file */
b9abc1
 
b9abc1
 /* max size of a sasl mechanism name */
b9abc1
 #define SASL_MECHNAMEMAX 20
b9abc1
diff --git a/lib/common.c b/lib/common.c
b9abc1
index 672fe2f..de0adfd 100644
b9abc1
--- a/lib/common.c
b9abc1
+++ b/lib/common.c
b9abc1
@@ -1362,6 +1362,7 @@ const char *sasl_errstring(int saslerr,
b9abc1
     case SASL_CONSTRAINT_VIOLAT: return "sasl_setpass can't store a property because "
b9abc1
 			        "of a constraint violation";
b9abc1
     case SASL_BADBINDING: return "channel binding failure";
b9abc1
+    case SASL_CONFIGERR:  return "error when parsing configuration file";
b9abc1
 
b9abc1
     default:   return "undefined error!";
b9abc1
     }
b9abc1
diff --git a/lib/config.c b/lib/config.c
b9abc1
index 7cae302..fde3757 100644
b9abc1
--- a/lib/config.c
b9abc1
+++ b/lib/config.c
b9abc1
@@ -91,7 +91,7 @@ int sasl_config_init(const char *filename)
b9abc1
 	}
b9abc1
 	if (*p != ':') {
b9abc1
 	    fclose(infile);
b9abc1
-	    return SASL_FAIL;
b9abc1
+	    return SASL_CONFIGERR;
b9abc1
 	}
b9abc1
 	*p++ = '\0';
b9abc1
 
b9abc1
@@ -99,7 +99,7 @@ int sasl_config_init(const char *filename)
b9abc1
 	
b9abc1
 	if (!*p) {
b9abc1
 	    fclose(infile);
b9abc1
-	    return SASL_FAIL;
b9abc1
+	    return SASL_CONFIGERR;
b9abc1
 	}
b9abc1
 
b9abc1
 	/* Now strip trailing spaces, if any */