summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-06 08:00:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:49 -0500
commitaf0a9eb52955cfae570bfdc01821f56385c860cf (patch)
tree9a798fd727753c3d9ceb44512579dc5b3e7fbebf /source4/smb_server/smb
parent51e0ae33acf3cd09ae0eb9ef5077cecab4780a3e (diff)
downloadsamba-af0a9eb52955cfae570bfdc01821f56385c860cf.tar.gz
samba-af0a9eb52955cfae570bfdc01821f56385c860cf.tar.bz2
samba-af0a9eb52955cfae570bfdc01821f56385c860cf.zip
r16834: split the level's of smb_search_first/smb_search_next and the levels
of smb_search_data metze (This used to be commit 78c201db8a47a71908698c4dda2add4cf85694d9)
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r--source4/smb_server/smb/search.c2
-rw-r--r--source4/smb_server/smb/trans2.c52
2 files changed, 29 insertions, 25 deletions
diff --git a/source4/smb_server/smb/search.c b/source4/smb_server/smb/search.c
index b86c0ddb7e..cc6d866ac7 100644
--- a/source4/smb_server/smb/search.c
+++ b/source4/smb_server/smb/search.c
@@ -185,6 +185,7 @@ void smbsrv_reply_search(struct smbsrv_request *req)
sn->search_next.in.id.client_cookie = IVAL(p, 17);
sn->search_next.level = level;
+ sn->search_next.data_level = RAW_SEARCH_DATA_SEARCH;
sn->search_next.in.max_count = SVAL(req->in.vwv, VWV(0));
sn->search_next.in.search_attrib = SVAL(req->in.vwv, VWV(1));
@@ -195,6 +196,7 @@ void smbsrv_reply_search(struct smbsrv_request *req)
/* do a search first operation */
sf->search_first.level = level;
+ sf->search_first.data_level = RAW_SEARCH_DATA_SEARCH;
sf->search_first.in.search_attrib = SVAL(req->in.vwv, VWV(1));
sf->search_first.in.max_count = SVAL(req->in.vwv, VWV(0));
diff --git a/source4/smb_server/smb/trans2.c b/source4/smb_server/smb/trans2.c
index a8fe9f165d..8a4abd8e60 100644
--- a/source4/smb_server/smb/trans2.c
+++ b/source4/smb_server/smb/trans2.c
@@ -682,7 +682,7 @@ static NTSTATUS trans2_setpathinfo(struct smbsrv_request *req, struct trans_op *
struct find_state {
struct trans_op *op;
void *search;
- enum smb_search_level level;
+ enum smb_search_data_level data_level;
uint16_t last_entry_offset;
uint16_t flags;
};
@@ -699,16 +699,13 @@ static NTSTATUS find_fill_info(struct find_state *state,
uint_t ofs = trans->out.data.length;
uint32_t ea_size;
- switch (state->level) {
- case RAW_SEARCH_SEARCH:
- case RAW_SEARCH_FFIRST:
- case RAW_SEARCH_FUNIQUE:
- case RAW_SEARCH_GENERIC:
- case RAW_SEARCH_SMB2:
+ switch (state->data_level) {
+ case RAW_SEARCH_DATA_GENERIC:
+ case RAW_SEARCH_DATA_SEARCH:
/* handled elsewhere */
return NT_STATUS_INVALID_LEVEL;
- case RAW_SEARCH_STANDARD:
+ case RAW_SEARCH_DATA_STANDARD:
if (state->flags & FLAG_TRANS2_FIND_REQUIRE_RESUME) {
TRANS2_CHECK(smbsrv_blob_grow_data(trans, &trans->out.data, ofs + 27));
SIVAL(trans->out.data.data, ofs, file->standard.resume_key);
@@ -728,7 +725,7 @@ static NTSTATUS find_fill_info(struct find_state *state,
STR_LEN8BIT | STR_TERMINATE | STR_LEN_NOTERM));
break;
- case RAW_SEARCH_EA_SIZE:
+ case RAW_SEARCH_DATA_EA_SIZE:
if (state->flags & FLAG_TRANS2_FIND_REQUIRE_RESUME) {
TRANS2_CHECK(smbsrv_blob_grow_data(trans, &trans->out.data, ofs + 31));
SIVAL(trans->out.data.data, ofs, file->ea_size.resume_key);
@@ -750,7 +747,7 @@ static NTSTATUS find_fill_info(struct find_state *state,
TRANS2_CHECK(smbsrv_blob_fill_data(trans, &trans->out.data, trans->out.data.length + 1));
break;
- case RAW_SEARCH_EA_LIST:
+ case RAW_SEARCH_DATA_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_CHECK(smbsrv_blob_grow_data(trans, &trans->out.data, ofs + 27 + ea_size));
@@ -773,14 +770,17 @@ static NTSTATUS find_fill_info(struct find_state *state,
TRANS2_CHECK(smbsrv_blob_fill_data(trans, &trans->out.data, trans->out.data.length + 1));
break;
- case RAW_SEARCH_DIRECTORY_INFO:
- case RAW_SEARCH_FULL_DIRECTORY_INFO:
- case RAW_SEARCH_NAME_INFO:
- case RAW_SEARCH_BOTH_DIRECTORY_INFO:
- case RAW_SEARCH_ID_FULL_DIRECTORY_INFO:
- case RAW_SEARCH_ID_BOTH_DIRECTORY_INFO:
- return smbsrv_push_passthru_search(trans, &trans->out.data, state->level, file,
+ case RAW_SEARCH_DATA_DIRECTORY_INFO:
+ case RAW_SEARCH_DATA_FULL_DIRECTORY_INFO:
+ case RAW_SEARCH_DATA_NAME_INFO:
+ case RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO:
+ case RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO:
+ case RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO:
+ return smbsrv_push_passthru_search(trans, &trans->out.data, state->data_level, file,
SMBSRV_REQ_DEFAULT_STR_FLAGS(req));
+
+ case RAW_SEARCH_DATA_UNIX_INFO:
+ return NT_STATUS_INVALID_LEVEL;
}
return NT_STATUS_OK;
@@ -861,12 +861,13 @@ static NTSTATUS trans2_findfirst(struct smbsrv_request *req, struct trans_op *op
return NT_STATUS_FOOBAR;
}
- search->t2ffirst.level = (enum smb_search_level)level;
- if (search->t2ffirst.level >= RAW_SEARCH_GENERIC) {
+ search->t2ffirst.level = RAW_SEARCH_TRANS2;
+ search->t2ffirst.data_level = (enum smb_search_data_level)level;
+ if (search->t2ffirst.data_level >= RAW_SEARCH_DATA_GENERIC) {
return NT_STATUS_INVALID_LEVEL;
}
- if (search->t2ffirst.level == RAW_SEARCH_EA_LIST) {
+ if (search->t2ffirst.data_level == RAW_SEARCH_DATA_EA_LIST) {
TRANS2_CHECK(ea_pull_name_list(&trans->in.data, req,
&search->t2ffirst.in.num_names,
&search->t2ffirst.in.ea_names));
@@ -878,7 +879,7 @@ static NTSTATUS trans2_findfirst(struct smbsrv_request *req, struct trans_op *op
NT_STATUS_HAVE_NO_MEMORY(state);
state->op = op;
state->search = search;
- state->level = search->t2ffirst.level;
+ state->data_level = search->t2ffirst.data_level;
state->last_entry_offset= 0;
state->flags = search->t2ffirst.in.flags;
@@ -946,12 +947,13 @@ static NTSTATUS trans2_findnext(struct smbsrv_request *req, struct trans_op *op)
return NT_STATUS_FOOBAR;
}
- search->t2fnext.level = (enum smb_search_level)level;
- if (search->t2fnext.level >= RAW_SEARCH_GENERIC) {
+ search->t2fnext.level = RAW_SEARCH_TRANS2;
+ search->t2fnext.data_level = (enum smb_search_data_level)level;
+ if (search->t2fnext.data_level >= RAW_SEARCH_DATA_GENERIC) {
return NT_STATUS_INVALID_LEVEL;
}
- if (search->t2fnext.level == RAW_SEARCH_EA_LIST) {
+ if (search->t2fnext.data_level == RAW_SEARCH_DATA_EA_LIST) {
TRANS2_CHECK(ea_pull_name_list(&trans->in.data, req,
&search->t2fnext.in.num_names,
&search->t2fnext.in.ea_names));
@@ -962,7 +964,7 @@ static NTSTATUS trans2_findnext(struct smbsrv_request *req, struct trans_op *op)
NT_STATUS_HAVE_NO_MEMORY(state);
state->op = op;
state->search = search;
- state->level = search->t2fnext.level;
+ state->data_level = search->t2fnext.data_level;
state->last_entry_offset= 0;
state->flags = search->t2fnext.in.flags;