]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Use parent_dirname_talloc instead of parent_dirname in vfswrap_mkdir
authorVolker Lendecke <vl@samba.org>
Wed, 24 Dec 2008 12:41:42 +0000 (13:41 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 31 Dec 2008 18:33:24 +0000 (19:33 +0100)
source3/modules/vfs_default.c

index cfd3b1e81831e7109c36ba7861f48acc34e19e9b..3171d3c5ca5f86b71a9a7d33a2a9ada4c018b5e7 100644 (file)
@@ -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) {