diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-12-18 04:38:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:29 -0500 |
commit | ed42a64901ba0a7ad8cbaac582600688af1b7d72 (patch) | |
tree | b68217a14fbd61d1f58b702d7ecc5b9ee66f2ce5 /source4/smb_server | |
parent | b02c5abfb470575a67ced192b2913b5a1c73dd3e (diff) | |
download | samba-ed42a64901ba0a7ad8cbaac582600688af1b7d72.tar.gz samba-ed42a64901ba0a7ad8cbaac582600688af1b7d72.tar.bz2 samba-ed42a64901ba0a7ad8cbaac582600688af1b7d72.zip |
r4263: added support for the trans2 RAW_SEARCH_EA_LIST information
level. This is quite a strange level that we've never seen before, but
is used by the os2 workplace shell.
note w2k screws up this level when unicode is negotiated, so it only
passes the RAW-SEARCH test when you force non-unicode
(This used to be commit 25189b8fbf6515d573e3398dc9fca56505dc37b9)
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/trans2.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c index 0c827c92a1..12a4be0e35 100644 --- a/source4/smb_server/trans2.c +++ b/source4/smb_server/trans2.c @@ -1011,6 +1011,7 @@ static void find_fill_info(struct smbsrv_request *req, { uint8_t *data; uint_t ofs = trans->out.data.length; + uint32_t ea_size; switch (state->level) { case RAW_SEARCH_SEARCH: @@ -1061,6 +1062,29 @@ static void find_fill_info(struct smbsrv_request *req, trans->out.data.data[trans->out.data.length-1] = 0; break; + case RAW_SEARCH_EA_LIST: + ea_size = ea_list_size(file->ea_list.eas.num_eas, file->ea_list.eas.eas); + if (state->flags & FLAG_TRANS2_FIND_REQUIRE_RESUME) { + trans2_grow_data(req, trans, ofs + 27 + ea_size); + SIVAL(trans->out.data.data, ofs, file->ea_list.resume_key); + ofs += 4; + } else { + trans2_grow_data(req, trans, ofs + 23 + ea_size); + } + data = trans->out.data.data + ofs; + srv_push_dos_date2(req->smb_conn, data, 0, file->ea_list.create_time); + srv_push_dos_date2(req->smb_conn, data, 4, file->ea_list.access_time); + srv_push_dos_date2(req->smb_conn, data, 8, file->ea_list.write_time); + SIVAL(data, 12, file->ea_list.size); + SIVAL(data, 16, file->ea_list.alloc_size); + SSVAL(data, 20, file->ea_list.attrib); + ea_put_list(data+22, file->ea_list.eas.num_eas, file->ea_list.eas.eas); + trans2_append_data_string(req, trans, &file->ea_list.name, + ofs + 22 + ea_size, STR_LEN8BIT | STR_NOALIGN); + trans2_grow_data(req, trans, trans->out.data.length + 1); + trans->out.data.data[trans->out.data.length-1] = 0; + break; + case RAW_SEARCH_DIRECTORY_INFO: trans2_grow_data(req, trans, ofs + 64); data = trans->out.data.data + ofs; @@ -1233,6 +1257,15 @@ static NTSTATUS trans2_findfirst(struct smbsrv_request *req, struct smb_trans2 * return NT_STATUS_INVALID_LEVEL; } + if (search.t2ffirst.level == RAW_SEARCH_EA_LIST) { + status = ea_pull_name_list(&trans->in.data, req, + &search.t2ffirst.in.num_names, + &search.t2ffirst.in.ea_names); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + } + /* setup the private state structure that the backend will give us in the callback */ state.req = req; state.trans = trans; @@ -1294,6 +1327,15 @@ static NTSTATUS trans2_findnext(struct smbsrv_request *req, struct smb_trans2 *t return NT_STATUS_INVALID_LEVEL; } + if (search.t2fnext.level == RAW_SEARCH_EA_LIST) { + status = ea_pull_name_list(&trans->in.data, req, + &search.t2fnext.in.num_names, + &search.t2fnext.in.ea_names); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + } + /* setup the private state structure that the backend will give us in the callback */ state.req = req; state.trans = trans; |