summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/include/smb_interfaces.h6
-rw-r--r--source4/libcli/raw/rawsearch.c28
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;
}