From bba043c9e4059f96b78c702bd9b13e2efb053cdd Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Fri, 30 Aug 2002 11:57:06 +0000 Subject: allow rpcclient's samlogon command to use cli_net_3(). J.F. (This used to be commit 3cf419bdfbd3c56f31fb0794b206ab4bd2ac7120) --- source3/rpcclient/cmd_netlogon.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source3/rpcclient') diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 0f61eaaae8..98ba92e5a3 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -273,12 +273,14 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli, int logon_type = NET_LOGON_TYPE; char *username, *password; uint32 neg_flags = 0x000001ff; + int auth_level = 2; /* Check arguments */ - if (argc < 3 || argc > 4) { + if (argc < 3 || argc > 6) { fprintf(stderr, "Usage: samlogon " - "[logon_type]\n"); + "[logon_type] [neg flags] [auth level (2 or 3)]\n" + "neg flags being 0x000001ff or 0x6007ffff\n"); return NT_STATUS_OK; } @@ -288,6 +290,12 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli, if (argc == 4) sscanf(argv[3], "%i", &logon_type); + if (argc == 5) + sscanf(argv[4], "%i", &neg_flags); + + if (argc == 6) + sscanf(argv[5], "%i", &auth_level); + /* Authenticate ourselves with the domain controller */ if (!secrets_init()) { @@ -300,7 +308,7 @@ static NTSTATUS cmd_netlogon_sam_logon(struct cli_state *cli, goto done; } - result = cli_nt_setup_creds(cli, get_sec_chan(), trust_passwd, &neg_flags, 2); + 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"); -- cgit