summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2002-08-30 11:57:06 +0000
committerJean-François Micouleau <jfm@samba.org>2002-08-30 11:57:06 +0000
commitbba043c9e4059f96b78c702bd9b13e2efb053cdd (patch)
treeb9417e1bbcba8f20ee129e54402beaec75a68401
parent189c4b8fd36078cac83d7c2d56d5efc3f44a421b (diff)
downloadsamba-bba043c9e4059f96b78c702bd9b13e2efb053cdd.tar.gz
samba-bba043c9e4059f96b78c702bd9b13e2efb053cdd.tar.bz2
samba-bba043c9e4059f96b78c702bd9b13e2efb053cdd.zip
allow rpcclient's samlogon command to use cli_net_3().
J.F. (This used to be commit 3cf419bdfbd3c56f31fb0794b206ab4bd2ac7120)
-rw-r--r--source3/rpcclient/cmd_netlogon.c14
1 files changed, 11 insertions, 3 deletions
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 <username> <password> "
- "[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");