Mercurial > dropbear
diff cli-auth.c @ 35:0ad5fb979f42
set the isserver flag (oops)
fix password auth for the server
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 29 Jul 2004 02:19:03 +0000 |
parents | e2a1eaa19f22 |
children | 0913e2ee3545 |
line wrap: on
line diff
--- a/cli-auth.c Wed Jul 28 16:44:16 2004 +0000 +++ b/cli-auth.c Thu Jul 29 02:19:03 2004 +0000 @@ -13,27 +13,6 @@ } -void cli_get_user() { - - uid_t uid; - struct passwd *pw; - - TRACE(("enter cli_get_user")); - if (cli_opts.username != NULL) { - ses.authstate.username = cli_opts.username; - } else { - uid = getuid(); - - pw = getpwuid(uid); - if (pw == NULL || pw->pw_name == NULL) { - dropbear_exit("Couldn't find username for current user"); - } - - ses.authstate.username = m_strdup(pw->pw_name); - } - TRACE(("leave cli_get_user: %s", ses.authstate.username)); -} - /* Send a "none" auth request to get available methods */ void cli_auth_getmethods() { @@ -42,8 +21,8 @@ CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); - buf_putstring(ses.writepayload, ses.authstate.username, - strlen(ses.authstate.username)); + buf_putstring(ses.writepayload, cli_opts.username, + strlen(cli_opts.username)); buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, SSH_SERVICE_CONNECTION_LEN); buf_putstring(ses.writepayload, "none", 4); /* 'none' method */