summaryrefslogtreecommitdiffhomepage
path: root/libbb/correct_password.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-13 12:27:17 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-13 12:27:17 +0000
commitca525b4f24a1a27ffe5dfc8d04c55227ca335ba0 (patch)
tree8ccf1f528aafeeb00368c41be74900db86d43d14 /libbb/correct_password.c
parentb51fd3525e48c79ef9e854dd357a9cdfdfeef72b (diff)
*: BB_BANNER -> bb_banner (it is not a const or #define)!
correct_password: explain in detail why it is ok to use bb_banner fsck_minix: make it print bb version, not it's own (outdated/irrelevant) one Marginal size difference: text data bss dec hex filename 679119 2700 15632 697451 aa46b busybox_old 679091 2700 15632 697423 aa44f busybox_unstripped
Diffstat (limited to 'libbb/correct_password.c')
-rw-r--r--libbb/correct_password.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index 6255f7e65..d0f68c0cd 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, '*')) {