summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-03-16 22:54:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:34 -0500
commit99a3f68eb59e7d00c87081ff2f22449ebe4081ed (patch)
tree7fce91d63fce3393db498fb994aac47f7f94d79b /source3/rpcclient
parent88ae0a25bacf381098d19d191bbb31ddd5c2e7c3 (diff)
downloadsamba-99a3f68eb59e7d00c87081ff2f22449ebe4081ed.tar.gz
samba-99a3f68eb59e7d00c87081ff2f22449ebe4081ed.tar.bz2
samba-99a3f68eb59e7d00c87081ff2f22449ebe4081ed.zip
r14495: Allow to play with the logon_param flag when testing samlogons.
Guenther (This used to be commit 52d721b6384cf6f94e1ebb59d21bf09737a539b5)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_netlogon.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 9377f8fde8..35b8accdb6 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -294,45 +294,44 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
/* Log on a domain user */
static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+ TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
{
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- int logon_type = NET_LOGON_TYPE;
- const char *username, *password;
- uint32 neg_flags = 0x000001ff;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ int logon_type = NET_LOGON_TYPE;
+ const char *username, *password;
int auth_level = 2;
+ uint32 logon_param = 0;
- /* Check arguments */
+ /* Check arguments */
- if (argc < 3 || argc > 6) {
- fprintf(stderr, "Usage: samlogon <username> <password> "
- "[logon_type] [neg flags] [auth level (2 or 3)]\n"
- "neg flags being 0x000001ff or 0x6007ffff\n");
- return NT_STATUS_OK;
- }
+ if (argc < 3 || argc > 6) {
+ fprintf(stderr, "Usage: samlogon <username> <password> "
+ "[logon_type (1 or 2)] [auth level (2 or 3)] [logon_parameter]\n");
+ return NT_STATUS_OK;
+ }
- username = argv[1];
- password = argv[2];
+ username = argv[1];
+ password = argv[2];
- if (argc >= 4)
- sscanf(argv[3], "%i", &logon_type);
+ if (argc >= 4)
+ sscanf(argv[3], "%i", &logon_type);
if (argc >= 5)
- sscanf(argv[4], "%i", &neg_flags);
+ sscanf(argv[4], "%i", &auth_level);
if (argc == 6)
- sscanf(argv[5], "%i", &auth_level);
+ sscanf(argv[5], "%x", &logon_param);
- /* Perform the sam logon */
+ /* Perform the sam logon */
- result = rpccli_netlogon_sam_logon(cli, mem_ctx, 0, lp_workgroup(), username, password, logon_type);
+ result = rpccli_netlogon_sam_logon(cli, mem_ctx, logon_param, lp_workgroup(), username, password, logon_type);
if (!NT_STATUS_IS_OK(result))
goto done;
done:
- return result;
+ return result;
}
/* Change the trust account password */