summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_acl.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-30 05:50:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:44 -0500
commite913a48ded85e7baf91a355fff46fe270afed936 (patch)
tree9133ded6ec35d1855798cc2bb13a6c78e0e07633 /source4/ntvfs/posix/pvfs_acl.c
parent447a346f0dea0b6099f047b406b55b7304bf2d46 (diff)
downloadsamba-e913a48ded85e7baf91a355fff46fe270afed936.tar.gz
samba-e913a48ded85e7baf91a355fff46fe270afed936.tar.bz2
samba-e913a48ded85e7baf91a355fff46fe270afed936.zip
r4408: added the remaining access check hooks into pvfs. All calls should now have acl checking,
and obey the various inheritance rules. (This used to be commit 5fe51807d6b97e68b65f152c0f405e5c5a025d21)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_acl.c')
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index c2309b92ea..a5cd9ebd79 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -371,9 +371,30 @@ NTSTATUS pvfs_access_check_simple(struct pvfs_state *pvfs,
struct pvfs_filename *name,
uint32_t access_needed)
{
+ if (access_needed == 0) {
+ return NT_STATUS_OK;
+ }
return pvfs_access_check(pvfs, req, name, &access_needed);
}
+/*
+ access check for creating a new file/directory
+*/
+NTSTATUS pvfs_access_check_create(struct pvfs_state *pvfs,
+ struct smbsrv_request *req,
+ struct pvfs_filename *name)
+{
+ struct pvfs_filename *parent;
+ NTSTATUS status;
+
+ status = pvfs_resolve_parent(pvfs, req, name, &parent);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return pvfs_access_check_simple(pvfs, req, name, SEC_DIR_ADD_FILE);
+}
+
/*
determine if an ACE is inheritable