Mercurial > dropbear
comparison svr-auth.c @ 692:c58a15983808
Allow configuring "allow blank password option" at runtime
Changes this from a compile-time switch to a command-line option.
Signed-off-by: Paul Eggleton <[email protected]>
author | Paul Eggleton <paul.eggleton@linux.intel.com> |
---|---|
date | Tue, 12 Feb 2013 15:52:57 +0000 |
parents | 6e0899b56ac4 |
children | ac2158e3e403 e0084f136cb8 |
comparison
equal
deleted
inserted
replaced
691:e698d1a9f428 | 692:c58a15983808 |
---|---|
152 /* user wants to know what methods are supported */ | 152 /* user wants to know what methods are supported */ |
153 if (methodlen == AUTH_METHOD_NONE_LEN && | 153 if (methodlen == AUTH_METHOD_NONE_LEN && |
154 strncmp(methodname, AUTH_METHOD_NONE, | 154 strncmp(methodname, AUTH_METHOD_NONE, |
155 AUTH_METHOD_NONE_LEN) == 0) { | 155 AUTH_METHOD_NONE_LEN) == 0) { |
156 TRACE(("recv_msg_userauth_request: 'none' request")) | 156 TRACE(("recv_msg_userauth_request: 'none' request")) |
157 #ifdef ALLOW_BLANK_PASSWORD | 157 if (svr_opts.allowblankpass |
158 if (!svr_opts.noauthpass | 158 && !svr_opts.noauthpass |
159 && !(svr_opts.norootpass && ses.authstate.pw_uid == 0) | 159 && !(svr_opts.norootpass && ses.authstate.pw_uid == 0) |
160 && ses.authstate.pw_passwd[0] == '\0') | 160 && ses.authstate.pw_passwd[0] == '\0') |
161 { | 161 { |
162 dropbear_log(LOG_NOTICE, | 162 dropbear_log(LOG_NOTICE, |
163 "Auth succeeded with blank password for '%s' from %s", | 163 "Auth succeeded with blank password for '%s' from %s", |
165 svr_ses.addrstring); | 165 svr_ses.addrstring); |
166 send_msg_userauth_success(); | 166 send_msg_userauth_success(); |
167 goto out; | 167 goto out; |
168 } | 168 } |
169 else | 169 else |
170 #endif | |
171 { | 170 { |
172 send_msg_userauth_failure(0, 0); | 171 send_msg_userauth_failure(0, 0); |
173 goto out; | 172 goto out; |
174 } | 173 } |
175 } | 174 } |