Browse Source

remote: Make sure the user doesn't mess up with the REPL protocol.

Reported by zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze).

* guix/remote.scm (trampoline): Wrap 'primitive-load' in
'with-output-to-port'.
gn-latest-20200428
Ludovic Courtès 2 years ago
parent
commit
6f8eb9f1d8
No known key found for this signature in database GPG Key ID: 90B11993D9AEBB5
  1. 8
      guix/remote.scm

8
guix/remote.scm

@ -76,8 +76,14 @@ result to the current output port using the (guix repl) protocol."
(with-imported-modules (source-module-closure '((guix repl)))
#~(begin
(use-modules (guix repl))
(send-repl-response '(primitive-load #$program)
;; We use CURRENT-OUTPUT-PORT for REPL messages, so redirect PROGRAM's
;; output to CURRENT-ERROR-PORT so that it does not interfere.
(send-repl-response '(with-output-to-port (current-error-port)
(lambda ()
(primitive-load #$program)))
(current-output-port))
(force-output))))
(define* (remote-eval exp session

Loading…
Cancel
Save