comparison svr-auth.c @ 22:c1e5d9195402

merge of abac2150ee4f4031a98016241fbd136d24fed127 and ffa047425729e478a5b49b1ab0f8ec71c08a1421
author Matt Johnston <matt@ucc.asn.au>
date Wed, 23 Jun 2004 07:14:16 +0000
parents d7cc5b484a2e
children 469950e86d0f
comparison
equal deleted inserted replaced
14:5ae28f6101c1 22:c1e5d9195402
50 /* Reset the auth state, but don't reset the failcount. This is for if the 50 /* Reset the auth state, but don't reset the failcount. This is for if the
51 * user decides to try with a different username etc, and is also invoked 51 * user decides to try with a different username etc, and is also invoked
52 * on initialisation */ 52 * on initialisation */
53 static void authclear() { 53 static void authclear() {
54 54
55 svr_ses.authstate.authdone = 0; 55 ses.authdone = 0;
56 svr_ses.authstate.pw = NULL; 56 svr_ses.authstate.pw = NULL;
57 svr_ses.authstate.username = NULL; 57 svr_ses.authstate.username = NULL;
58 svr_ses.authstate.printableuser = NULL; 58 svr_ses.authstate.printableuser = NULL;
59 svr_ses.authstate.authtypes = 0; 59 svr_ses.authstate.authtypes = 0;
60 #ifdef DROPBEAR_PUBKEY_AUTH 60 #ifdef DROPBEAR_PUBKEY_AUTH
100 unsigned int userlen, servicelen, methodlen; 100 unsigned int userlen, servicelen, methodlen;
101 101
102 TRACE(("enter recv_msg_userauth_request")); 102 TRACE(("enter recv_msg_userauth_request"));
103 103
104 /* ignore packets if auth is already done */ 104 /* ignore packets if auth is already done */
105 if (svr_ses.authstate.authdone == 1) { 105 if (ses.authdone == 1) {
106 return; 106 return;
107 } 107 }
108 108
109 /* send the banner if it exists, it will only exist once */ 109 /* send the banner if it exists, it will only exist once */
110 if (ses.opts->banner) { 110 if (ses.opts->banner) {
337 CHECKCLEARTOWRITE(); 337 CHECKCLEARTOWRITE();
338 338
339 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_SUCCESS); 339 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_SUCCESS);
340 encrypt_packet(); 340 encrypt_packet();
341 341
342 svr_ses.authstate.authdone = 1; 342 ses.authdone = 1;
343
344 if (svr_ses.authstate.pw->pw_uid == 0) {
345 ses.allowprivport = 1;
346 }
343 347
344 /* Remove from the list of pre-auth sockets. Should be m_close(), since if 348 /* Remove from the list of pre-auth sockets. Should be m_close(), since if
345 * we fail, we might end up leaking connection slots, and disallow new 349 * we fail, we might end up leaking connection slots, and disallow new
346 * logins - a nasty situation. */ 350 * logins - a nasty situation. */
347 m_close(svr_ses.childpipe); 351 m_close(svr_ses.childpipe);