mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Fix crypt-on-glibc test error
* test-suite/tests/posix.test ("crypt"): Allow for the given salt being valid. Thanks to Jonathan Brielmaier for the report and debugging!
This commit is contained in:
parent
1f6786db06
commit
667e511dc3
1 changed files with 15 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*-
|
;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*-
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012,
|
;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012,
|
||||||
;;;; 2015, 2017 Free Software Foundation, Inc.
|
;;;; 2015, 2017, 2019 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -232,10 +232,17 @@
|
||||||
(pass-if "basic usage"
|
(pass-if "basic usage"
|
||||||
(string? (crypt "pass" "abcdefg")))
|
(string? (crypt "pass" "abcdefg")))
|
||||||
|
|
||||||
(pass-if-exception "glibc EINVAL" exception:system-error
|
(pass-if "crypt invalid salt on glibc"
|
||||||
;; This used to deadlock while trying to throw to 'system-error'.
|
(begin
|
||||||
;; This test uses the special interpretation of the salt that glibc
|
(unless (string-contains %host-type "-gnu")
|
||||||
;; does; specifically, we pass a syntactically invalid salt here.
|
(throw 'unresolved))
|
||||||
(if (string-contains %host-type "-gnu")
|
(catch 'system-error
|
||||||
(crypt "pass" "$X$abc") ;EINVAL
|
(lambda ()
|
||||||
(throw 'unresolved))))
|
;; This used to deadlock on glibc while trying to throw to
|
||||||
|
;; 'system-error'. This test uses the special
|
||||||
|
;; interpretation of the salt that glibc does;
|
||||||
|
;; specifically, we pass a salt that's probably
|
||||||
|
;; syntactically invalid here. Note, whether it's invalid
|
||||||
|
;; or not is system-defined, so it's possible it just works.
|
||||||
|
(string? (crypt "pass" "$X$abc")))
|
||||||
|
(lambda _ #t)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue