]> granicus.if.org Git - shadow/commitdiff
2011-11-16 Peter Vrabec <pvrabec@redhat.com>
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 16 Nov 2011 21:00:43 +0000 (21:00 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 16 Nov 2011 21:00:43 +0000 (21:00 +0000)
* libmisc/copydir.c: Ignore perm_copy_file() errors with errno set
to ENOTSUP.

ChangeLog
libmisc/copydir.c

index bdfd33da3098ac98a6ab6c891bc96114511a9428..28920eb81e9e2b23b5cb2b4a59b951bffcac91b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-16  Peter Vrabec  <pvrabec@redhat.com>
+
+       * libmisc/copydir.c: Ignore perm_copy_file() errors with errno set
+       to ENOTSUP.
+
 2011-11-16  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/useradd.c: Compilation fix when SHADOWGRP is not enabled.
index 1774aeffa4d099253bead2fd4770ddb02fa07b5a..49bd078673dbd8f69a7a54b727647a3afc456562 100644 (file)
@@ -180,6 +180,12 @@ static void error_acl (struct error_context *ctx, const char *fmt, ...)
 {
        va_list ap;
 
+       /* ignore the case when destination does not support ACLs 
+        * or extended attributes */
+       if (ENOTSUP == errno) {
+               return;
+       }
+
        va_start (ap, fmt);
        (void) fprintf (stderr, _("%s: "), Prog);
        if (vfprintf (stderr, fmt, ap) != 0) {
@@ -548,7 +554,8 @@ static int copy_dir (const char *src, const char *dst,
            || (chown_if_needed (dst, statp,
                                 old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL
-           || (perm_copy_file (src, dst, &ctx) != 0)
+           || (   (perm_copy_file (src, dst, &ctx) != 0)
+               && (errno != ENOTSUP))
 #else                          /* !WITH_ACL */
            || (chmod (dst, statp->st_mode) != 0)
 #endif                         /* !WITH_ACL */
@@ -746,7 +753,8 @@ static int copy_special (const char *src, const char *dst,
            || (chown_if_needed (dst, statp,
                                 old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL
-           || (perm_copy_file (src, dst, &ctx) != 0)
+           || (   (perm_copy_file (src, dst, &ctx) != 0)
+               && (errno != ENOTSUP))
 #else                          /* !WITH_ACL */
            || (chmod (dst, statp->st_mode & 07777) != 0)
 #endif                         /* !WITH_ACL */
@@ -803,7 +811,8 @@ static int copy_file (const char *src, const char *dst,
            || (fchown_if_needed (ofd, statp,
                                  old_uid, new_uid, old_gid, new_gid) != 0)
 #ifdef WITH_ACL
-           || (perm_copy_fd (src, ifd, dst, ofd, &ctx) != 0)
+           || (   (perm_copy_fd (src, ifd, dst, ofd, &ctx) != 0)
+               && (errno != ENOTSUP))
 #else                          /* !WITH_ACL */
            || (fchmod (ofd, statp->st_mode & 07777) != 0)
 #endif                         /* !WITH_ACL */