summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_default.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index cfd3b1e818..3171d3c5ca 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -150,12 +150,17 @@ static int vfswrap_mkdir(vfs_handle_struct *handle, const char *path, mode_t mo
{
int result;
bool has_dacl = False;
+ char *parent = NULL;
START_PROFILE(syscall_mkdir);
- if (lp_inherit_acls(SNUM(handle->conn)) && (has_dacl = directory_has_default_acl(handle->conn, parent_dirname(path))))
+ if (lp_inherit_acls(SNUM(handle->conn))
+ && parent_dirname_talloc(talloc_tos(), path, &parent, NULL)
+ && (has_dacl = directory_has_default_acl(handle->conn, parent)))
mode = 0777;
+ TALLOC_FREE(parent);
+
result = mkdir(path, mode);
if (result == 0 && !has_dacl) {