libcli: introduce smbXcli_conn_support_passthrough()
authorUri Simchoni <uri@samba.org>
Sun, 26 Mar 2017 05:10:34 +0000 (08:10 +0300)
committerJeremy Allison <jra@samba.org>
Tue, 28 Mar 2017 15:45:19 +0000 (17:45 +0200)
This routine queries the client connenction whether
it supports query/set InfoLevels beyond 1000 (which,
in Windows OS, is a pass-through mechanism to the
file system).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smbXcli_base.c
libcli/smb/smbXcli_base.h

index 9521fc6ca9439355b7683b576a9d8cc480ef750b..1fcf11e6c93d6a6642ab85a4c424e656af1379bb 100644 (file)
@@ -468,6 +468,23 @@ bool smbXcli_conn_use_unicode(struct smbXcli_conn *conn)
        return false;
 }
 
+/*
+ * [MS-SMB] 2.2.2.3.5 - SMB1 support for passing through
+ * query/set commands to the file system
+ */
+bool smbXcli_conn_support_passthrough(struct smbXcli_conn *conn)
+{
+       if (conn->protocol >= PROTOCOL_SMB2_02) {
+               return true;
+       }
+
+       if (conn->smb1.capabilities & CAP_W2K_SMBS) {
+               return true;
+       }
+
+       return false;
+}
+
 void smbXcli_conn_set_sockopt(struct smbXcli_conn *conn, const char *options)
 {
        set_socket_options(conn->sock_fd, options);
index 84f4a6bbcc50b57bcb62100e1ddeba205cb3e49f..1abeb2b180bfe85b5dcb956e269d4e190884f7c2 100644 (file)
@@ -47,6 +47,7 @@ bool smbXcli_conn_dfs_supported(struct smbXcli_conn *conn);
 
 enum protocol_types smbXcli_conn_protocol(struct smbXcli_conn *conn);
 bool smbXcli_conn_use_unicode(struct smbXcli_conn *conn);
+bool smbXcli_conn_support_passthrough(struct smbXcli_conn *conn);
 
 void smbXcli_conn_set_sockopt(struct smbXcli_conn *conn, const char *options);
 const struct sockaddr_storage *smbXcli_conn_local_sockaddr(struct smbXcli_conn *conn);