/* ignore the case when destination does not support ACLs
* or extended attributes */
if (ENOTSUP == errno) {
+ errno = 0;
return;
}
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 */
* 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)
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 */
* 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;
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 */
* 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);