]> granicus.if.org Git - shadow/commitdiff
* libmisc/copydir.c: Ignore errors to copy ACLs if the operation
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 21 Nov 2011 19:34:22 +0000 (19:34 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 21 Nov 2011 19:34:22 +0000 (19:34 +0000)
is not supported.

ChangeLog
libmisc/copydir.c

index 0e1c65e48a6be04f36644875afafc5cc32b39fda..b69f9c265826c1b0ffab49817039c1bf4fdba776 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-21  Peter Vrabec  <pvrabec@redhat.com>
+
+       * libmisc/copydir.c: Ignore errors to copy ACLs if the operation
+       is not supported.
+
 2011-11-19  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/root_flag.c, src/gpasswd.c, src/chsh.c: Add splint
index 49bd078673dbd8f69a7a54b727647a3afc456562..93f2b4f20102b6dc7ece9883facaf60e9a055cc3 100644 (file)
@@ -183,6 +183,7 @@ static void error_acl (struct error_context *ctx, const char *fmt, ...)
        /* ignore the case when destination does not support ACLs 
         * or extended attributes */
        if (ENOTSUP == errno) {
+               errno = 0;
                return;
        }
 
@@ -555,7 +556,7 @@ static int copy_dir (const char *src, const char *dst,
                                 old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL
            || (   (perm_copy_file (src, dst, &ctx) != 0)
-               && (errno != ENOTSUP))
+               && (errno != 0))
 #else                          /* !WITH_ACL */
            || (chmod (dst, statp->st_mode) != 0)
 #endif                         /* !WITH_ACL */
@@ -567,7 +568,9 @@ static int copy_dir (const char *src, const char *dst,
         * file systems with and without ACL support needs some
         * additional logic so that no unexpected permissions result.
         */
-           || (!reset_selinux && (attr_copy_file (src, dst, NULL, &ctx) != 0))
+           || (   !reset_selinux
+               && (attr_copy_file (src, dst, NULL, &ctx) != 0)
+               && (errno != 0))
 #endif                         /* WITH_ATTR */
            || (copy_tree (src, dst, false, reset_selinux,
                           old_uid, new_uid, old_gid, new_gid) != 0)
@@ -754,7 +757,7 @@ static int copy_special (const char *src, const char *dst,
                                 old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL
            || (   (perm_copy_file (src, dst, &ctx) != 0)
-               && (errno != ENOTSUP))
+               && (errno != 0))
 #else                          /* !WITH_ACL */
            || (chmod (dst, statp->st_mode & 07777) != 0)
 #endif                         /* !WITH_ACL */
@@ -766,7 +769,9 @@ static int copy_special (const char *src, const char *dst,
         * file systems with and without ACL support needs some
         * additional logic so that no unexpected permissions result.
         */
-           || (!reset_selinux && (attr_copy_file (src, dst, NULL, &ctx) != 0))
+           || (   !reset_selinux
+               && (attr_copy_file (src, dst, NULL, &ctx) != 0)
+               && (errno != 0))
 #endif                         /* WITH_ATTR */
            || (utimes (dst, mt) != 0)) {
                err = -1;
@@ -812,7 +817,7 @@ static int copy_file (const char *src, const char *dst,
                                  old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL
            || (   (perm_copy_fd (src, ifd, dst, ofd, &ctx) != 0)
-               && (errno != ENOTSUP))
+               && (errno != 0))
 #else                          /* !WITH_ACL */
            || (fchmod (ofd, statp->st_mode & 07777) != 0)
 #endif                         /* !WITH_ACL */
@@ -824,7 +829,9 @@ static int copy_file (const char *src, const char *dst,
         * file systems with and without ACL support needs some
         * additional logic so that no unexpected permissions result.
         */
-           || (!reset_selinux && (attr_copy_fd (src, ifd, dst, ofd, NULL, &ctx) != 0))
+           || (   !reset_selinux
+               && (attr_copy_fd (src, ifd, dst, ofd, NULL, &ctx) != 0)
+               && (errno != 0))
 #endif                         /* WITH_ATTR */
           ) {
                (void) close (ifd);