From c6baacd7f0b798692dba2af9a02fe9de67bb73f8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 27 Jun 2014 17:03:28 -0700 Subject: [PATCH] s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module. This is already done for [f]chown errors. Fix from CurlyMo Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider --- source3/modules/vfs_crossrename.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_crossrename.c b/source3/modules/vfs_crossrename.c index 9bb42b9958e..c7534b43198 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;