bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $(LIB_ACL_TRIVIAL)


From: Bruno Haible
Subject: Re: $(LIB_ACL_TRIVIAL)
Date: Tue, 11 Dec 2007 12:31:10 +0100
User-agent: KMail/1.5.4

Paul Eggert wrote:
> I installed the following:

Your patch is hard to understand for me in unidiff format, so I tried to
convert it to context diff format, as usual, but this did not work:
  $ ud2cd < acl.udiff
  ud2cd: Warning: Incomplete hunk ending at line 87

I understand that GNU diff can now emit variants of the well-known unidiff
format, and you are using one of them. So I had to spend time updating the
'diffconvert' utilities to grok this (IMO pointless) variant, before I
could look at your patch. They are at
  http://www.haible.de/bruno/gnu/diffconvert-1.4.tar.gz

> 2007-12-03  Paul Eggert  <address@hidden>
> 
>       Add support for Solaris 10 ACLs.  Also, ACLs are Gnulib, not Autoconf.
>       * modules/acl (configure.ac): Rename AC_FUNC_ACL to gl_FUNC_ACL.
>       * m4/acl.m4 (gl_FUNC_ACL): Renamed from AC_FUNC_ACL.  On Solaris,
>       put -lsec in even for programs other than 'ls'.  This fixes a problem
>       for gettext reported by Bruno Haible in
>       <http://lists.gnu.org/archive/html/bug-gnulib/2007-12/msg00007.html>.
>       * lib/acl.c (copy_acl, qset_acl) [USE_ACL && defined ACL_NO_TRIVIAL]:
>       Add support for Solaris 10.  This isn't efficient, but should get the
>       job done for now.

You can avoid a bit of code duplication through a change like this:

--- lib/acl.c.bak       2007-12-09 22:55:42.000000000 +0100
+++ lib/acl.c   2007-12-09 22:58:15.000000000 +0100
@@ -161,8 +161,6 @@
 # endif
 
   ret = qset_acl (dst_name, dest_desc, mode);
-  if (ret != 0)
-    error (0, errno, _("preserving permissions for %s"), quote (dst_name));
 
 # if USE_ACL && defined ACL_NO_TRIVIAL
   if (ret == 0 && aclp)
@@ -170,12 +168,12 @@
       ret = (dest_desc < 0
             ? acl_set (dst_name, aclp)
             : facl_set (dest_desc, aclp));
-      if (ret != 0)
-       error (0, errno, _("preserving permissions for %s"), quote (dst_name));
       acl_free (aclp);
     }
 # endif
 
+  if (ret != 0)
+    error (0, errno, _("preserving permissions for %s"), quote (dst_name));
   return ret;
 #endif
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]