]> Savannah Git Hosting - gnulib.git/commitdiff
acl-permissions: more porting to AIX
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 5 Jun 2015 18:47:37 +0000 (11:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Jun 2015 00:15:11 +0000 (17:15 -0700)
* lib/file-has-acl.c (file_has_acl) [HAVE_STATACL]:
* lib/readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]:
* lib/set-permissions.c (set_acls) [HAVE_ACLX_GET && ACL_AIX_WIP]:
Add cast for AIX, whose system calls are declared to accept
char * even though the arguments are really char const *.
* lib/mountlist.c (read_file_system_list) [MOUNTED_VMOUNT]:
Rework types to pacify xlc.

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

index 296ccaf1417292177380b5bc91ba43f79345af0c..cba559d930e350fa03373aa019c102abf629d75d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,11 +5,20 @@
 
 2015-06-05  Paul Eggert  <eggert@cs.ucla.edu>
 
-       acl-permissions: port to older AIX, C89 HP-UX
+       acl-permissions: port to AIX, C89 HP-UX
+       Problems reported by Michael Felt.
+       * lib/file-has-acl.c (file_has_acl) [HAVE_STATACL]:
+       * lib/get-permissions.c (get_permissions) [USE_ACL && HAVE_STATACL]:
+       * lib/readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]:
+       * lib/set-permissions.c (set_acls) [HAVE_ACLX_GET && ACL_AIX_WIP]:
+       Add cast for AIX, whose system calls are declared to accept
+       char * even though the arguments are really char const *.
        * lib/get-permissions.c (get_permissions):
        If USE_ACL && HAVE_GETACL /* HP-UX */, don't assume C99.
        If USE_ACL && HAVE_STATACL /* older AIX */, add missing decl
-       that broke a build, reported by Michael Felt.
+       that broke a build.
+       * lib/mountlist.c (read_file_system_list) [MOUNTED_VMOUNT]:
+       Rework types to pacify xlc.
 
 2015-06-03  Pádraig Brady  <P@draigBrady.com>
 
index 7e26c53c158911544f22c85829934b932a982bf8..8488b7e642ffcb66e3ac27abf56db40fbf566600 100644 (file)
@@ -457,7 +457,7 @@ file_has_acl (char const *name, struct stat const *sb)
 
       union { struct acl a; char room[4096]; } u;
 
-      if (statacl (name, STX_NORMAL, &u.a, sizeof (u)) < 0)
+      if (statacl ((char *) name, STX_NORMAL, &u.a, sizeof (u)) < 0)
         return -1;
 
       return acl_nontrivial (&u.a);
index fe3615720eed6bc93daa2733c96f2a82e3f85448..d548252b241d6a3ddaa92825e7a1d5ed7dcd8020 100644 (file)
@@ -970,18 +970,20 @@ read_file_system_list (bool need_fs_type)
 #ifdef MOUNTED_VMOUNT           /* AIX.  */
   {
     int bufsize;
-    char *entries, *thisent;
+    void *entries;
+    char *thisent;
     struct vmount *vmp;
     int n_entries;
     int i;
 
     /* Ask how many bytes to allocate for the mounted file system info.  */
-    if (mntctl (MCTL_QUERY, sizeof bufsize, (struct vmount *) &bufsize) != 0)
+    entries = &bufsize;
+    if (mntctl (MCTL_QUERY, sizeof bufsize, entries) != 0)
       return NULL;
     entries = xmalloc (bufsize);
 
     /* Get the list of mounted file systems.  */
-    n_entries = mntctl (MCTL_QUERY, bufsize, (struct vmount *) entries);
+    n_entries = mntctl (MCTL_QUERY, bufsize, entries);
     if (n_entries < 0)
       {
         int saved_errno = errno;
index 8a3936fb09fd5ddd21f9f38a79955e112271d28c..10050037fc3348e0643abfa95c874b41e30bb4f9 100644 (file)
@@ -97,7 +97,7 @@ read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
      Solaris' utmpname returns 1 upon success -- which is contrary
      to what the GNU libc version does.  In addition, older GNU libc
      versions are actually void.   */
-  UTMP_NAME_FUNCTION (file);
+  UTMP_NAME_FUNCTION ((char *) file);
 
   SET_UTMP_ENT ();
 
index ba291f316f6166a8d346a29a0d620e2173f63c69..22368799f7e490cd575c8b6178dfbf70382e1a98 100644 (file)
@@ -699,7 +699,7 @@ set_acls (struct permission_context *ctx, const char *name, int desc,
       if (desc != -1)
        ret = fchacl (desc, &ctx->u.a, ctx->u.a.acl_len);
       else
-       ret = chacl (name, &ctx->u.a, ctx->u.a.acl_len);
+       ret = chacl ((char *) name, &ctx->u.a, ctx->u.a.acl_len);
       if (ret < 0)
        {
          if (errno == ENOSYS && from_mode)