summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dropbear/dropbear/allow-nopw.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/dropbear/dropbear/allow-nopw.patch')
-rw-r--r--meta/recipes-core/dropbear/dropbear/allow-nopw.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-core/dropbear/dropbear/allow-nopw.patch b/meta/recipes-core/dropbear/dropbear/allow-nopw.patch
new file mode 100644
index 0000000000..2ae361c63e
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/allow-nopw.patch
@@ -0,0 +1,38 @@
1diff --git a/svr-auth.c b/svr-auth.c
2index 5da0aa7..4de4964 100644
3--- a/svr-auth.c
4+++ b/svr-auth.c
5@@ -249,6 +249,7 @@ static int checkusername(unsigned char *username, unsigned int userlen) {
6 }
7
8 /* check for an empty password */
9+#ifdef DISALLOW_EMPTY_PW
10 if (ses.authstate.pw_passwd[0] == '\0') {
11 TRACE(("leave checkusername: empty pword"))
12 dropbear_log(LOG_WARNING, "user '%s' has blank password, rejected",
13@@ -256,6 +257,7 @@ static int checkusername(unsigned char *username, unsigned int userlen) {
14 send_msg_userauth_failure(0, 1);
15 return DROPBEAR_FAILURE;
16 }
17+#endif
18
19 TRACE(("shell is %s", ses.authstate.pw_shell))
20
21diff --git a/svr-authpasswd.c b/svr-authpasswd.c
22index 53550a2..7b896bd 100644
23--- a/svr-authpasswd.c
24+++ b/svr-authpasswd.c
25@@ -64,9 +64,13 @@ void svr_auth_password() {
26 * since the shadow password may differ to that tested
27 * in auth.c */
28 if (passwdcrypt[0] == '\0') {
29+#ifdef DISALLOW_EMPTY_PASSWD
30 dropbear_log(LOG_WARNING, "user '%s' has blank password, rejected",
31 ses.authstate.pw_name);
32 send_msg_userauth_failure(0, 1);
33+#else
34+ send_msg_userauth_success();
35+#endif
36 return;
37 }
38