]> arthur.barton.de Git - netatalk.git/commitdiff
Enhance ACL support detection for volumes
authorFrank Lahm <franklahm@googlemail.com>
Fri, 29 Jul 2011 09:32:24 +0000 (11:32 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 29 Jul 2011 09:32:24 +0000 (11:32 +0200)
Enable them per volume if
1) ACL support is compiled in
2) the volume supports ACLs
3) the new option "noacls" is not set for the volume
The previous behaviour was to enable ACL support for a volume if
1) it was compiled in and
2) the volume supported ACLs.
There was no way to disable ACLs for a volume.

NEWS
etc/afpd/volume.c

diff --git a/NEWS b/NEWS
index 21525dde66ee31ed2500c968b791f3902d9c84ae..6215e8b5e3aaa5dc21975c99c1d3a8484df5b101 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,12 @@ Changes in 2.2.1
 
 * NEW: afpd: disable continous service feature by default, new option
        -keepsessions to enable it
+* UPD: afpd: Enhance ACL support detection for volumes: enable them per volume if
+       1) ACL support compiled in, 2) the volume supports ACLs, 3) the new volume
+       option "noacls" is not set for the volume.
+       The previous behaviour was to enable ACL support for a volume if
+       1) it was compiled in and 2) the volume supported ACLs. There was no way
+       to disable ACLs for a volume.
 * FIX: afpd: increase BerkeleyDB locks and lockobjs
 * FIX: afpd: create special folder as root
 * FIX: afpd: fix compilation error if --enable-ddp is used
index ad7a6574b72f12d31a0a80972617ff607cc2731a..f2269bd407a441b85d78312336bb48fb6b966e35 100644 (file)
@@ -505,6 +505,8 @@ static void volset(struct vol_option *options, struct vol_option *save,
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_SEARCHDB;
             else if (strcasecmp(p, "nonetids") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_NONETIDS;
+            else if (strcasecmp(p, "noacls") == 0)
+                options[VOLOPT_FLAGS].i_value &= ~AFPVOL_ACLS;
             p = strtok(NULL, ",");
         }
 
@@ -745,9 +747,8 @@ static int creatvol(AFPObj *obj, struct passwd *pwd,
     volume->v_vid = ++lastvid;
     volume->v_vid = htons(volume->v_vid);
 #ifdef HAVE_ACLS
-    if (check_vol_acl_support(volume))
-        volume->v_flags |= AFPVOL_ACLS
-;
+    if (!check_vol_acl_support(volume))
+        volume->v_flags &= ~AFPVOL_ACLS;
 #endif
 
     /* handle options */
@@ -1227,6 +1228,9 @@ static int readvolfile(AFPObj *obj, struct afp_volume_name *p1, char *p2, int us
 
     /* Enable some default options for all volumes */
     save_options[VOLOPT_FLAGS].i_value |= AFPVOL_CACHE;
+#ifdef HAVE_ACLS
+    save_options[VOLOPT_FLAGS].i_value |= AFPVOL_ACLS;
+#endif
     save_options[VOLOPT_EA_VFS].i_value = AFPVOL_EA_AUTO;
     LOG(log_maxdebug, logtype_afpd, "readvolfile: seeding default umask: %04o",
         obj->options.umask);