diff options
author | Jeremy Allison <jra@samba.org> | 2004-04-12 21:17:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:15 -0500 |
commit | 00cedc0c0448b3520678c7959ea9269d6e5c10f1 (patch) | |
tree | 85e378614475f810adb78b56b56393882b72db24 /source4 | |
parent | 198a92cb77ef2070957f18da0a8b6a48d01dbe9b (diff) | |
download | samba-00cedc0c0448b3520678c7959ea9269d6e5c10f1.tar.gz samba-00cedc0c0448b3520678c7959ea9269d6e5c10f1.tar.bz2 samba-00cedc0c0448b3520678c7959ea9269d6e5c10f1.zip |
r189: Added UNIX search into tests - added client library parse code.
Jeremy.
(This used to be commit a25ae9addbb362abf67a0cbd6e62bf4cbe06d8b7)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/include/smb_interfaces.h | 6 | ||||
-rw-r--r-- | source4/libcli/raw/rawsearch.c | 28 |
2 files changed, 31 insertions, 3 deletions
diff --git a/source4/include/smb_interfaces.h b/source4/include/smb_interfaces.h index 6f820be536..6f6213931c 100644 --- a/source4/include/smb_interfaces.h +++ b/source4/include/smb_interfaces.h @@ -1905,8 +1905,9 @@ union smb_search_data { /* RAW_SEARCH_UNIX_INFO interface */ struct { - large_t end_of_file; - large_t num_bytes; + uint32 file_index; + large_t size; + large_t alloc_size; NTTIME status_change_time; NTTIME access_time; NTTIME change_time; @@ -1918,6 +1919,7 @@ union smb_search_data { large_t unique_id; large_t permissions; large_t nlink; + WIRE_STRING name; } unix_info; }; diff --git a/source4/libcli/raw/rawsearch.c b/source4/libcli/raw/rawsearch.c index a4236d2dbe..ef854679dc 100644 --- a/source4/libcli/raw/rawsearch.c +++ b/source4/libcli/raw/rawsearch.c @@ -413,8 +413,34 @@ static int parse_trans2_search(struct cli_tree *tree, return -1; } return ofs; - } + case RAW_SEARCH_UNIX_INFO: + if (blob->length < 105) return -1; + ofs = IVAL(blob->data, 0); + data->unix_info.file_index = IVAL(blob->data, 4); + data->unix_info.size = BVAL(blob->data, 8); + data->unix_info.alloc_size = BVAL(blob->data, 16); + data->unix_info.status_change_time = cli_pull_nttime(blob->data, 24); + data->unix_info.access_time = cli_pull_nttime(blob->data, 32); + data->unix_info.change_time = cli_pull_nttime(blob->data, 40); + data->unix_info.uid = IVAL(blob->data, 48); + data->unix_info.gid = IVAL(blob->data, 56); + data->unix_info.file_type = IVAL(blob->data, 64); + data->unix_info.dev_major = BVAL(blob->data, 68); + data->unix_info.dev_minor = BVAL(blob->data, 76); + data->unix_info.unique_id = BVAL(blob->data, 84); + 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) { + return -1; + } + return ofs; + + } /* invalid level */ return -1; } |