diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-04-09 15:54:17 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-04-09 15:54:17 +0000 |
commit | 7238bf5f40e16360439e028fa7607a5a28e02965 (patch) | |
tree | 1816898133cbf06270a5a01afa61ae0dcacf7821 /source3/rpcclient | |
parent | f0121aa901a99374df7ac8f43dbd50efdc3e79dd (diff) | |
download | samba-7238bf5f40e16360439e028fa7607a5a28e02965.tar.gz samba-7238bf5f40e16360439e028fa7607a5a28e02965.tar.bz2 samba-7238bf5f40e16360439e028fa7607a5a28e02965.zip |
This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"
and it should work with the schannel. Needs testing against platforms
different from NT4SP6.
Volker
(This used to be commit eaef0d8aeff1aa5a067679be3f17e08d7434e1e8)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 19 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 23 |
2 files changed, 20 insertions, 22 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 1421c4da26..e6ec28beab 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -296,25 +296,6 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli, if (argc == 6) sscanf(argv[5], "%i", &auth_level); - /* Authenticate ourselves with the domain controller */ - - if (!secrets_init()) { - fprintf(stderr, "Unable to initialise secrets database\n"); - return result; - } - - if (!secrets_fetch_trust_account_password(lp_workgroup(), trust_passwd, NULL)) { - fprintf(stderr, "could not fetch trust account password\n"); - goto done; - } - - result = cli_nt_setup_creds(cli, get_sec_chan(), trust_passwd, &neg_flags, auth_level); - - if (!NT_STATUS_IS_OK(result)) { - fprintf(stderr, "Error initialising session creds\n"); - goto done; - } - /* Perform the sam logon */ result = cli_netlogon_sam_logon(cli, mem_ctx, username, password, logon_type); diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 2338d72f19..0cb4ba98c8 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -475,11 +475,28 @@ static NTSTATUS do_cmd(struct cli_state *cli, /* Open pipe */ - if (cmd_entry->pipe_idx != -1) - if (!cli_nt_session_open(cli, cmd_entry->pipe_idx)) { - DEBUG(0, ("Could not initialize pipe\n")); + if (cmd_entry->pipe_idx == PI_NETLOGON) { + uchar trust_password[16]; + + if (!secrets_fetch_trust_account_password(lp_workgroup(), + trust_password, + NULL)) { + return NT_STATUS_UNSUCCESSFUL; + } + + if (!cli_nt_open_netlogon(cli, trust_password, + SEC_CHAN_WKSTA)) { + DEBUG(0, ("Could not initialize NETLOGON pipe\n")); return NT_STATUS_UNSUCCESSFUL; } + } else { + if (cmd_entry->pipe_idx != -1) { + if (!cli_nt_session_open(cli, cmd_entry->pipe_idx)) { + DEBUG(0, ("Could not initialize pipe\n")); + return NT_STATUS_UNSUCCESSFUL; + } + } + } /* Run command */ |