aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-03 06:15:42 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-03 06:15:42 +0000
commite190c166364d0a5bb5e5089a16644ff96c9799e5 (patch)
treec8ef3682ec9e1a7c8ee9787661062cbc5ed8c4ec
parent3483e85f6bdeaacb24c9170c0ee0851eeb32f0f6 (diff)
downloadbusybox-w32-e190c166364d0a5bb5e5089a16644ff96c9799e5.tar.gz
busybox-w32-e190c166364d0a5bb5e5089a16644ff96c9799e5.tar.bz2
busybox-w32-e190c166364d0a5bb5e5089a16644ff96c9799e5.zip
correct_password: do not print "no shadow passwd..." message
function old new delta correct_password 204 191 -13 .rodata 129530 129466 -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-77) Total: -77 bytes text data bss dec hex filename 675984 2744 13968 692696 a91d8 busybox_old 675908 2744 13968 692620 a918c busybox_unstripped
-rw-r--r--libbb/correct_password.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index f832635e6..815c51c43 100644
--- a/libbb/correct_password.c
+++ b/libbb/correct_password.c
@@ -40,12 +40,6 @@ int correct_password(const struct passwd *pw)
40{ 40{
41 char *unencrypted, *encrypted; 41 char *unencrypted, *encrypted;
42 const char *correct; 42 const char *correct;
43#if ENABLE_FEATURE_SHADOWPASSWDS
44 /* Using _r function to avoid pulling in static buffers */
45 struct spwd spw;
46 struct spwd *result;
47 char buffer[256];
48#endif
49 43
50 /* fake salt. crypt() can choke otherwise. */ 44 /* fake salt. crypt() can choke otherwise. */
51 correct = "aa"; 45 correct = "aa";
@@ -55,11 +49,14 @@ int correct_password(const struct passwd *pw)
55 } 49 }
56 correct = pw->pw_passwd; 50 correct = pw->pw_passwd;
57#if ENABLE_FEATURE_SHADOWPASSWDS 51#if ENABLE_FEATURE_SHADOWPASSWDS
58 if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) { 52 if ((correct[0] == 'x' || correct[0] == '*') && !correct[1]) {
59 if (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result)) 53 /* Using _r function to avoid pulling in static buffers */
60 bb_error_msg("no valid shadow password, checking ordinary one"); 54 struct spwd spw;
61 else 55 struct spwd *result;
56 char buffer[256];
57 if (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result) == 0)
62 correct = spw.sp_pwdp; 58 correct = spw.sp_pwdp;
59 /* else: no valid shadow password, checking ordinary one */
63 } 60 }
64#endif 61#endif
65 62