return status;
}
-
-/***************************************************************
- Wrapper that allows SMB2 to query a fnum info (basic level).
- Synchronous only.
-***************************************************************/
-
-NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
- uint16_t fnum,
- uint32_t *pattr,
- off_t *size,
- struct timespec *create_time,
- struct timespec *access_time,
- struct timespec *write_time,
- struct timespec *change_time,
- SMB_INO_T *ino)
-{
- NTSTATUS status;
- DATA_BLOB outbuf = data_blob_null;
- TALLOC_CTX *frame = talloc_stackframe();
-
- if (smbXcli_conn_has_async_calls(cli->conn)) {
- /*
- * Can't use sync call while an async call is in flight
- */
- status = NT_STATUS_INVALID_PARAMETER;
- goto fail;
- }
-
- if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
- status = NT_STATUS_INVALID_PARAMETER;
- goto fail;
- }
-
- /* getinfo on the handle with info_type SMB2_GETINFO_FILE (1),
- level 0x12 (SMB2_FILE_ALL_INFORMATION). */
-
- status = cli_smb2_query_info_fnum(
- cli,
- fnum,
- 1, /* in_info_type */
- (SMB_FILE_ALL_INFORMATION - 1000), /* in_file_info_class */
- 0xFFFF, /* in_max_output_length */
- NULL, /* in_input_buffer */
- 0, /* in_additional_info */
- 0, /* in_flags */
- frame,
- &outbuf);
- if (!NT_STATUS_IS_OK(status)) {
- goto fail;
- }
-
- /* Parse the reply. */
- if (outbuf.length < 0x60) {
- status = NT_STATUS_INVALID_NETWORK_RESPONSE;
- goto fail;
- }
-
- if (create_time) {
- *create_time = interpret_long_date((const char *)outbuf.data + 0x0);
- }
- if (access_time) {
- *access_time = interpret_long_date((const char *)outbuf.data + 0x8);
- }
- if (write_time) {
- *write_time = interpret_long_date((const char *)outbuf.data + 0x10);
- }
- if (change_time) {
- *change_time = interpret_long_date((const char *)outbuf.data + 0x18);
- }
- if (pattr) {
- *pattr = IVAL(outbuf.data, 0x20);
- }
- if (size) {
- uint64_t file_size = BVAL(outbuf.data, 0x30);
- *size = (off_t)file_size;
- }
- if (ino) {
- uint64_t file_index = BVAL(outbuf.data, 0x40);
- *ino = (SMB_INO_T)file_index;
- }
-
- fail:
-
- cli->raw_status = status;
-
- TALLOC_FREE(frame);
- return status;
-}
-
/***************************************************************
Wrapper that allows SMB2 to get pathname attributes.
Synchronous only.
uint32_t in_flags,
TALLOC_CTX *mem_ctx,
DATA_BLOB *outbuf);
-NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
- uint16_t fnum,
- uint32_t *pattr,
- off_t *size,
- struct timespec *create_time,
- struct timespec *access_time,
- struct timespec *write_time,
- struct timespec *change_time,
- SMB_INO_T *ino);
NTSTATUS cli_smb2_getatr(struct cli_state *cli,
const char *name,
uint32_t *pattr,