]> arthur.barton.de Git - netatalk.git/commitdiff
Fixes
authorFrank Lahm <franklahm@googlemail.com>
Wed, 18 May 2011 12:32:46 +0000 (14:32 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 18 May 2011 12:32:46 +0000 (14:32 +0200)
etc/afpd/acls.c
libatalk/acl/uuid.c

index 43b307a0aaa6c91fc6bcf7505762721062cbaaf6..bc32881a06e8238c86a237b84989bfe778a32e65 100644 (file)
@@ -280,8 +280,8 @@ static int map_aces_darwin_to_solaris(darwin_ace_t *darwin_aces,
             nfsv4_ace_flags |= ACE_IDENTIFIER_GROUP;
             break;
         default:
-            darwin_aces++;
-            continue;
+            LOG(log_error, logtype_afpd, "map_aces_darwin_to_solaris: unkown uuidtype");
+            EC_FAIL;
         }
         free(name);
         name = NULL;
@@ -309,8 +309,12 @@ static int map_aces_darwin_to_solaris(darwin_ace_t *darwin_aces,
                 nfsv4_ace_rights |= darwin_to_nfsv4_rights[i].to;
         }
 
-        LOG(log_debug9, logtype_afpd, "map_aces_darwin_to_solaris: ACE flags: Darwin:%08x -> NFSv4:%04x", darwin_ace_flags, nfsv4_ace_flags);
-        LOG(log_debug9, logtype_afpd, "map_aces_darwin_to_solaris: ACE rights: Darwin:%08x -> NFSv4:%08x", darwin_ace_rights, nfsv4_ace_rights);
+        LOG(log_debug9, logtype_afpd,
+            "map_aces_darwin_to_solaris: ACE flags: Darwin:%08x -> NFSv4:%04x",
+            darwin_ace_flags, nfsv4_ace_flags);
+        LOG(log_debug9, logtype_afpd,
+            "map_aces_darwin_to_solaris: ACE rights: Darwin:%08x -> NFSv4:%08x",
+            darwin_ace_rights, nfsv4_ace_rights);
 
         nfsv4_aces->a_flags = nfsv4_ace_flags;
         nfsv4_aces->a_access_mask = nfsv4_ace_rights;
index e275a4d1ad8023c3a95ba3fec0ef36e27f579a18..fc64c0455f486f8004be22bea32ba12346c4a6b1 100644 (file)
@@ -242,27 +242,30 @@ int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
         uid = ntohl(*(uint32_t *)(uuidp + 12));
         if ((pwd = getpwuid(uid)) == NULL) {
             /* not found, add negative entry to cache */
-            *type |= UUID_ENOENT;
-            *name = "UUID_ENOENT";
+            add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
+            ret = -1;
+        } else {
+            *name = strdup(pwd->pw_name);
             add_cachebyuuid(uuidp, *name, *type, 0);
-            return -1;
+            ret = 0;
         }
-        *name = pwd->pw_name;
-        add_cachebyuuid(uuidp, *name, *type, 0);
-        return 0;
+        LOG(log_debug, logtype_afpd,
+            "getnamefromuuid{local}: UUID: %s -> name: %s, type:%s",
+            uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]);
+        return ret;
     } else if (memcmp(uuidp, local_group_uuid, 12) == 0) {
         *type = UUID_GROUP;
         gid = ntohl(*(uint32_t *)(uuidp + 12));
         if ((grp = getgrgid(gid)) == NULL) {
             /* not found, add negative entry to cache */
-            *type |= UUID_ENOENT;
-            *name = "UUID_ENOENT";
+            add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
+            ret = -1;
+        } else {
+            *name = strdup(grp->gr_name);
             add_cachebyuuid(uuidp, *name, *type, 0);
-            return -1;
+            ret = 0;
         }
-        *name = grp->gr_name;
-        add_cachebyuuid(uuidp, *name, *type, 0);
-        return 0;
+        return ret;
     }
 
 #ifdef HAVE_LDAP
@@ -270,9 +273,7 @@ int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
     if (ret != 0) {
         LOG(log_warning, logtype_afpd, "getnamefromuuid(%s): no result from ldap_getnamefromuuid",
             uuid_bin2string(uuidp));
-        *type |= UUID_ENOENT;
-        *name = "UUID_ENOENT";
-        add_cachebyuuid(uuidp, *name, *type, 0);
+        add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
         return -1;
     }
 #endif