Windows: Freelance vs ACLs
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 9 May 2010 14:50:07 +0000 (10:50 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 12 May 2010 05:24:33 +0000 (22:24 -0700)
If the user attempts to list acls or set acls on the freelance
root.afs volume, generate a meaningful error.

Change-Id: I6e5b147bf0cdd98ec0224a723098f5bbcb37b1e1
Reviewed-on: http://gerrit.openafs.org/1931
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/fs.c

index d1f437d..d56c363 100644 (file)
@@ -1007,6 +1007,11 @@ SetACLCmd(struct cmd_syndesc *as, void *arock)
         clear = 0;
     plusp = !(as->parms[3].items);
     for(ti=as->parms[0].items; ti;ti=ti->next) {
+        if ( IsFreelanceRoot(ti->data) ) {
+            fprintf(stderr,"%s: ACLs cannot be set on the Freelance root.afs volume.\n", pn);
+            error = 1;
+            continue;
+        }
        blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = idf;
        blob.in = blob.out = space;
@@ -1449,7 +1454,14 @@ ListACLCmd(struct cmd_syndesc *as, void *arock)
     SetDotDefault(&as->parms[0].items);
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        char separator;
-       blob.out_size = AFS_PIOCTL_MAXSIZE;
+
+        if ( IsFreelanceRoot(ti->data) ) {
+            fprintf(stderr,"%s: ACLs are not set on the Freelance root.afs volume.\n", pn);
+            error = 1;
+            continue;
+        }
+
+        blob.out_size = AFS_PIOCTL_MAXSIZE;
        blob.in_size = idf;
        blob.in = blob.out = space;
        code = pioctl_utf8(ti->data, VIOCGETAL, &blob, 1);
@@ -2309,7 +2321,7 @@ MakeMountCmd(struct cmd_syndesc *as, void *arock)
     }
     if ( IsFreelanceRoot(parent) ) {
        if ( !IsAdmin() ) {
-           fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
+           fprintf(stderr,"%s: Only AFS Client Administrators may alter the Freelance root.afs volume\n", pn);
            return 1;
        }
 
@@ -2486,7 +2498,7 @@ RemoveMountCmd(struct cmd_syndesc *as, void *arock) {
        }
 
         if ( IsFreelanceRoot(tbuffer) && !IsAdmin() ) {
-            fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
+            fprintf(stderr,"%s: Only AFS Client Administrators may alter the Freelance root.afs volume\n", pn);
             error = 1;
             continue;   /* skip */
         }