libsmb: Use cli_qfileinfo_basic() in cli_smb2_getatr()
authorVolker Lendecke <vl@samba.org>
Thu, 4 Jun 2020 13:22:04 +0000 (15:22 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 4 Jun 2020 17:11:40 +0000 (17:11 +0000)
This was the only remaining user of cli_smb2_getattrE(), and as
cli_qfileinfo_basic() now does all protocols, we can get rid of
cli_smb2_getattrE().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/cli_smb2_fnum.c

index 0681858e73eddb4f5d1c6351ddf84464a8fa88c4..e974456dc8f51792ef870bbf13d8e137e437dde6 100644 (file)
@@ -2151,6 +2151,7 @@ NTSTATUS cli_smb2_getatr(struct cli_state *cli,
        NTSTATUS status;
        uint16_t fnum = 0xffff;
        struct smb2_hnd *ph = NULL;
+       struct timespec write_time_ts;
        TALLOC_CTX *frame = talloc_stackframe();
 
        if (smbXcli_conn_has_async_calls(cli->conn)) {
@@ -2181,16 +2182,22 @@ NTSTATUS cli_smb2_getatr(struct cli_state *cli,
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
-       status = cli_smb2_getattrE(cli,
-                               fnum,
-                               pattr,
-                               size,
-                               NULL,
-                               NULL,
-                               write_time);
+       status = cli_qfileinfo_basic(
+               cli,
+               fnum,
+               pattr,
+               size,
+               NULL,           /* create_time */
+               NULL,           /* access_time */
+               &write_time_ts,
+               NULL,           /* change_time */
+               NULL);          /* ino */
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
+       if (write_time != NULL) {
+               *write_time = write_time_ts.tv_sec;
+       }
 
   fail: