From a843787637292e115cc1bd66475e6d4d686f9bc0 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 7 Mar 2004 00:34:49 +0000 Subject: Enclose use of fchown() with guards. Bugzilla #1155. (This used to be commit 92f6895dd11189ce966b8b5a3f9ace54f478a375) --- source3/smbd/vfs-wrap.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3') 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; /* -- cgit