unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#32111] [PATCH] daemon: Allow store names to start with a dot.
@ 2018-07-10 12:43 Clément Lassieur
  2018-07-10 19:18 ` Nils Gillmann
  0 siblings, 1 reply; 6+ messages in thread
From: Clément Lassieur @ 2018-07-10 12:43 UTC (permalink / raw)
  To: 32111

* 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-12 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-10 12:43 [bug#32111] [PATCH] daemon: Allow store names to start with a dot Clément Lassieur
2018-07-10 19:18 ` 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

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).