X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Facl%2Fldap.c;h=724ac4d5ba8e59d59bf4aa2f73c2cc3450165765;hb=64c01c136e708085840814c92ff7cf829a794317;hp=5fc277b893d06d72711f0cb718e8a0d9db4eadd4;hpb=7566495e5aeeafdd063a324b483793e8d4e443c4;p=netatalk.git diff --git a/libatalk/acl/ldap.c b/libatalk/acl/ldap.c index 5fc277b8..724ac4d5 100644 --- a/libatalk/acl/ldap.c +++ b/libatalk/acl/ldap.c @@ -16,6 +16,8 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ +#ifdef HAVE_LDAP + #include #include #include @@ -265,6 +267,9 @@ int ldap_getuuidfromname( const char *name, uuidtype_t type, char **uuid_string) char *attributes[] = { ldap_uuid_attr, NULL}; char *ldap_attr; + if (!ldap_config_valid) + return -1; + /* make filter */ if (type == UUID_GROUP) ldap_attr = ldap_group_attr; @@ -303,6 +308,9 @@ int ldap_getnamefromuuid( const char *uuidstr, char **name, uuidtype_t *type) { char filter[256]; /* this should really be enough. we dont want to malloc everything! */ char *attributes[] = { NULL, NULL}; + if (!ldap_config_valid) + return -1; + /* make filter */ len = snprintf( filter, 256, "%s=%s", ldap_uuid_attr, uuidstr); if (len >= 256 || len == -1) { @@ -328,3 +336,4 @@ int ldap_getnamefromuuid( const char *uuidstr, char **name, uuidtype_t *type) { return -1; } +#endif /* HAVE_LDAP */