summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-01-23 10:51:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:22 -0500
commitaeb834036d5cc576df6b284cebf6f4afcce4dfcc (patch)
tree5d6134b0ef380eaee1c33b42a2132248cc7c107e /source3/rpcclient
parent23e227ac391a3f674712bdd09a0581a02cbc8a7e (diff)
downloadsamba-aeb834036d5cc576df6b284cebf6f4afcce4dfcc.tar.gz
samba-aeb834036d5cc576df6b284cebf6f4afcce4dfcc.tar.bz2
samba-aeb834036d5cc576df6b284cebf6f4afcce4dfcc.zip
r20970: Allow to define workstation for samlogon in rpcclient (for testing).
Guenther (This used to be commit 5d4747fdf2e5874cb5d2238ee62e4fcac1676134)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_netlogon.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index a1093d693f..5a2dd00f98 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -338,11 +338,12 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
const char *username, *password;
int auth_level = 2;
uint32 logon_param = 0;
+ const char *workstation = NULL;
/* Check arguments */
if (argc < 3 || argc > 6) {
- fprintf(stderr, "Usage: samlogon <username> <password> "
+ fprintf(stderr, "Usage: samlogon <username> <password> [workstation]"
"[logon_type (1 or 2)] [auth level (2 or 3)] [logon_parameter]\n");
return NT_STATUS_OK;
}
@@ -350,18 +351,21 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
username = argv[1];
password = argv[2];
- if (argc >= 4)
- sscanf(argv[3], "%i", &logon_type);
+ if (argc >= 4)
+ workstation = argv[3];
if (argc >= 5)
- sscanf(argv[4], "%i", &auth_level);
+ sscanf(argv[4], "%i", &logon_type);
- if (argc == 6)
- sscanf(argv[5], "%x", &logon_param);
+ if (argc >= 6)
+ sscanf(argv[5], "%i", &auth_level);
+
+ if (argc == 7)
+ sscanf(argv[6], "%x", &logon_param);
/* Perform the sam logon */
- result = rpccli_netlogon_sam_logon(cli, mem_ctx, logon_param, lp_workgroup(), username, password, logon_type);
+ result = rpccli_netlogon_sam_logon(cli, mem_ctx, logon_param, lp_workgroup(), username, password, workstation, logon_type);
if (!NT_STATUS_IS_OK(result))
goto done;