summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 5bbd618231..2952c9b1dc 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -5132,12 +5132,24 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
{
NTSTATUS status = NT_STATUS_OK;
files_struct *fsp = NULL;
+ uint16 flags = 0;
int info = 0;
+ if (total_data < 2) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ flags = SVAL(pdata,0);
+
if (!VALID_STAT(*psbuf)) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
+ if ((flags == SMB_POSIX_UNLINK_DIRECTORY_TARGET) &&
+ !VALID_STAT_OF_DIR(*psbuf)) {
+ return NT_STATUS_NOT_A_DIRECTORY;
+ }
+
if (VALID_STAT_OF_DIR(*psbuf)) {
status = open_directory(conn,
fname,