[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/09: substitute: Validate substitute URLs.
From: |
Ludovic Courtès |
Subject: |
09/09: substitute: Validate substitute URLs. |
Date: |
Tue, 2 May 2017 06:33:07 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 8a2105078b5845e31768da06b360676352b1f3e9
Author: Ludovic Courtès <address@hidden>
Date: Tue May 2 12:28:23 2017 +0200
substitute: Validate substitute URLs.
Reported by Maxim Cournoyer <address@hidden>
at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00548.html>.
* guix/scripts/substitute.scm (validate-uri): New procedure.
(guix-substitute): Use it.
---
guix/scripts/substitute.scm | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 748c334..b4e913a 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -980,6 +980,10 @@ default value."
(and number (max 20 (- number 1))))))
80))
+(define (validate-uri uri)
+ (unless (string->uri uri)
+ (leave (_ "~a: invalid URI~%") uri)))
+
(define (guix-substitute . args)
"Implement the build daemon's substituter protocol."
(mkdir-p %narinfo-cache-directory)
@@ -1001,6 +1005,9 @@ default value."
(newline)
(force-output (current-output-port))
+ ;; Sanity-check %CACHE-URLS so we can provide a meaningful error message.
+ (for-each validate-uri %cache-urls)
+
;; Attempt to install the client's locale, mostly so that messages are
;; suitably translated.
(match (or (find-daemon-option "untrusted-locale")
- branch master updated (7020a6a -> 8a21050), Ludovic Courtès, 2017/05/02
- 01/09: publish: Use a larger zlib buffer for compression with '--cache'., Ludovic Courtès, 2017/05/02
- 02/09: gnu: emacs-emms: Update to 4.3., Ludovic Courtès, 2017/05/02
- 05/09: gnu: libiconv: Update to 1.15., Ludovic Courtès, 2017/05/02
- 03/09: gnu: acct: Update to 6.6.3., Ludovic Courtès, 2017/05/02
- 06/09: gnu: ocrad: Update to 0.26., Ludovic Courtès, 2017/05/02
- 07/09: gnu: parallel: Update to 20170422., Ludovic Courtès, 2017/05/02
- 04/09: gnu: less: Update to 487., Ludovic Courtès, 2017/05/02
- 08/09: services: nscd: Create /etc/resolv.conf if it does not exist., Ludovic Courtès, 2017/05/02
- 09/09: substitute: Validate substitute URLs.,
Ludovic Courtès <=