From: Volker Lendecke Date: Thu, 4 Jun 2020 13:29:48 +0000 (+0200) Subject: libsmb: Remove unused cli_smb2_qfileinfo_basic() X-Git-Tag: ldb-2.2.0~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f1db2d19e751e726f029b9df3bdee558a0b5c24;p=thirdparty%2Fsamba.git libsmb: Remove unused cli_smb2_qfileinfo_basic() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Jun 4 18:36:17 UTC 2020 on sn-devel-184 --- diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c index 8874a8f567f..e5d6e6b7fbd 100644 --- a/source3/libsmb/cli_smb2_fnum.c +++ b/source3/libsmb/cli_smb2_fnum.c @@ -2003,95 +2003,6 @@ NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli, 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. diff --git a/source3/libsmb/cli_smb2_fnum.h b/source3/libsmb/cli_smb2_fnum.h index 6613ddc0078..06f939d6dbf 100644 --- a/source3/libsmb/cli_smb2_fnum.h +++ b/source3/libsmb/cli_smb2_fnum.h @@ -155,15 +155,6 @@ NTSTATUS cli_smb2_query_info_fnum( 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,