]> arthur.barton.de Git - netatalk.git/commitdiff
Remove createdir_inherit_acl, it's done automatically by inheritable/default ACLs
authorFrank Lahm <franklahm@googlemail.com>
Wed, 27 Oct 2010 14:08:04 +0000 (16:08 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 27 Oct 2010 14:08:04 +0000 (16:08 +0200)
etc/afpd/acls.c
etc/afpd/acls.h
etc/afpd/directory.c

index a8a4da73c08120c4e1061d9d4e65c0637886de97..9c0270ec99c0f5eff48e9b1f74a234831eb7d26e 100644 (file)
@@ -1375,68 +1375,3 @@ int acltoownermode(char *path, struct stat *st, uid_t uid, struct maccess *ma)
 EC_CLEANUP:
     EC_EXIT;
 }
-
-/*
-  We're being called at the end of afp_createdir. We're (hopefully) inside dir
-  and ".AppleDouble" and ".AppleDouble/.Parent" should have already been created.
-  We then inherit any explicit ACE from "." to ".AppleDouble" and ".AppleDouble/.Parent".
-  FIXME: add to VFS layer ?
-*/
-int createdir_inherit_acl(const struct vol *vol)
-{
-    EC_INIT;
-#ifdef HAVE_SOLARIS_ACLS
-    ace_t *diraces = NULL, *adaces = NULL, *combinedaces = NULL;
-    int diracecount, adacecount;
-#endif
-#ifdef HAVE_POSIX_ACLS
-    acl_t def_acl = NULL;
-    acl_t acc_acl = NULL;
-#endif
-    LOG(log_debug9, logtype_afpd, "addir_inherit_acl: BEGIN");
-
-    /* Check if ACLs are enabled for the volume */
-    if (vol->v_flags & AFPVOL_ACLS) {
-#ifdef HAVE_SOLARIS_ACLS
-        /* Get directory ACL */
-        EC_NEG1_LOG(diracecount = get_nfsv4_acl(".", &diraces));
-        EC_NEG1_LOG(diracecount = strip_trivial_aces(&diraces, diracecount));
-
-        /* Inherit to .AppleDouble directory */
-        EC_NEG1_LOG(adacecount = get_nfsv4_acl(".AppleDouble", &adaces));
-        EC_NEG1_LOG(adacecount = strip_nontrivial_aces(&adaces, adacecount));
-        EC_NULL_LOG(combinedaces = concat_aces(diraces, diracecount, adaces, adacecount));
-        EC_ZERO_LOG(acl(".AppleDouble", ACE_SETACL, diracecount + adacecount, combinedaces));
-        free(adaces);
-        adaces = NULL;
-        free(combinedaces);
-        combinedaces = NULL;
-
-        /* Inherit to ".AppleDouble/.Parent" */
-        EC_NEG1_LOG(adacecount = get_nfsv4_acl(".AppleDouble/.Parent", &adaces));
-        EC_NEG1_LOG(adacecount = strip_nontrivial_aces(&adaces, adacecount));
-        EC_NULL_LOG(combinedaces = concat_aces(diraces, diracecount, adaces, adacecount));
-        EC_ZERO_LOG(acl(".AppleDouble/.Parent",
-                        ACE_SETACL,
-                        diracecount + adacecount,
-                        combinedaces));
-#endif
-#ifdef HAVE_POSIX_ACLS
-#endif
-    }
-
-    LOG(log_debug9, logtype_afpd, "addir_inherit_acl: END");
-
-EC_CLEANUP:
-#ifdef HAVE_SOLARIS_ACLS
-    if (diraces) free(diraces);
-    if (adaces) free(adaces);
-    if (combinedaces) free(combinedaces);
-#endif
-#ifdef HAVE_POSIX_ACLS
-    acl_free(acc_acl);
-    acl_free(def_acl);
-#endif
-    EC_EXIT;
-}
-
index 8b467ee502a5f3735113ea34a5821b423211ddc5..97db2b80704850c250f89e31cb8cacfdccc6ff55 100644 (file)
@@ -114,5 +114,4 @@ extern int acl_ldap_readconfig(char *name);
 
 /* Misc funcs */
 extern int acltoownermode(char *path, struct stat *st,uid_t uid, struct maccess *ma);
-extern int createdir_inherit_acl(const struct vol *vol);
 #endif
index 562a4a99d260ffcc316d9a290336187925e1899e..fa15e753927c07ca0f77e5292ca3436dd0cd9294 100644 (file)
@@ -2138,14 +2138,6 @@ int afp_createdir(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_
     ad_close_metadata( &ad);
 
 createdir_done:
-#if 0
-    /* FIXME: are we really inside the created dir? */
-    if (createdir_inherit_acl(vol) != 0) {
-        LOG(log_error, logtype_afpd, "Error inhereting ACL to .AppleDouble directory");
-        return AFPERR_MISC;
-    }
-#endif
-
     memcpy( rbuf, &dir->d_did, sizeof( u_int32_t ));
     *rbuflen = sizeof( u_int32_t );
     setvoltime(obj, vol );