diff options
author | Carlo Marcelo Arenas Belón <carenas@gmail.com> | 2021-09-15 10:09:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-17 05:47:23 +0200 |
commit | bffcb4d9d6394a68a7f6c03598087705c6d34510 (patch) | |
tree | b0f7c93d815ea351888dc6bf7c19a1cb2721ae28 /t/t9400-git-cvsserver-server.sh | |
parent | git-cvsserver: use crypt correctly to compare password hashes (diff) | |
download | git-bffcb4d9d6394a68a7f6c03598087705c6d34510.tar.xz git-bffcb4d9d6394a68a7f6c03598087705c6d34510.zip |
git-cvsserver: protect against NULL in crypt(3)
Some versions of crypt(3) will return NULL when passed an unsupported
hash type (ex: OpenBSD with DES), so check for undef instead of using
it directly.
Also use this to probe the system and select a better hash function in
the tests, so it can pass successfully.
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
[jc: <CAPUEspjqD5zy8TLuFA96usU7FYi=0wF84y7NgOVFqegtxL9zbw@mail.gmail.com>]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9400-git-cvsserver-server.sh')
-rwxr-xr-x | t/t9400-git-cvsserver-server.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh index 59b40359c7..17f988edd2 100755 --- a/t/t9400-git-cvsserver-server.sh +++ b/t/t9400-git-cvsserver-server.sh @@ -36,7 +36,12 @@ CVSWORK="$PWD/cvswork" CVS_SERVER=git-cvsserver export CVSROOT CVS_SERVER -PWDHASH='lac2ItudM3.KM' +if perl -e 'exit(1) if not defined crypt("", "cv")' +then + PWDHASH='lac2ItudM3.KM' +else + PWDHASH='$2b$10$t8fGvE/a9eLmfOLzsZme2uOa2QtoMYwIxq9wZA6aBKtF1Yb7FJIzi' +fi rm -rf "$CVSWORK" "$SERVERDIR" test_expect_success 'setup' ' |