summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 6e2a5712c8..60b85d9730 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -217,7 +217,7 @@ static int vfswrap_mkdir(vfs_handle_struct *handle, const char *path, mode_t mo
if (lp_inherit_acls(SNUM(handle->conn))
&& parent_dirname(talloc_tos(), path, &parent, NULL)
&& (has_dacl = directory_has_default_acl(handle->conn, parent)))
- mode = 0777;
+ mode = (0777 & lp_dir_mask(SNUM(handle->conn)));
TALLOC_FREE(parent);
@@ -898,7 +898,11 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
} else {
result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0);
}
-#elif defined(HAVE_UTIMES)
+ if (!((result == -1) && (errno == ENOSYS))) {
+ goto out;
+ }
+#endif
+#if defined(HAVE_UTIMES)
if (ft != NULL) {
struct timeval tv[2];
tv[0] = convert_timespec_to_timeval(ft->atime);
@@ -907,7 +911,11 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
} else {
result = utimes(smb_fname->base_name, NULL);
}
-#elif defined(HAVE_UTIME)
+ if (!((result == -1) && (errno == ENOSYS))) {
+ goto out;
+ }
+#endif
+#if defined(HAVE_UTIME)
if (ft != NULL) {
struct utimbuf times;
times.actime = convert_timespec_to_time_t(ft->atime);
@@ -916,10 +924,12 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
} else {
result = utime(smb_fname->base_name, NULL);
}
-#else
+ if (!((result == -1) && (errno == ENOSYS))) {
+ goto out;
+ }
+#endif
errno = ENOSYS;
result = -1;
-#endif
out:
END_PROFILE(syscall_ntimes);