diff options
author | Matt Johnston <matt@ucc.asn.au> | 2004-08-08 16:57:37 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2004-08-08 16:57:37 +0000 |
commit | 3238bed9c9467a4c77bb6b430cd8f9fc394315c2 (patch) | |
tree | edbc491ec7befd2506105fd63caddc9d1c553764 /svr-auth.c | |
parent | 8edc3523938ee2149ae11e7e19ef1e419fb57e0d (diff) |
svr-authpam code merged and works. needs tidying a log
--HG--
branch : authpam
extra : convert_revision : abeb2807b88fbd8b95d92b760a209a0816cbaea9
Diffstat (limited to 'svr-auth.c')
-rw-r--r-- | svr-auth.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -57,7 +57,7 @@ static void authclear() { #ifdef DROPBEAR_PUBKEY_AUTH ses.authstate.authtypes |= AUTH_TYPE_PUBKEY; #endif -#ifdef DROPBEAR_PASSWORD_AUTH +#if defined(DROPBEAR_PASSWORD_AUTH) || defined(DROPBEAR_PAM_AUTH) if (!svr_opts.noauthpass) { ses.authstate.authtypes |= AUTH_TYPE_PASSWORD; } @@ -156,6 +156,19 @@ void recv_msg_userauth_request() { } #endif +#ifdef DROPBEAR_PAM_AUTH + if (!svr_opts.noauthpass && + !(svr_opts.norootpass && ses.authstate.pw->pw_uid == 0) ) { + /* user wants to try password auth */ + if (methodlen == AUTH_METHOD_PASSWORD_LEN && + strncmp(methodname, AUTH_METHOD_PASSWORD, + AUTH_METHOD_PASSWORD_LEN) == 0) { + svr_auth_pam(); + goto out; + } + } +#endif + #ifdef DROPBEAR_PUBKEY_AUTH /* user wants to try pubkey auth */ if (methodlen == AUTH_METHOD_PUBKEY_LEN && |