GNU bug report logs - #30572
[PATCH 0/7] Add "guix system docker-image" command

Previous Next

Package: guix-patches;

Reported by: Chris Marusich <cmmarusich <at> gmail.com>

Date: Thu, 22 Feb 2018 10:31:02 UTC

Severity: normal

Tags: patch

Done: Chris Marusich <cmmarusich <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 30572 <at> debbugs.gnu.org, Chris Marusich <cmmarusich <at> gmail.com>, Ludovic Courtès <ludo <at> gnu.org>
Subject: [bug#30572] [PATCH 5/7] guix: Rewrite build-docker-image to allow more paths.
Date: Tue, 20 Mar 2018 04:26:00 +0100
[Message part 1 (text/plain, inline)]
Danny Milosavljevic <dannym <at> scratchpost.org> writes:

>> +  (define (sanitize path-fragment)
>> +    (escape-special-chars
>> +     ;; GNU tar strips the leading slash off of absolute paths before applying
>> +     ;; the transformations, so we need to do the same, or else our
>> +     ;; replacements won't match any paths.
>> +     (string-trim path-fragment #\/)
>> +     ;; Escape the basic regexp special characters (see: "(sed) BRE syntax").
>> +     ;; We also need to escape "/" because we use it as a delimiter.
>> +     "/*.^$[]\\"
>> +     #\\))
>
> I'm not such a fan of using blacklist.  Those can easily get out of sync and
> nobody notices.  But in this case I guess people take care not to extend
> basic regexp special characters in sed (tar) without the user specifying a flag
> requiring it.

That's a good point.  However, I think we're OK here, since we are in
full control over how we invoke tar.  To give us full control over how
we invoke tar, I specifically took care to hide the fact that we are
using tar under the covers to do the transformations.  Even if tar
silently changes its contract (that seems unlikely to me), we can just
change our code accordingly, and callers will be none the wiser.

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 7 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.