summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/vfs-wrap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index 4f2d82734f..5393dfc755 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -359,7 +359,11 @@ static int copy_reg(const char *source, const char *dest)
* But root probably wants to know, e.g. if NFS disallows it.
*/
+#ifdef HAVE_FCHOWN
if ((fchown(ofd, source_stats.st_uid, source_stats.st_gid) == -1) && (errno != EPERM))
+#else
+ if ((chown(dest, source_stats.st_uid, source_stats.st_gid) == -1) && (errno != EPERM))
+#endif
goto err;
/*