s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.
authorJeremy Allison <jra@samba.org>
Sat, 28 Jun 2014 00:03:28 +0000 (17:03 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 8 Jul 2014 05:49:37 +0000 (07:49 +0200)
This is already done for [f]chown errors. Fix from CurlyMo <curlymoo1@gmail.com>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/modules/vfs_crossrename.c

index 9bb42b9958ee9c793f342736dbbd97b378aa1a30..c7534b43198e7dde563d9ebf2a6c9f6d0ff16a49 100644 (file)
@@ -106,9 +106,11 @@ static int copy_reg(const char *source, const char *dest)
         */
 
 #if defined(HAVE_FCHMOD)
-       if (fchmod (ofd, source_stats.st_ex_mode & 07777))
+       if ((fchmod (ofd, source_stats.st_ex_mode & 07777) == -1) &&
+                       (errno != EPERM))
 #else
-       if (chmod (dest, source_stats.st_ex_mode & 07777))
+       if ((chmod (dest, source_stats.st_ex_mode & 07777) == -1) &&
+                       (errno != EPERM))
 #endif
                goto err;