diff --git a/modules/ssh/session.scm b/modules/ssh/session.scm index 0f04090..24c15a0 100644 --- a/modules/ssh/session.scm +++ b/modules/ssh/session.scm @@ -46,6 +46,7 @@ (define-module (ssh session) #:use-module (ice-9 optargs) #:use-module (ssh log) + #:use-module (ssh version) #:export (session session? %make-session @@ -67,6 +68,9 @@ (define-macro (session-set-if-specified! option) `(if ,option (session-set! session (quote ,option) ,option))) +(define %libssh-minor-version + (string->number (cadr (string-split (get-libssh-version) #\.)))) + ;; This procedure is more convenient than primitive `%make-session', ;; but on other hand it should be a bit slower because of additional ;; checks. I think we can put up with this. -avp @@ -94,7 +98,17 @@ Return a new SSH session." (%gssh-session-parse-config! session #f)) (else (throw 'guile-ssh-error "Wrong 'config' value" config)))) - (session-set! session 'process-config? #f)) + (if (>= %libssh-minor-version 9) + (session-set! session 'process-config? #f) + (format-log 'rare + 'make-session + (string-append + "process-config? option is not available" + " (using libssh 0.~a.)" + " Falling back to the old Guile-SSH behavior " + " (no config setting.)" + " See .") + %libssh-minor-version))) (session-set-if-specified! port) (session-set-if-specified! user)