summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/ntvfs/posix/pvfs_open.c20
-rw-r--r--source4/ntvfs/posix/pvfs_read.c1
-rw-r--r--source4/ntvfs/posix/pvfs_rename.c10
3 files changed, 31 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index 7901ef577b..d9d0d2178a 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -206,6 +206,8 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
if (io->ntcreatex.in.access_mask == SEC_FLAG_MAXIMUM_ALLOWED &&
(io->ntcreatex.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) &&
(io->ntcreatex.in.create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE)) {
+ DEBUG(3,(__location__ ": Invalid access_mask/create_options 0x%08x 0x%08x for %s\n",
+ io->ntcreatex.in.access_mask, io->ntcreatex.in.create_options, name->original_name));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -229,6 +231,8 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
case NTCREATEX_DISP_OVERWRITE:
case NTCREATEX_DISP_SUPERSEDE:
default:
+ DEBUG(3,(__location__ ": Invalid open disposition 0x%08x for %s\n",
+ io->generic.in.open_disposition, name->original_name));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -618,15 +622,21 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
struct security_descriptor *sd = NULL;
if (io->ntcreatex.in.file_attr & ~FILE_ATTRIBUTE_ALL_MASK) {
+ DEBUG(3,(__location__ ": Invalid file_attr 0x%08x for %s\n",
+ io->ntcreatex.in.file_attr, name->original_name));
return NT_STATUS_INVALID_PARAMETER;
}
if (io->ntcreatex.in.file_attr & FILE_ATTRIBUTE_ENCRYPTED) {
+ DEBUG(3,(__location__ ": Invalid encryption request for %s\n",
+ name->original_name));
return NT_STATUS_ACCESS_DENIED;
}
if ((io->ntcreatex.in.file_attr & FILE_ATTRIBUTE_READONLY) &&
(create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE)) {
+ DEBUG(4,(__location__ ": Invalid delete on close for readonly file %s\n",
+ name->original_name));
return NT_STATUS_CANNOT_DELETE;
}
@@ -1213,6 +1223,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
access_mask = io->generic.in.access_mask;
if (share_access & ~NTCREATEX_SHARE_ACCESS_MASK) {
+ DEBUG(3,(__location__ ": Invalid share_access 0x%08x for %s\n",
+ share_access, io->ntcreatex.in.fname));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1230,6 +1242,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
}
if (create_options & NTCREATEX_OPTIONS_INVALID_PARAM_MASK) {
+ DEBUG(3,(__location__ ": Invalid create_options 0x%08x for %s\n",
+ create_options, io->ntcreatex.in.fname));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1260,6 +1274,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
/* other create options are not allowed */
if ((create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) &&
!(access_mask & SEC_STD_DELETE)) {
+ DEBUG(3,(__location__ ": Invalid delete_on_close option 0x%08x with access_mask 0x%08x for %s\n",
+ create_options, access_mask, io->ntcreatex.in.fname));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1291,6 +1307,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
if (io->ntcreatex.in.file_attr & (FILE_ATTRIBUTE_DEVICE|
FILE_ATTRIBUTE_VOLUME|
(~FILE_ATTRIBUTE_ALL_MASK))) {
+ DEBUG(3,(__location__ ": Invalid file_attr 0x%08x for %s\n",
+ io->ntcreatex.in.file_attr, io->ntcreatex.in.fname));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1374,6 +1392,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
break;
default:
+ DEBUG(3,(__location__ ": Invalid open disposition 0x%08x for %s\n",
+ io->generic.in.open_disposition, name->original_name));
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index 75fba3c90d..d25036ad4b 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -60,6 +60,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
maxcnt = rd->readx.in.maxcnt;
if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2) {
+ DEBUG(3,(__location__ ": Invalid SMB maxcnt 0x%x\n", maxcnt));
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c
index d963357cba..66c1427a11 100644
--- a/source4/ntvfs/posix/pvfs_rename.c
+++ b/source4/ntvfs/posix/pvfs_rename.c
@@ -366,6 +366,8 @@ static NTSTATUS pvfs_rename_wildcard(struct pvfs_state *pvfs,
if (strncmp(dir_path, name2->full_name, strlen(dir_path)) != 0 ||
name2->full_name[strlen(dir_path)] != '/' ||
strchr(name2->full_name + strlen(dir_path) + 1, '/')) {
+ DEBUG(3,(__location__ ": Invalid rename for %s -> %s\n",
+ name1->original_name, name2->original_name));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -480,10 +482,14 @@ static NTSTATUS pvfs_rename_stream(struct ntvfs_module_context *ntvfs,
struct odb_lock *lck = NULL;
if (name1->has_wildcard) {
+ DEBUG(3,(__location__ ": Invalid wildcard rename for %s\n",
+ name1->original_name));
return NT_STATUS_INVALID_PARAMETER;
}
if (ren->ntrename.in.new_name[0] != ':') {
+ DEBUG(3,(__location__ ": Invalid rename for %s\n",
+ ren->ntrename.in.new_name));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -492,6 +498,8 @@ static NTSTATUS pvfs_rename_stream(struct ntvfs_module_context *ntvfs,
}
if (ren->ntrename.in.flags != RENAME_FLAG_RENAME) {
+ DEBUG(3,(__location__ ": Invalid rename flags 0x%x for %s\n",
+ ren->ntrename.in.flags, ren->ntrename.in.new_name));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -621,6 +629,8 @@ static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
return pvfs_copy_file(pvfs, name1, name2);
case RENAME_FLAG_MOVE_CLUSTER_INFORMATION:
+ DEBUG(3,(__location__ ": Invalid rename cluster for %s\n",
+ name1->original_name));
return NT_STATUS_INVALID_PARAMETER;
default: