summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-15 15:04:18 -0700
committerKarolin Seeger <kseeger@samba.org>2010-06-18 08:33:25 +0200
commit7cb2740c55b0387b0d992addcec6eee11ab4e169 (patch)
treeeb0d312ac52f4f824975f45ce1b80af1c93f40fb
parentbe88d6e2d3b66450a6ac083a046a62520bdc98aa (diff)
downloadsamba-7cb2740c55b0387b0d992addcec6eee11ab4e169.tar.gz
Fix bug #7188 - Logic error in check of total_data for call_trans2mkdir()
Make ea data checks identical for trans2open and trans2mkdir. Jeremy. (cherry picked from commit 704a607e3c3a5c3e727b386fab9dbcdff56b5ac4) (cherry picked from commit 0c20af069105befe8cf530050b5f948cde5391fe)
-rw-r--r--source3/smbd/trans2.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 36b2749700d..963103c85b8 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1060,12 +1060,7 @@ static void call_trans2open(connection_struct *conn,
}
/* Any data in this call is an EA list. */
- if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {
- reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
- goto out;
- }
-
- if (total_data != 4) {
+ if (total_data && (total_data != 4)) {
if (total_data < 10) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
goto out;
@@ -1084,9 +1079,11 @@ static void call_trans2open(connection_struct *conn,
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
goto out;
}
- } else if (IVAL(pdata,0) != 4) {
- reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
- goto out;
+
+ if (!lp_ea_support(SNUM(conn))) {
+ reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
+ goto out;
+ }
}
status = SMB_VFS_CREATE_FILE(
@@ -7806,19 +7803,14 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
return;
}
- /* Any data in this call is an EA list. */
- if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {
- reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
- goto out;
- }
-
/*
* OS/2 workplace shell seems to send SET_EA requests of "null"
* length (4 bytes containing IVAL 4).
* They seem to have no effect. Bug #3212. JRA.
*/
- if (total_data != 4) {
+ if (total_data && (total_data != 4)) {
+ /* Any data in this call is an EA list. */
if (total_data < 10) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
goto out;
@@ -7837,6 +7829,11 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
goto out;
}
+
+ if (!lp_ea_support(SNUM(conn))) {
+ reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
+ goto out;
+ }
}
/* If total_data == 4 Windows doesn't care what values
* are placed in that field, it just ignores them.