[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36699] [PATCH 4/4] channels: Reject directories with '..' in '.guix
From: |
Ludovic Courtès |
Subject: |
[bug#36699] [PATCH 4/4] channels: Reject directories with '..' in '.guix-channel' file. |
Date: |
Wed, 17 Jul 2019 01:29:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Ludovic Courtès <address@hidden> skribis:
> + (define (sane-directory directory)
> + ;; If DIRECTORY contains '..', raise an error; otherwise return it.
> + (when (member ".." (string-split directory #\/))
> + (raise (condition
> + (&message (message "channel sub-directory must not contain
> '..'"))
> + (&error-location (location location)))))
> + directory)
On second thought, it’s probably kind of useless since the only place
where ‘directory’ is used is in the derivation that builds the channel,
which is normally running in a chroot:
(let* ((subdir #$directory)
(source (string-append #$source subdir)))
(compile-files source go (find-files source "\\.scm$"))
(mkdir-p (dirname scm))
(symlink (string-append #$source subdir) scm))
So I guess we can drop this patch. Thoughts?
Ludo’.
bug#36699: [PATCH 0/4] Strengthen '.guix-channel' file handling, Ludovic Courtès, 2019/07/19