From: "Clément Lassieur" <clement@lassieur.org>
To: 32111@debbugs.gnu.org
Subject: [bug#32111] [PATCH] daemon: Allow store names to start with a dot.
Date: Tue, 10 Jul 2018 14:43:55 +0200 [thread overview]
Message-ID: <20180710124355.12754-1-clement@lassieur.org> (raw)
* 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
next reply other threads:[~2018-07-10 12:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 12:43 Clément Lassieur [this message]
2018-07-10 19:18 ` [bug#32111] [PATCH] daemon: Allow store names to start with a dot Nils Gillmann
2018-07-10 19:23 ` Clément Lassieur
2018-07-12 8:41 ` Ludovic Courtès
2018-07-12 13:20 ` bug#32111: daemon store names can't " Clément Lassieur
2018-07-12 16:17 ` [bug#32111] " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710124355.12754-1-clement@lassieur.org \
--to=clement@lassieur.org \
--cc=32111@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).