summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-30 22:06:53 +0100
committerGünther Deschner <gd@samba.org>2014-02-13 11:54:16 +0100
commit3547872a76741c1aa455c0cd52e0513efb2d5003 (patch)
tree827cf4b82dfba829200edf5cc1972145b79048a7 /source3
parenta1e013505c0e8be8b1fb45dc59b2d4a1af450bce (diff)
downloadsamba-3547872a76741c1aa455c0cd52e0513efb2d5003.tar.gz
samba-3547872a76741c1aa455c0cd52e0513efb2d5003.tar.xz
samba-3547872a76741c1aa455c0cd52e0513efb2d5003.zip
s3:rpcclient: make use of dcerpc_binding_[g|s]et_*() in rpcclient.c
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/rpcclient.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index bcc0b07383b..0e6c6c3f4f6 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -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);