From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcy9G-00023E-No for guix-patches@gnu.org; Tue, 10 Jul 2018 15:18:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcy9C-0004UH-Tx for guix-patches@gnu.org; Tue, 10 Jul 2018 15:18:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcy9C-0004UC-Ox for guix-patches@gnu.org; Tue, 10 Jul 2018 15:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fcy9C-0000o4-HS for guix-patches@gnu.org; Tue, 10 Jul 2018 15:18:02 -0400 Subject: [bug#32111] [PATCH] daemon: Allow store names to start with a dot. Resent-Message-ID: Date: Tue, 10 Jul 2018 19:18:39 +0000 From: Nils Gillmann Message-ID: <20180710191839.bujbi5ekprczypwv@abyayala> References: <20180710124355.12754-1-clement@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180710124355.12754-1-clement@lassieur.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 32111@debbugs.gnu.org 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 > > > >