Просмотр исходного кода

Ticket 47613 - Impossible to configure nsslapd-allowed-sasl-mechanisms

Bug Description:  The design doc sasy you can use comma separated list of supported mechanisms,
                  but in fact this was not supported.

Fix Description:  Allow comma separated lists.

https://fedorahosted.org/389/ticket/47613

Reviewed by: richm(Thanks!)
Mark Reynolds 12 лет назад
Родитель
Сommit
6200f68126
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      ldap/servers/slapd/libglobs.c

+ 18 - 0
ldap/servers/slapd/libglobs.c

@@ -125,6 +125,7 @@ static int config_set_onoff( const char *attrname, char *value,
 		int *configvalue, char *errorbuf, int apply );
 static int config_set_schemareplace ( const char *attrname, char *value,
 		char *errorbuf, int apply );
+static void remove_commas(char *str);
 
 /* Keeping the initial values */
 /* CONFIG_INT/CONFIG_LONG */
@@ -6820,6 +6821,9 @@ config_set_allowed_sasl_mechs(const char *attrname, char *value, char *errorbuf,
         return LDAP_SUCCESS;
     }
 
+    /* cyrus sasl doesn't like comma separated lists */
+    remove_commas(value);
+
     CFG_LOCK_WRITE(slapdFrontendConfig);
     slapdFrontendConfig->allowed_sasl_mechs = slapi_ch_strdup(value);
     CFG_UNLOCK_WRITE(slapdFrontendConfig);
@@ -7577,3 +7581,17 @@ slapi_err2string(int result)
 #endif
 }
 
+/* replace commas with spaces */
+static void
+remove_commas(char *str)
+{
+    int i;
+
+    for (i = 0; str && str[i]; i++)
+    {
+        if (str[i] == ',')
+        {
+            str[i] = ' ';
+        }
+    }
+}