From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcs0v-0006vf-IM for guix-patches@gnu.org; Tue, 10 Jul 2018 08:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcs0s-0004e2-BH for guix-patches@gnu.org; Tue, 10 Jul 2018 08:45:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45251) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcs0s-0004dr-6x for guix-patches@gnu.org; Tue, 10 Jul 2018 08:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fcs0r-000217-UF for guix-patches@gnu.org; Tue, 10 Jul 2018 08:45:01 -0400 Subject: [bug#32111] [PATCH] daemon: Allow store names to start with a dot. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcs0A-0006b3-0s for guix-patches@gnu.org; Tue, 10 Jul 2018 08:44:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcs06-0004LH-P3 for guix-patches@gnu.org; Tue, 10 Jul 2018 08:44:18 -0400 Received: from mail.lassieur.org ([83.152.10.219]:34592) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcs06-0004Km-Ce for guix-patches@gnu.org; Tue, 10 Jul 2018 08:44:14 -0400 Received: from localhost.localdomain (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 9fdafe61 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Tue, 10 Jul 2018 12:44:11 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Tue, 10 Jul 2018 14:43:55 +0200 Message-Id: <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: 32111@debbugs.gnu.org * 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