mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r189: Added UNIX search into tests - added client library parse code.
Jeremy.
(This used to be commit a25ae9addb
)
This commit is contained in:
parent
198a92cb77
commit
00cedc0c04
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user