we can't query the ACL on a new file till it exists!
[gd/samba/.git] / source4 / ntvfs / posix / pvfs_open.c
index 01a249ceb76f70a63f4b0a469d6c97360e1857c7..6114b2052c1cf2f95f84fd202cd3d63f8651e90c 100644 (file)
@@ -631,12 +631,6 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
        status = pvfs_access_check_create(pvfs, req, name, &access_mask);
        NT_STATUS_NOT_OK_RETURN(status);
 
-       if (io->generic.in.query_maximal_access) {
-               status = pvfs_access_maximal_allowed(pvfs, req, name, 
-                                                    &io->generic.out.maximal_access);
-               NT_STATUS_NOT_OK_RETURN(status);
-       }
-
        /* check that the parent isn't opened with delete on close set */
        status = pvfs_resolve_parent(pvfs, req, name, &parent);
        if (NT_STATUS_IS_OK(status)) {
@@ -707,6 +701,12 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
                goto cleanup_delete;
        }
 
+       if (io->generic.in.query_maximal_access) {
+               status = pvfs_access_maximal_allowed(pvfs, req, name, 
+                                                    &io->generic.out.maximal_access);
+               NT_STATUS_NOT_OK_RETURN(status);
+       }
+
        /* form the lock context used for byte range locking and
           opendb locking */
        status = pvfs_locking_key(name, f->handle, &f->handle->odb_locking_key);