Skip to content

Commit ebf4bd7

Browse files
author
Mislav Novakovic
committed
server session BUGFIX where crypt_r is not available
Signed-off-by: Mislav Novakovic <[email protected]>
1 parent 43d2ee5 commit ebf4bd7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/session_server_ssh.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,9 @@ static int
751751
auth_password_compare_pwd(const char *pass_hash, const char *pass_clear)
752752
{
753753
char *new_pass_hash;
754+
#if defined(HAVE_CRYPT_R)
754755
struct crypt_data cdata;
756+
#endif
755757

756758
if (!pass_hash[0]) {
757759
if (!pass_clear[0]) {
@@ -764,8 +766,12 @@ auth_password_compare_pwd(const char *pass_hash, const char *pass_clear)
764766
}
765767
}
766768

769+
#if defined(HAVE_CRYPT_R)
767770
cdata.initialized = 0;
768771
new_pass_hash = crypt_r(pass_clear, pass_hash, &cdata);
772+
#else
773+
new_pass_hash = crypt(pass_clear, pass_hash);
774+
#endif
769775
return strcmp(new_pass_hash, pass_hash);
770776
}
771777

0 commit comments

Comments
 (0)