]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpcclient: make use of dcerpc_binding_[g|s]et_*() in rpcclient.c
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jan 2014 21:06:53 +0000 (22:06 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:16 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/rpcclient/rpcclient.c

index bcc0b07383bddee299d3e602d3c484f5ef761037..0e6c6c3f4f60de98468d7f2495f666dbc0d6d133 100644 (file)
@@ -939,6 +939,8 @@ out_free:
        TALLOC_CTX *frame = talloc_stackframe();
        uint32_t flags = 0;
        struct dcerpc_binding *binding = NULL;
+       enum dcerpc_transport_t transport;
+       uint32_t bflags = 0;
        const char *binding_string = NULL;
        char *user, *domain, *q;
 
@@ -1063,34 +1065,41 @@ out_free:
                }
        }
 
-       if (binding->transport == NCA_UNKNOWN) {
-               binding->transport = NCACN_NP;
+       transport = dcerpc_binding_get_transport(binding);
+
+       if (transport == NCA_UNKNOWN) {
+               nt_status = dcerpc_binding_set_transport(binding, NCACN_NP);
+               if (!NT_STATUS_IS_OK(nt_status)) {
+                       result = -1;
+                       goto done;
+               }
        }
 
-       if (binding->flags & DCERPC_CONNECT) {
+       bflags = dcerpc_binding_get_flags(binding);
+       if (bflags & DCERPC_CONNECT) {
                pipe_default_auth_level = DCERPC_AUTH_LEVEL_CONNECT;
                pipe_default_auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
        }
-       if (binding->flags & DCERPC_SIGN) {
+       if (bflags & DCERPC_SIGN) {
                pipe_default_auth_level = DCERPC_AUTH_LEVEL_INTEGRITY;
                pipe_default_auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
        }
-       if (binding->flags & DCERPC_SEAL) {
+       if (bflags & DCERPC_SEAL) {
                pipe_default_auth_level = DCERPC_AUTH_LEVEL_PRIVACY;
                pipe_default_auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
        }
-       if (binding->flags & DCERPC_AUTH_SPNEGO) {
+       if (bflags & DCERPC_AUTH_SPNEGO) {
                pipe_default_auth_type = DCERPC_AUTH_TYPE_SPNEGO;
                pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_NTLMSSP;
        }
-       if (binding->flags & DCERPC_AUTH_NTLM) {
+       if (bflags & DCERPC_AUTH_NTLM) {
                if (pipe_default_auth_type == DCERPC_AUTH_TYPE_SPNEGO) {
                        pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_NTLMSSP;
                } else {
                        pipe_default_auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
                }
        }
-       if (binding->flags & DCERPC_AUTH_KRB5) {
+       if (bflags & DCERPC_AUTH_KRB5) {
                if (pipe_default_auth_type == DCERPC_AUTH_TYPE_SPNEGO) {
                        pipe_default_auth_spnego_type = PIPE_AUTH_TYPE_SPNEGO_KRB5;
                } else {
@@ -1169,7 +1178,7 @@ out_free:
                cmd_set++;
        }
 
-       default_transport = binding->transport;
+       default_transport = dcerpc_binding_get_transport(binding);
 
        fetch_machine_sid(cli);