diff options
author | Jeremy Allison <jra@samba.org> | 2003-05-07 18:28:24 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-05-07 18:28:24 +0000 |
commit | cf78b1e7fe72aec72d03c86c46a8ca49df539c11 (patch) | |
tree | c51c94b6ce83f8cd14c6eb28f669408355eb0295 /source/smbd | |
parent | 7645d3d28afbb8eea502c0e063df3afb3aa812f4 (diff) | |
download | samba-cf78b1e7fe72aec72d03c86c46a8ca49df539c11.tar.gz samba-cf78b1e7fe72aec72d03c86c46a8ca49df539c11.tar.xz samba-cf78b1e7fe72aec72d03c86c46a8ca49df539c11.zip |
Make fchown, fchmod conditional for systems that don't have them.
Jeremy.
Diffstat (limited to 'source/smbd')
-rw-r--r-- | source/smbd/vfs-wrap.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source/smbd/vfs-wrap.c b/source/smbd/vfs-wrap.c index bae304096ce..491fa70e687 100644 --- a/source/smbd/vfs-wrap.c +++ b/source/smbd/vfs-wrap.c @@ -298,10 +298,10 @@ int vfswrap_chmod(connection_struct *conn, const char *path, mode_t mode) int vfswrap_fchmod(files_struct *fsp, int fd, mode_t mode) { - int result; + int result; struct vfs_ops *vfs_ops = &fsp->conn->vfs_ops; - START_PROFILE(syscall_fchmod); + START_PROFILE(syscall_fchmod); /* * We need to do this due to the fact that the default POSIX ACL @@ -319,9 +319,15 @@ int vfswrap_fchmod(files_struct *fsp, int fd, mode_t mode) errno = saved_errno; } - result = fchmod(fd, mode); - END_PROFILE(syscall_fchmod); - return result; +#if defined(HAVE_FCHMOD) + result = fchmod(fd, mode); +#else + result = -1; + errno = ENOSYS; +#endif + + END_PROFILE(syscall_fchmod); + return result; } int vfswrap_chown(connection_struct *conn, const char *path, uid_t uid, gid_t gid) @@ -336,6 +342,7 @@ int vfswrap_chown(connection_struct *conn, const char *path, uid_t uid, gid_t gi int vfswrap_fchown(files_struct *fsp, int fd, uid_t uid, gid_t gid) { +#ifdef HAVE_FCHOWN int result; START_PROFILE(syscall_fchown); @@ -343,6 +350,10 @@ int vfswrap_fchown(files_struct *fsp, int fd, uid_t uid, gid_t gid) result = fchown(fd, uid, gid); END_PROFILE(syscall_fchown); return result; +#else + errno = ENOSYS; + return -1; +#endif } int vfswrap_chdir(connection_struct *conn, const char *path) |