diff options
author | Luke Leighton <lkcl@samba.org> | 1998-10-15 23:51:07 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-10-15 23:51:07 +0000 |
commit | c404bb775414139a4b07a73f79cf069a083acb26 (patch) | |
tree | 259eeef5e467083c0b7b29bec846bab90c522bf7 /source3/libsmb | |
parent | 0d5ff90bffe1a5d2bf03412ef0bd12996cbc2f09 (diff) | |
download | samba-c404bb775414139a4b07a73f79cf069a083acb26.tar.gz samba-c404bb775414139a4b07a73f79cf069a083acb26.tar.bz2 samba-c404bb775414139a4b07a73f79cf069a083acb26.zip |
rpcclient interactive login (with trust account changing if you are root)
cli_session_setup handles null sessions correctly
(This used to be commit 60c0f22a4e84703467006dfe1971384a6294a9aa)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 64e67c5522..a6ffb57834 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -2494,15 +2494,25 @@ BOOL cli_establish_connection(struct cli_state *cli, if (cli->pwd.cleartext || cli->pwd.null_pwd) { - /* attempt clear-text session */ - fstring passwd; + int pass_len; - pwd_get_cleartext(&(cli->pwd), passwd); + if (cli->pwd.null_pwd) + { + /* attempt null session */ + passwd[0] = 0; + pass_len = 1; + } + else + { + /* attempt clear-text session */ + pwd_get_cleartext(&(cli->pwd), passwd); + pass_len = strlen(passwd); + } /* attempt clear-text session */ if (!cli_session_setup(cli, cli->user_name, - passwd, strlen(passwd), + passwd, pass_len, NULL, 0, cli->domain)) { |