aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-23 17:02:40 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-23 17:02:40 -0700
commit8ea7ea4103aec49e2002466b5f22d3152a7f9a04 (patch)
treec7b1c1272fac616e64cdae877e036896a1b1b9b2
parentbf304f4c287f0a4501be6c0d4680c403a43735fd (diff)
downloadconsfigurator-8ea7ea4103aec49e2002466b5f22d3152a7f9a04.tar.gz
fix checking stream element type in CONSFIGURATOR.CONNECTION.SUDO
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection/sudo.lisp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp
index 75b7ec8..551741f 100644
--- a/src/connection/sudo.lisp
+++ b/src/connection/sudo.lisp
@@ -81,13 +81,12 @@
(new-input (cond
((and password input)
(make-concatenated-stream
- (case (stream-element-type input-stream)
- (character
- password-stream)
- (t
- (babel-streams:make-in-memory-input-stream
- (babel:string-to-octets password :encoding :UTF-8)
- :element-type (stream-element-type input-stream))))
+ (if (subtypep (stream-element-type input-stream)
+ 'character)
+ password-stream
+ (babel-streams:make-in-memory-input-stream
+ (babel:string-to-octets password :encoding :UTF-8)
+ :element-type (stream-element-type input-stream)))
input-stream))
(password
password-stream)