summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-09-17 09:29:07 -0700
committerJeremy Allison <jra@samba.org>2009-09-17 09:29:07 -0700
commit16836f9e9ed451b2a6690ad22a40cd1fb2cb3b46 (patch)
tree034fa043ec0b4b1ee9814f30294721f466134318
parente91cdef2d434b36ae655755ec41cea7c44df171c (diff)
downloadsamba-16836f9e9ed451b2a6690ad22a40cd1fb2cb3b46.tar.gz
samba-16836f9e9ed451b2a6690ad22a40cd1fb2cb3b46.tar.bz2
samba-16836f9e9ed451b2a6690ad22a40cd1fb2cb3b46.zip
We now pass the Microsoft SMB2 fileio test with EA's and streams...
Jeremy.
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/smbd/globals.c2
-rw-r--r--source3/smbd/nttrans.c2
-rw-r--r--source3/smbd/smb2_create.c10
-rw-r--r--source3/smbd/trans2.c59
5 files changed, 69 insertions, 5 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 81cb5ef6e1..1d8a6cd9fa 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6572,6 +6572,7 @@ void send_nt_replies(connection_struct *conn,
char *params, int paramsize,
char *pdata, int datasize);
void reply_ntcreate_and_X(struct smb_request *req);
+struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size);
void reply_ntcancel(struct smb_request *req);
void reply_ntrename(struct smb_request *req);
void reply_nttrans(struct smb_request *req);
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index f680b76369..68fa795ba2 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -95,7 +95,7 @@ time_t last_printer_reload_time = 0;
for processing.
****************************************************************************/
struct pending_message_list *deferred_open_queue = NULL;
-uint32_t common_flags2 = FLAGS2_LONG_PATH_COMPONENTS|FLAGS2_32_BIT_ERROR_CODES;
+uint32_t common_flags2 = FLAGS2_LONG_PATH_COMPONENTS|FLAGS2_32_BIT_ERROR_CODES|FLAGS2_EXTENDED_ATTRIBUTES;
struct smb_srv_trans_enc_ctx *partial_srv_trans_enc_ctx = NULL;
struct smb_srv_trans_enc_ctx *srv_trans_enc_ctx = NULL;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 1b981578e3..cf955d9651 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -810,7 +810,7 @@ static NTSTATUS set_sd(files_struct *fsp, uint8 *data, uint32 sd_len,
Read a list of EA names and data from an incoming data buffer. Create an ea_list with them.
****************************************************************************/
-static struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size)
+struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size)
{
struct ea_list *ea_list_head = NULL;
size_t offset = 0;
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 3090650c3b..e0815049a4 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -450,9 +450,13 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- /* TODO */
- tevent_req_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
- return tevent_req_post(req, ev);
+ ea_list = read_nttrans_ea_list(mem_ctx,
+ (const char *)exta->data.data, exta->data.length);
+ if (!ea_list) {
+ DEBUG(10,("smbd_smb2_create_send: read_ea_name_list failed.\n"));
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return tevent_req_post(req, ev);
+ }
}
if (mxac) {
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index f2c025b6c1..85eb73749a 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4379,6 +4379,9 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
case 0xFF0F:/*SMB2_INFO_QUERY_ALL_EAS*/
{
+ /* This is FileFullEaInformation - 0xF which maps to
+ * 1015 (decimal) in smbd_do_setfilepathinfo. */
+
/* We have data_size bytes to put EA's into. */
size_t total_ea_len = 0;
struct ea_list *ea_file_list = NULL;
@@ -5656,6 +5659,53 @@ static NTSTATUS smb_info_set_ea(connection_struct *conn,
}
/****************************************************************************
+ Deal with SMB_FILE_FULL_EA_INFORMATION set.
+****************************************************************************/
+
+static NTSTATUS smb_set_file_full_ea_info(connection_struct *conn,
+ const char *pdata,
+ int total_data,
+ files_struct *fsp)
+{
+ struct ea_list *ea_list = NULL;
+ NTSTATUS status;
+
+ if (!fsp) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
+
+ if (!lp_ea_support(SNUM(conn))) {
+ DEBUG(10, ("smb_set_file_full_ea_info - ea_len = %u but "
+ "EA's not supported.\n",
+ (unsigned int)total_data));
+ return NT_STATUS_EAS_NOT_SUPPORTED;
+ }
+
+ if (total_data < 10) {
+ DEBUG(10, ("smb_set_file_full_ea_info - ea_len = %u "
+ "too small.\n",
+ (unsigned int)total_data));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ ea_list = read_nttrans_ea_list(talloc_tos(),
+ pdata,
+ total_data);
+
+ if (!ea_list) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ status = set_ea(conn, fsp, fsp->fsp_name, ea_list);
+
+ DEBUG(10, ("smb_set_file_full_ea_info on file %s returned %s\n",
+ smb_fname_str_dbg(fsp->fsp_name),
+ nt_errstr(status) ));
+
+ return status;
+}
+
+
+/****************************************************************************
Deal with SMB_SET_FILE_DISPOSITION_INFO.
****************************************************************************/
@@ -7374,6 +7424,15 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
break;
}
+ case SMB_FILE_FULL_EA_INFORMATION:
+ {
+ status = smb_set_file_full_ea_info(conn,
+ pdata,
+ total_data,
+ fsp);
+ break;
+ }
+
/* From tridge Samba4 :
* MODE_INFORMATION in setfileinfo (I have no
* idea what "mode information" on a file is - it takes a value of 0,