summaryrefslogtreecommitdiff
path: root/loginutils/passwd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-12 16:55:59 +0000
committerDenis Vlasenko2008-06-12 16:55:59 +0000
commit4ea83bf562c44a6792e7c77e7d87cba91f86f763 (patch)
tree64dba9163b29724e282c1e94027001a11978e74b /loginutils/passwd.c
parent9de462205542547694299e9fe2bc321088ab79aa (diff)
downloadbusybox-4ea83bf562c44a6792e7c77e7d87cba91f86f763.zip
busybox-4ea83bf562c44a6792e7c77e7d87cba91f86f763.tar.gz
uclibc insists on having 70k static buffer for crypt.
For bbox it's not acceptable. Roll our own des and md5 crypt implementation. Against older uclibc: text data bss dec hex filename 759945 604 6684 767233 bb501 busybox_old 759766 604 6684 767054 bb44e busybox_unstripped so, we still save on code size.
Diffstat (limited to 'loginutils/passwd.c')
-rw-r--r--loginutils/passwd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 3353db1..fad226c 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -24,7 +24,7 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo)
orig = bb_askpass(0, "Old password:"); /* returns ptr to static */
if (!orig)
goto err_ret;
- cipher = pw_encrypt(orig, pw->pw_passwd); /* returns ptr to static */
+ cipher = pw_encrypt(orig, pw->pw_passwd, 1); /* returns ptr to static */
if (strcmp(cipher, pw->pw_passwd) != 0) {
syslog(LOG_WARNING, "incorrect password for '%s'",
pw->pw_name);
@@ -56,7 +56,7 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo)
crypt_make_salt(salt + 3, 4, 0);
}
/* pw_encrypt returns ptr to static */
- ret = xstrdup(pw_encrypt(newp, salt));
+ ret = xstrdup(pw_encrypt(newp, salt, 1));
/* whee, success! */
err_ret: