summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/modules/vfs_crossrename.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/modules/vfs_crossrename.c b/source3/modules/vfs_crossrename.c
index 9bb42b9958..c7534b4319 100644
--- a/source3/modules/vfs_crossrename.c
+++ b/source3/modules/vfs_crossrename.c
@@ -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;