]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/acl/uuid.c
Fix a crash when searching for a UUID that is not a special local UUID and LDAP suppo...
[netatalk.git] / libatalk / acl / uuid.c
index fc64c0455f486f8004be22bea32ba12346c4a6b1..3bf591e5c07148bb00f2b8a6dde15c1df2d36f5a 100644 (file)
@@ -215,7 +215,7 @@ cleanup:
  * Caller must free name appropiately.
  */
 int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
-    int ret = 0;
+    int ret;
     uid_t uid;
     gid_t gid;
     struct passwd *pwd;
@@ -270,13 +270,16 @@ int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
 
 #ifdef HAVE_LDAP
     ret = ldap_getnamefromuuid(uuid_bin2string(uuidp), name, type);
+#else
+    ret = -1;
+#endif
+
     if (ret != 0) {
-        LOG(log_warning, logtype_afpd, "getnamefromuuid(%s): no result from ldap_getnamefromuuid",
+        LOG(log_debug, logtype_afpd, "getnamefromuuid(%s): not found",
             uuid_bin2string(uuidp));
         add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
         return -1;
     }
-#endif
 
     add_cachebyuuid(uuidp, *name, *type, 0);