Merge remote-tracking branch 'oe_21/master' into vuplus-3.0-next
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-daemon / vsftpd / vsftpd-3.0.2 / login-blank-password.patch
1 Index: vsftpd-3.0.2/sysdeputil.c
2 ===================================================================
3 --- vsftpd-3.0.2.orig/sysdeputil.c
4 +++ vsftpd-3.0.2/sysdeputil.c
5 @@ -267,6 +267,9 @@ vsf_sysdep_check_auth(struct mystr* p_us
6      }
7    }
8    #endif
9 +  /* Blank entry = anyone can login. Now what was that "s" in vsftpd? */
10 +  if (!p_pwd->pw_passwd || !(*p_pwd->pw_passwd))
11 +       return 1;
12    #ifdef VSF_SYSDEP_HAVE_SHADOW
13    {
14      const struct spwd* p_spwd = getspnam(str_getbuf(p_user_str));
15 @@ -284,6 +287,8 @@ vsf_sysdep_check_auth(struct mystr* p_us
16        {
17          return 0;
18        }
19 +         if (!p_spwd->sp_pwdp || !(*p_spwd->sp_pwdp))
20 +               return 1; /* blank = everything goes */
21        p_crypted = crypt(str_getbuf(p_pass_str), p_spwd->sp_pwdp);
22        if (!vsf_sysutil_strcmp(p_crypted, p_spwd->sp_pwdp))
23        {