GNU bug report logs - #32111
[PATCH] daemon: Allow store names to start with a dot.

Previous Next

Package: guix-patches;

Reported by: Clément Lassieur <clement <at> lassieur.org>

Date: Tue, 10 Jul 2018 12:45:01 UTC

Severity: normal

Tags: patch

Done: Clément Lassieur <clement <at> lassieur.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 32111 <at> debbugs.gnu.org (full text, mbox):

From: Nils Gillmann <ng0 <at> n0.is>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 32111 <at> debbugs.gnu.org
Subject: Re: [bug#32111] [PATCH] daemon: Allow store names to start with a dot.
Date: Tue, 10 Jul 2018 19:18:39 +0000
Hi,

Can you provide some context why this is necessary, maybe even
in the commit message?

Clément Lassieur transcribed 883 bytes:
> * nix/libstore/store-api.cc (checkStoreName): Disallow only "." and "..".
> ---
>  nix/libstore/store-api.cc | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/nix/libstore/store-api.cc b/nix/libstore/store-api.cc
> index 9e07c67e9..1618f1745 100644
> --- a/nix/libstore/store-api.cc
> +++ b/nix/libstore/store-api.cc
> @@ -58,9 +58,8 @@ string storePathToName(const Path & path)
>  void checkStoreName(const string & name)
>  {
>      string validChars = "+-._?=";
> -    /* Disallow names starting with a dot for possible security
> -       reasons (e.g., "." and ".."). */
> -    if (string(name, 0, 1) == ".")
> +    /* Disallow "." and ".." for possible security reasons. */
> +    if ((name == ".") || (name == ".."))
>          throw Error(format("illegal name: `%1%'") % name);
>      foreach (string::const_iterator, i, name)
>          if (!((*i >= 'A' && *i <= 'Z') ||
> -- 
> 2.18.0
> 
> 
> 
> 




This bug report was last modified 6 years and 319 days ago.

Previous Next


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