aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/client-communication.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-build-coordinator/client-communication.scm')
-rw-r--r--guix-build-coordinator/client-communication.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm
index 2ea7ce2..6724e7c 100644
--- a/guix-build-coordinator/client-communication.scm
+++ b/guix-build-coordinator/client-communication.scm
@@ -461,6 +461,22 @@
(simple-format #f "derivation must be a string: ~A\n"
derivation))))
+ (unless (derivation-path? derivation-file)
+ (raise-exception
+ (make-exception-with-message
+ "invalid derivation path")))
+
+ (string-for-each
+ (lambda (c)
+ (unless (or (char-alphabetic? c)
+ (char-numeric? c)
+ (member c '(#\+ #\- #\. #\_ #\? #\=)))
+ (raise-exception
+ (make-exception-with-message
+ (simple-format #f "invalid character in derivation name: ~A"
+ c)))))
+ (store-path-base derivation-file))
+
(define (read-drv/substitute derivation-file)
(with-store/non-blocking store
(unless (valid-path? store derivation-file)