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'.
This commit is contained in:
parent
5db07b971d
commit
6f8eb9f1d8
|
@ -76,8 +76,14 @@ result to the current output port using the (guix repl) protocol."
|
||||||
(with-imported-modules (source-module-closure '((guix repl)))
|
(with-imported-modules (source-module-closure '((guix repl)))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (guix repl))
|
(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))
|
(current-output-port))
|
||||||
|
|
||||||
(force-output))))
|
(force-output))))
|
||||||
|
|
||||||
(define* (remote-eval exp session
|
(define* (remote-eval exp session
|
||||||
|
|
Loading…
Reference in New Issue