diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/Kbuild | 3 | ||||
-rw-r--r-- | libbb/crypt_make_salt.c | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/libbb/Kbuild b/libbb/Kbuild index 6595867..c0cbe1a 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild @@ -104,7 +104,8 @@ lib-y += xreadlink.o lib-$(CONFIG_FEATURE_MOUNT_LOOP) += loop.o lib-$(CONFIG_LOSETUP) += loop.o lib-$(CONFIG_FEATURE_MTAB_SUPPORT) += mtab.o -lib-$(CONFIG_PASSWD) += pw_encrypt.o crypt_make_salt.o +lib-$(CONFIG_PASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o +lib-$(CONFIG_CHPASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o lib-$(CONFIG_CRYPTPW) += pw_encrypt.o crypt_make_salt.o lib-$(CONFIG_SULOGIN) += pw_encrypt.o lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o diff --git a/libbb/crypt_make_salt.c b/libbb/crypt_make_salt.c index 12e9632..ebdf024 100644 --- a/libbb/crypt_make_salt.c +++ b/libbb/crypt_make_salt.c @@ -24,12 +24,9 @@ static int i64c(int i) return ('a' - 38 + i); } - -void crypt_make_salt(char *p, int cnt) +int crypt_make_salt(char *p, int cnt, int x) { - unsigned x = x; /* it's pointless to initialize it anyway :) */ - - x += getpid() + time(NULL) + clock(); + x += getpid() + time(NULL); do { /* x = (x*1664525 + 1013904223) % 2^32 generator is lame * (low-order bit is not "random", etc...), @@ -44,5 +41,5 @@ void crypt_make_salt(char *p, int cnt) *p++ = i64c(x >> 22); } while (--cnt); *p = '\0'; + return x; } - |