summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-04-12 21:17:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:15 -0500
commit00cedc0c0448b3520678c7959ea9269d6e5c10f1 (patch)
tree85e378614475f810adb78b56b56393882b72db24 /source4/libcli
parent198a92cb77ef2070957f18da0a8b6a48d01dbe9b (diff)
downloadsamba-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/libcli')
-rw-r--r--source4/libcli/raw/rawsearch.c28
1 files changed, 27 insertions, 1 deletions
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;
}