summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-22 18:17:01 +0200
committerVolker Lendecke <vl@samba.org>2008-04-25 11:12:52 +0200
commiteb5582d28ae486f97427cd9015e717466879e4ab (patch)
tree6c77c700ea11897b13aaf3921cd48681aebc92e0 /source3
parent324e92ea670d7bd6b1630b04fb5fb51324abda7b (diff)
downloadsamba-eb5582d28ae486f97427cd9015e717466879e4ab.tar.gz
samba-eb5582d28ae486f97427cd9015e717466879e4ab.tar.bz2
samba-eb5582d28ae486f97427cd9015e717466879e4ab.zip
cli_rpc_pipe_open_noauth must take the user/domain from the smb session
(This used to be commit 6f08128cf2722618e74b603e180e7e2a83d7d07a)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 1897cff18e..748a000b47 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2482,6 +2482,24 @@ struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe
return NULL;
}
+ /*
+ * This is a bit of an abstraction violation due to the fact that an
+ * anonymous bind on an authenticated SMB inherits the user/domain
+ * from the enclosing SMB creds
+ */
+
+ TALLOC_FREE(auth->user_name);
+ TALLOC_FREE(auth->domain);
+
+ auth->user_name = talloc_strdup(auth, cli->user_name);
+ auth->domain = talloc_strdup(auth, cli->domain);
+
+ if ((auth->user_name == NULL) || (auth->domain == NULL)) {
+ *perr = NT_STATUS_NO_MEMORY;
+ TALLOC_FREE(result);
+ return NULL;
+ }
+
*perr = rpc_pipe_bind(result, auth);
if (!NT_STATUS_IS_OK(*perr)) {
int lvl = 0;