s3:libsmb: cli_qpathinfo3 use cli_qpathinfo2 for smb2
authorGregor Beck <gbeck@sernet.de>
Mon, 14 Oct 2013 09:43:45 +0000 (11:43 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 30 Oct 2013 22:23:51 +0000 (15:23 -0700)
cli_qpathinfo3 only works (and is only needed as fallback so far) for smb1.
Use cli_qpathinfo2 in the smb2 case to make it universally usable.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/clirap.c

index cedd6a65cdd68d1a29f91a2d9334a5c4528c0759..7e6f8d74ba4620ba4e6bc4032611e995aeb309ab 100644 (file)
@@ -1414,7 +1414,7 @@ NTSTATUS cli_qpathinfo_standard(struct cli_state *cli, const char *fname,
 }
 
 
-/* like cli_qpathinfo2 but do not use SMB_QUERY_FILE_ALL_INFO */
+/* like cli_qpathinfo2 but do not use SMB_QUERY_FILE_ALL_INFO with smb1 */
 NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
                        struct timespec *create_time,
                        struct timespec *access_time,
@@ -1428,6 +1428,12 @@ NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
        uint32_t attr;
        uint64_t pos;
 
+       if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+               return cli_qpathinfo2(cli, fname,
+                                     create_time, access_time, write_time, change_time,
+                                     size, mode, ino);
+       }
+
        if (create_time || access_time || write_time || change_time || mode) {
                status = cli_qpathinfo_basic(cli, fname, &st, &attr);
                if (!NT_STATUS_IS_OK(status)) {