summaryrefslogtreecommitdiff
path: root/source4/libcli/raw/rawsearch.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-04-14 01:09:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:16 -0500
commit763c4bc9acc0e9162bcb7c8e487522fa62aedae6 (patch)
treeffae228aeff71474e37b484c1cfd61b5213c5a01 /source4/libcli/raw/rawsearch.c
parent6f47ce8b6c2e78d02d08b975488242ba93e52a4b (diff)
downloadsamba-763c4bc9acc0e9162bcb7c8e487522fa62aedae6.tar.gz
samba-763c4bc9acc0e9162bcb7c8e487522fa62aedae6.tar.bz2
samba-763c4bc9acc0e9162bcb7c8e487522fa62aedae6.zip
r204: Turns out that the string in the SEARCH unix_info level is that
rare thing, a non-length string (ie. not a WIRE_STRING) but a null terminated char string. There wasn't a good interface to pull that out of a blob (all the string interfaces assumed WIRE_STRINGS). Added a new one, only used for this call. Sucks, I know - but the alternatives suck more. Added tests for some of the unix info returned. Jeremy. (This used to be commit 4d0ed04c54b105789ffd32334c3b0e544f02418c)
Diffstat (limited to 'source4/libcli/raw/rawsearch.c')
-rw-r--r--source4/libcli/raw/rawsearch.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source4/libcli/raw/rawsearch.c b/source4/libcli/raw/rawsearch.c
index ef854679dc..8b60633fe8 100644
--- a/source4/libcli/raw/rawsearch.c
+++ b/source4/libcli/raw/rawsearch.c
@@ -415,7 +415,7 @@ static int parse_trans2_search(struct cli_tree *tree,
return ofs;
case RAW_SEARCH_UNIX_INFO:
- if (blob->length < 105) return -1;
+ if (blob->length < 109) return -1;
ofs = IVAL(blob->data, 0);
data->unix_info.file_index = IVAL(blob->data, 4);
data->unix_info.size = BVAL(blob->data, 8);
@@ -432,10 +432,9 @@ static int parse_trans2_search(struct cli_tree *tree,
data->unix_info.permissions = IVAL(blob->data, 92);
data->unix_info.nlink = IVAL(blob->data, 100);
/* There is no length field for this name but we know it's null terminated. */
- len = cli_blob_pull_string(tree->session, mem_ctx, blob,
- &data->unix_info.name,
- 0, 104, 0);
- if (ofs != 0 && ofs < 104+len) {
+ len = cli_blob_pull_unix_string(tree->session, mem_ctx, blob,
+ &data->unix_info.name, 108, 0);
+ if (ofs != 0 && ofs < 108+len) {
return -1;
}
return ofs;