mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
s3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.
Fix all callers. All libsmb SMB2 calls now return 32 bit attributes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
parent
808d873c0f
commit
d29884e778
@ -1285,7 +1285,7 @@ static bool windows_parent_dirname(TALLOC_CTX *mem_ctx,
|
||||
|
||||
NTSTATUS cli_smb2_list(struct cli_state *cli,
|
||||
const char *pathname,
|
||||
uint16_t attribute,
|
||||
uint32_t attribute,
|
||||
NTSTATUS (*fn)(const char *,
|
||||
struct file_info *,
|
||||
const char *,
|
||||
@ -1418,8 +1418,7 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (dir_check_ftype(
|
||||
finfo->attr, (uint32_t)attribute)) {
|
||||
if (dir_check_ftype(finfo->attr, attribute)) {
|
||||
/*
|
||||
* Only process if attributes match.
|
||||
* On SMB1 server does this, so on
|
||||
@ -2218,13 +2217,12 @@ NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
|
||||
struct timespec *write_time,
|
||||
struct timespec *change_time,
|
||||
off_t *size,
|
||||
uint16_t *pattr,
|
||||
uint32_t *pattr,
|
||||
SMB_INO_T *ino)
|
||||
{
|
||||
NTSTATUS status;
|
||||
struct smb2_hnd *ph = NULL;
|
||||
uint16_t fnum = 0xffff;
|
||||
uint32_t attr = 0;
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
|
||||
if (smbXcli_conn_has_async_calls(cli->conn)) {
|
||||
@ -2258,7 +2256,7 @@ NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
|
||||
|
||||
status = cli_smb2_qfileinfo_basic(cli,
|
||||
fnum,
|
||||
&attr,
|
||||
pattr,
|
||||
size,
|
||||
create_time,
|
||||
access_time,
|
||||
@ -2268,12 +2266,6 @@ NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
|
||||
|
||||
fail:
|
||||
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
if (pattr != NULL) {
|
||||
*pattr = attr;
|
||||
}
|
||||
}
|
||||
|
||||
if (fnum != 0xffff) {
|
||||
cli_smb2_close_fnum(cli, fnum);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ struct tevent_req *cli_smb2_unlink_send(
|
||||
NTSTATUS cli_smb2_unlink_recv(struct tevent_req *req);
|
||||
NTSTATUS cli_smb2_list(struct cli_state *cli,
|
||||
const char *pathname,
|
||||
uint16_t attribute,
|
||||
uint32_t attribute,
|
||||
NTSTATUS (*fn)(const char *,
|
||||
struct file_info *,
|
||||
const char *,
|
||||
@ -183,7 +183,7 @@ NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
|
||||
struct timespec *write_time,
|
||||
struct timespec *change_time,
|
||||
off_t *size,
|
||||
uint16_t *pattr,
|
||||
uint32_t *pattr,
|
||||
SMB_INO_T *ino);
|
||||
NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
|
||||
const char *name,
|
||||
|
@ -1015,15 +1015,23 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
|
||||
NTSTATUS status = NT_STATUS_NO_MEMORY;
|
||||
|
||||
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
|
||||
return cli_smb2_qpathinfo2(cli,
|
||||
uint32_t attr = 0;
|
||||
status = cli_smb2_qpathinfo2(cli,
|
||||
fname,
|
||||
create_time,
|
||||
access_time,
|
||||
write_time,
|
||||
change_time,
|
||||
size,
|
||||
pattr,
|
||||
&attr,
|
||||
ino);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
if (pattr != NULL) {
|
||||
*pattr = attr;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
frame = talloc_stackframe();
|
||||
|
Loading…
x
Reference in New Issue
Block a user