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
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)
int vfswrap_fchown(files_struct *fsp, int fd, uid_t uid, gid_t gid)
{
+#ifdef HAVE_FCHOWN
int result;
START_PROFILE(syscall_fchown);
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)
/* just in case they have used the buggy xinetd to create the file */
if (fstat(fileno(f), &st) == 0 &&
(st.st_mode & S_IWOTH)) {
+#if defined HAVE_FCHMOD
fchmod(fileno(f), S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
+#else
+ chmod(dyn_CONFIGFILE, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
+#endif
}
write_config(f, False);