summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2025-07-07 17:42:35 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2025-07-07 17:42:35 +0200
commit5e9b95ff40de7e9b3395e51d456647ae99b2e8b2 (patch)
tree6818f8460fea1bced80573accf7381198bdefa16 /libbb
parent479d8db99faa005783fc483d0830314d6156e51f (diff)
cryptpw: -m sha512crypt must also be accepted
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/pw_encrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index 4acc33039..3b2fea00d 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -30,7 +30,7 @@ char* FAST_FUNC crypt_make_pw_salt(char salt[MAX_PW_SALT_LEN], const char *algo)
*salt_ptr++ = '$';
#if !ENABLE_USE_BB_CRYPT || ENABLE_USE_BB_CRYPT_SHA
if ((algo[0]|0x20) == 's') { /* sha */
- salt[1] = '5' + (strcasecmp(algo, "sha512") == 0);
+ salt[1] = '5' + (strncasecmp(algo, "sha512", 6) == 0);
len = 16 / 2;
}
#endif