changeset 18048:7cb7c39a86df

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.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 04 Jul 2015 11:05:00 -0700
parents 6303ffca4ba4
children c0df04e73c91
files ChangeLog lib/file-has-acl.c lib/set-permissions.c
diffstat 3 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jul 04 08:25:21 2015 -0700
+++ b/ChangeLog	Sat Jul 04 11:05:00 2015 -0700
@@ -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
--- a/lib/file-has-acl.c	Sat Jul 04 08:25:21 2015 -0700
+++ b/lib/file-has-acl.c	Sat Jul 04 11:05:00 2015 -0700
@@ -349,7 +349,7 @@
               if (stat (name, &statbuf) < 0)
                 return -1;
 
-              return acl_nontrivial (count, entries, &statbuf);
+              return acl_nontrivial (count, entries);
             }
           }
       }
--- a/lib/set-permissions.c	Sat Jul 04 08:25:21 2015 -0700
+++ b/lib/set-permissions.c	Sat Jul 04 11:05:00 2015 -0700
@@ -288,13 +288,13 @@
 
   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 @@
   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 @@
 
   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 @@
       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