]> arthur.barton.de Git - netatalk.git/commitdiff
Fix a crash when searching for a UUID that is not a special local UUID and LDAP suppo...
authorFrank Lahm <franklahm@googlemail.com>
Thu, 28 Jul 2011 14:36:21 +0000 (16:36 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 28 Jul 2011 14:36:21 +0000 (16:36 +0200)
NetAPF bug #10149.

NEWS
etc/afpd/acls.c
libatalk/acl/uuid.c

diff --git a/NEWS b/NEWS
index 705cd05fadc3afbc44e57fa046e88e8ce423cf34..21525dde66ee31ed2500c968b791f3902d9c84ae 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Changes in 2.2.1
        new connection attempts
 * FIX: afpd: fix undefined behaviour when more then ~510 connetions where
        established
+* FIX: afpd: fix a crash when searching for a UUID that is not a special
+       local UUID and LDAP support is not compiled in
 * FIX: cnid_dbd: increase BerkeleyDB locks and lockobjs
 * FIX: cnid_dbd: implement -d option, deletes CNID db
 * FIX: suse: initscript return better status
index b91de9f27b2c3a8114b37afc6bb2cde7139f0006..7bbec02c689d8df89edab346aa6cf9690397a751 100644 (file)
@@ -1119,7 +1119,7 @@ static int check_acl_access(const struct vol *vol,
         cfrombstr(dir->d_fullpath), path, getcwdpath(), requested_rights);
 
     /* Get uid or gid from UUID */
-    EC_ZERO_LOG_ERR(getnamefromuuid(uuid, &username, &uuidtype), AFPERR_PARAM);
+    EC_ZERO_ERR(getnamefromuuid(uuid, &username, &uuidtype), AFPERR_PARAM);
     EC_ZERO_LOG_ERR(lstat(path, &st), AFPERR_PARAM);
 
     switch (uuidtype) {
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);