Mercurial > dropbear
comparison svr-auth.c @ 57:3b2a5a1c4347 authpam
svr-authpam code merged and works. needs tidying a log
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 08 Aug 2004 16:57:37 +0000 |
parents | 0ad5fb979f42 |
children | 5312ca05ed48 |
comparison
equal
deleted
inserted
replaced
56:6f091656c100 | 57:3b2a5a1c4347 |
---|---|
55 | 55 |
56 memset(&ses.authstate, 0, sizeof(ses.authstate)); | 56 memset(&ses.authstate, 0, sizeof(ses.authstate)); |
57 #ifdef DROPBEAR_PUBKEY_AUTH | 57 #ifdef DROPBEAR_PUBKEY_AUTH |
58 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY; | 58 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY; |
59 #endif | 59 #endif |
60 #ifdef DROPBEAR_PASSWORD_AUTH | 60 #if defined(DROPBEAR_PASSWORD_AUTH) || defined(DROPBEAR_PAM_AUTH) |
61 if (!svr_opts.noauthpass) { | 61 if (!svr_opts.noauthpass) { |
62 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD; | 62 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD; |
63 } | 63 } |
64 #endif | 64 #endif |
65 | 65 |
149 /* user wants to try password auth */ | 149 /* user wants to try password auth */ |
150 if (methodlen == AUTH_METHOD_PASSWORD_LEN && | 150 if (methodlen == AUTH_METHOD_PASSWORD_LEN && |
151 strncmp(methodname, AUTH_METHOD_PASSWORD, | 151 strncmp(methodname, AUTH_METHOD_PASSWORD, |
152 AUTH_METHOD_PASSWORD_LEN) == 0) { | 152 AUTH_METHOD_PASSWORD_LEN) == 0) { |
153 svr_auth_password(); | 153 svr_auth_password(); |
154 goto out; | |
155 } | |
156 } | |
157 #endif | |
158 | |
159 #ifdef DROPBEAR_PAM_AUTH | |
160 if (!svr_opts.noauthpass && | |
161 !(svr_opts.norootpass && ses.authstate.pw->pw_uid == 0) ) { | |
162 /* user wants to try password auth */ | |
163 if (methodlen == AUTH_METHOD_PASSWORD_LEN && | |
164 strncmp(methodname, AUTH_METHOD_PASSWORD, | |
165 AUTH_METHOD_PASSWORD_LEN) == 0) { | |
166 svr_auth_pam(); | |
154 goto out; | 167 goto out; |
155 } | 168 } |
156 } | 169 } |
157 #endif | 170 #endif |
158 | 171 |