From f9090015c58e6f47be74fe6116ef10a90378a899 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 29 Sep 2020 09:35:35 +0200 Subject: secret-service: Fix file port leak in 'secret-service-send-secrets'. * gnu/build/secret-service.scm (secret-service-send-secrets): Use 'call-with-input-file' instead of 'open-input-file'. --- gnu/build/secret-service.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gnu/build') diff --git a/gnu/build/secret-service.scm b/gnu/build/secret-service.scm index 40c24abf09..6697e6e1b0 100644 --- a/gnu/build/secret-service.scm +++ b/gnu/build/secret-service.scm @@ -69,8 +69,10 @@ local PORT. If connect fails, sleep 1s and retry RETRY times." (version 0) (files ,files-sizes-modes)))) (write secrets sock) - (for-each (compose (cute dump-port <> sock) - (cute open-input-file <>)) + (for-each (lambda (file) + (call-with-input-file file + (lambda (input) + (dump-port input sock)))) files)))) (define (secret-service-receive-secrets port) -- cgit 1.4.1