wok-undigest rev 544
busybox/httpd: fix shadow password
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Nov 06 09:41:04 2011 +0100 (2011-11-06) |
parents | dc1bc7aa6aa8 |
children | ab59654d633d |
files | busybox/stuff/busybox-1.19-httpd.u |
line diff
1.1 --- a/busybox/stuff/busybox-1.19-httpd.u Sat Nov 05 19:54:07 2011 +0100 1.2 +++ b/busybox/stuff/busybox-1.19-httpd.u Sun Nov 06 09:41:04 2011 +0100 1.3 @@ -32,8 +32,8 @@ 1.4 + 1.5 +#if ENABLE_FEATURE_HTTPD_AUTH_MD5 && ENABLE_PAM 1.6 +struct pam_userinfo { 1.7 -+ char *name; 1.8 -+ char *pw; 1.9 ++ const char *name; 1.10 ++ const char *pw; 1.11 +}; 1.12 + 1.13 +static int pam_talker(int num_msg, 1.14 @@ -55,7 +55,7 @@ 1.15 + 1.16 + /* copy values */ 1.17 + for (i = 0; i < num_msg; i++) { 1.18 -+ char *s; 1.19 ++ const char *s; 1.20 + 1.21 + switch (msg[i]->msg_style) { 1.22 + case PAM_PROMPT_ECHO_ON: 1.23 @@ -103,7 +103,7 @@ 1.24 + 1.25 + strncpy(username, user_and_passwd, user_len_p1); 1.26 + username[user_len_p1 - 1] = 0; 1.27 -+ if (passwd && passwd[1] == '*' && passwd[2] == 0) { 1.28 ++ if (passwd && passwd[1] == '*') { 1.29 +#if ENABLE_PAM 1.30 + struct pam_userinfo userinfo; 1.31 + struct pam_conv conv_info = {&pam_talker, (void *) &userinfo}; 1.32 @@ -139,7 +139,7 @@ 1.33 + * At least glibc 2.4 does this. Be extra paranoid here. */ 1.34 + struct spwd *result = NULL; 1.35 + r = getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result); 1.36 -+ if (r || !result) 1.37 ++ if (!r && result) 1.38 + passwd = result->sp_pwdp; 1.39 + } 1.40 +#endif