diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/correct_password.c | 11 | ||||
-rw-r--r-- | libbb/messages.c | 3 |
2 files changed, 9 insertions, 5 deletions
diff --git a/libbb/correct_password.c b/libbb/correct_password.c index 6255f7e..d0f68c0 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c @@ -47,9 +47,14 @@ int correct_password(const struct passwd *pw) char buffer[256]; #endif - correct = bb_msg_full_version; /* fake salt. crypt() can choke otherwise */ - if (!pw) - goto fake_it; /* The content of 'correct' will never match */ + /* fake salt. crypt() can choke otherwise. + * (bb_banner's first two chars are letters and thus are valid salt) */ + correct = bb_banner; + if (!pw) { + /* bb_banner will never match, it contains () which is never + * generated in valid encrypted passwords. */ + goto fake_it; + } correct = pw->pw_passwd; #if ENABLE_FEATURE_SHADOWPASSWDS if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) { diff --git a/libbb/messages.c b/libbb/messages.c index 56cccaf..8cab2dc 100644 --- a/libbb/messages.c +++ b/libbb/messages.c @@ -12,8 +12,7 @@ #else #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" #endif -const char BB_BANNER[] = BANNER; -const char bb_msg_full_version[] = BANNER " multi-call binary"; +const char bb_banner[] = BANNER; const char bb_msg_memory_exhausted[] = "memory exhausted"; const char bb_msg_invalid_date[] = "invalid date '%s'"; |