X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Facl%2Fldap_config.c;h=6cf554a8fec1921c9239092e0c45f78150d041ba;hb=03e67f82d8c4d6c89375ff82b6a441d78c2c69ac;hp=d719cafdfc4a2c66ea32a4297c195fddc93e949b;hpb=df7560dfdb12b06090dc4b2c6e88d0858930b591;p=netatalk.git diff --git a/libatalk/acl/ldap_config.c b/libatalk/acl/ldap_config.c index d719cafd..6cf554a8 100644 --- a/libatalk/acl/ldap_config.c +++ b/libatalk/acl/ldap_config.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -32,14 +33,12 @@ int acl_ldap_readconfig(dictionary *iniconfig) { int i, j; - char *val; + const char *val; i = 0; /* now see if its a correct pref */ for (i = 0; ldap_prefs[i].name != NULL; i++) { - if ((val = iniparser_getstring(ldap_prefs[i].name)) != NULL) { - /* ok, found a valid pref */ - + if ((val = iniparser_getstring(iniconfig, INISEC_GLOBAL, ldap_prefs[i].name, NULL))) { /* check if we have pre-defined values */ if (ldap_prefs[i].intfromarray == 0) { /* no, its just a string */ @@ -49,7 +48,7 @@ int acl_ldap_readconfig(dictionary *iniconfig) *((int *)(ldap_prefs[i].pref)) = atoi(val); else /* store string as string */ - *((char **)(ldap_prefs[i].pref)) = val; + *((const char **)(ldap_prefs[i].pref)) = val; } else { /* ok, we have string to int mapping for this pref eg. "none", "simple", "sasl" map to 0, 128, 129 */ @@ -71,7 +70,7 @@ int acl_ldap_readconfig(dictionary *iniconfig) while(ldap_prefs[i].pref != NULL) { if ( ldap_prefs[i].valid != 0) { - LOG(log_debug, logtype_afpd,"afp_ldap.conf: Missing option: \"%s\"", ldap_prefs[i].name); + LOG(log_debug, logtype_afpd,"LDAP: Missing option: \"%s\"", ldap_prefs[i].name); ldap_config_valid = 0; break; } @@ -80,16 +79,15 @@ int acl_ldap_readconfig(dictionary *iniconfig) if (ldap_config_valid) { if (ldap_auth_method == LDAP_AUTH_NONE) - LOG(log_debug, logtype_afpd,"afp_ldap.conf: Using anonymous bind."); + LOG(log_debug, logtype_afpd,"LDAP: Using anonymous bind."); else if (ldap_auth_method == LDAP_AUTH_SIMPLE) - LOG(log_debug, logtype_afpd,"afp_ldap.conf: Using simple bind."); + LOG(log_debug, logtype_afpd,"LDAP: Using simple bind."); else { ldap_config_valid = 0; - LOG(log_error, logtype_afpd,"afp_ldap.conf: SASL not yet supported."); + LOG(log_error, logtype_afpd,"LDAP: SASL not yet supported."); } } else - LOG(log_info, logtype_afpd,"afp_ldap.conf: not used"); - fclose(f); + LOG(log_info, logtype_afpd,"LDAP: not used"); return 0; } #endif /* HAVE_LDAP */