]> Savannah Git Hosting - gnulib.git/commitdiff
file-has-acl, acl-permissions: fix HP-UX typos
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Jul 2015 18:05:00 +0000 (11:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Jul 2015 18:05:50 +0000 (11:05 -0700)
Problem reported by John David Anglin in: http://bugs.gnu.org/20979
* lib/file-has-acl.c (file_has_acl):
* lib/set-permissions.c (context_acl_from_mode)
(context_aclv_from_mode, set_acls):
Fix some obvious typos when HAVE_GETCL /* HP-UX */.
They were introduced by the recent ACL changes.

ChangeLog
lib/file-has-acl.c
lib/set-permissions.c

index 493186878192e100b53969a3c84ea8558a5d9ae8..d6b184a4a813e20bc649f82baefd116d7ab483dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-07-04  Paul Eggert  <eggert@cs.ucla.edu>
 
+       file-has-acl, acl-permissions: fix HP-UX typos
+       Problem reported by John David Anglin in: http://bugs.gnu.org/20979
+       * lib/file-has-acl.c (file_has_acl):
+       * lib/set-permissions.c (context_acl_from_mode)
+       (context_aclv_from_mode, set_acls):
+       Fix some obvious typos when HAVE_GETCL /* HP-UX */.
+       They were introduced by the recent ACL changes.
+
        regex: match current GNU grep behavior
        These symbols have not matched GNU grep behavior for quite some time.
        Fix prompted by Balazs Kezes bug report at: http://bugs.gnu.org/20974
index 8488b7e642ffcb66e3ac27abf56db40fbf566600..b78a8793fe2f245229bdb92d0e3d74e3206a1004 100644 (file)
@@ -349,7 +349,7 @@ file_has_acl (char const *name, struct stat const *sb)
               if (stat (name, &statbuf) < 0)
                 return -1;
 
-              return acl_nontrivial (count, entries, &statbuf);
+              return acl_nontrivial (count, entries);
             }
           }
       }
index a96b86c17fc555fb97fcadb1cf30e5f8da077e78..41f6cb2d7b2aa1fa9849f3e75cecb663c6cd3863 100644 (file)
@@ -288,13 +288,13 @@ context_acl_from_mode (struct permission_context *ctx, const char *name, int des
 
   ctx->entries[0].uid = statbuf.st_uid;
   ctx->entries[0].gid = ACL_NSGROUP;
-  ctx->entries[0].mode = (mode >> 6) & 7;
+  ctx->entries[0].mode = (ctx->mode >> 6) & 7;
   ctx->entries[1].uid = ACL_NSUSER;
   ctx->entries[1].gid = statbuf.st_gid;
-  ctx->entries[1].mode = (mode >> 3) & 7;
+  ctx->entries[1].mode = (ctx->mode >> 3) & 7;
   ctx->entries[2].uid = ACL_NSUSER;
   ctx->entries[2].gid = ACL_NSGROUP;
-  ctx->entries[2].mode = mode & 7;
+  ctx->entries[2].mode = ctx->mode & 7;
   ctx->count = 3;
   return 0;
 }
@@ -319,7 +319,7 @@ context_aclv_from_mode (struct permission_context *ctx)
   ctx->aclv_entries[3].a_perm = mode & 7;
   ctx->aclv_count = 4;
 
-  ret = aclsort (sizeof (entries) / sizeof (struct acl), 1, entries);
+  ret = aclsort (ctx->aclv_count, 1, entries);
   if (ret > 0)
     abort ();
   return ret;
@@ -461,19 +461,19 @@ context_acl_from_mode (struct permission_context *ctx)
 
   ctx->entries[0].a_type = USER_OBJ;
   ctx->entries[0].a_id = 0; /* irrelevant */
-  ctx->entries[0].a_perm = (mode >> 6) & 7;
+  ctx->entries[0].a_perm = (ctx->mode >> 6) & 7;
   ctx->entries[1].a_type = GROUP_OBJ;
   ctx->entries[1].a_id = 0; /* irrelevant */
-  ctx->entries[1].a_perm = (mode >> 3) & 7;
+  ctx->entries[1].a_perm = (ctx->mode >> 3) & 7;
   ctx->entries[2].a_type = CLASS_OBJ;
   ctx->entries[2].a_id = 0;
-  ctx->entries[2].a_perm = (mode >> 3) & 7;
+  ctx->entries[2].a_perm = (ctx->mode >> 3) & 7;
   ctx->entries[3].a_type = OTHER_OBJ;
   ctx->entries[3].a_id = 0;
-  ctx->entries[3].a_perm = mode & 7;
+  ctx->entries[3].a_perm = ctx->mode & 7;
   ctx->count = 4;
 
-  ret = aclsort (sizeof (entries) / sizeof (struct acl), 1, entries);
+  ret = aclsort (ctx->count, 1, entries);
   if (ret > 0)
     abort ();
   return ret;
@@ -660,7 +660,7 @@ set_acls (struct permission_context *ctx, const char *name, int desc,
       if (ret < 0)
        {
          if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)
-             && (from_mode || !acl_nontrivial (ctx->count, ctx->entries, &source_statbuf)))
+             && (from_mode || !acl_nontrivial (ctx->count, ctx->entries)))
            ret = 0;
        }
       else