summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_mkdir.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_mkdir.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_mkdir.c')
-rw-r--r--source4/ntvfs/posix/pvfs_mkdir.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_mkdir.c b/source4/ntvfs/posix/pvfs_mkdir.c
index 14fffb6a2e..d2d431ae79 100644
--- a/source4/ntvfs/posix/pvfs_mkdir.c
+++ b/source4/ntvfs/posix/pvfs_mkdir.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "vfs_posix.h"
+#include "librpc/gen_ndr/ndr_security.h"
/*
create a directory with EAs
@@ -43,6 +44,11 @@ static NTSTATUS pvfs_t2mkdir(struct pvfs_state *pvfs,
return NT_STATUS_OBJECT_NAME_COLLISION;
}
+ status = pvfs_access_check_create(pvfs, req, name);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
mode = pvfs_fileperms(pvfs, FILE_ATTRIBUTE_DIRECTORY);
if (mkdir(name->full_name, mode) == -1) {
@@ -108,6 +114,11 @@ NTSTATUS pvfs_mkdir(struct ntvfs_module_context *ntvfs,
return NT_STATUS_OBJECT_NAME_COLLISION;
}
+ status = pvfs_access_check_create(pvfs, req, name);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
mode = pvfs_fileperms(pvfs, FILE_ATTRIBUTE_DIRECTORY);
if (mkdir(name->full_name, mode) == -1) {
@@ -146,6 +157,11 @@ NTSTATUS pvfs_rmdir(struct ntvfs_module_context *ntvfs,
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
+ status = pvfs_access_check_simple(pvfs, req, name, SEC_STD_DELETE);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
status = pvfs_xattr_unlink_hook(pvfs, name->full_name);
if (!NT_STATUS_IS_OK(status)) {
return status;