adduser: safe username passing to passwd/addgroup
passwd: support creating SHA passwords random code shrink function old new delta crypt_make_pw_salt - 87 +87 adduser_main 883 904 +21 ... crypt_make_salt 99 89 -10 chpasswd_main 329 312 -17 packed_usage 28731 28691 -40 passwd_main 1070 1000 -70 cryptpw_main 310 224 -86 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/12 up/down: 154/-288) Total: -134 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -1259,14 +1259,19 @@ extern int correct_password(const struct passwd *pw) FAST_FUNC;
|
||||
#endif
|
||||
extern char *pw_encrypt(const char *clear, const char *salt, int cleanup) FAST_FUNC;
|
||||
extern int obscure(const char *old, const char *newval, const struct passwd *pwdp) FAST_FUNC;
|
||||
/* rnd is additional random input. New one is returned.
|
||||
/*
|
||||
* rnd is additional random input. New one is returned.
|
||||
* Useful if you call crypt_make_salt many times in a row:
|
||||
* rnd = crypt_make_salt(buf1, 4, 0);
|
||||
* rnd = crypt_make_salt(buf2, 4, rnd);
|
||||
* rnd = crypt_make_salt(buf3, 4, rnd);
|
||||
* (otherwise we risk having same salt generated)
|
||||
*/
|
||||
extern int crypt_make_salt(char *p, int cnt, int rnd) FAST_FUNC;
|
||||
extern int crypt_make_salt(char *p, int cnt /*, int rnd*/) FAST_FUNC;
|
||||
/* "$N$" + sha_salt_16_bytes + NUL */
|
||||
#define MAX_PW_SALT_LEN (3 + 16 + 1)
|
||||
extern char* crypt_make_pw_salt(char p[MAX_PW_SALT_LEN], const char *algo) FAST_FUNC;
|
||||
|
||||
|
||||
/* Returns number of lines changed, or -1 on error */
|
||||
#if !(ENABLE_FEATURE_ADDUSER_TO_GROUP || ENABLE_FEATURE_DEL_USER_FROM_GROUP)
|
||||
|
Reference in New Issue
Block a user