all messages for Guix-related lists mirrored at yhetil.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; 8+ 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] 8+ messages in thread

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

Thread overview: 8+ 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#32132: daemon store names can't " Clément Lassieur
2018-07-12 13:20         ` bug#32111: " Clément Lassieur
2018-07-12 16:17         ` [bug#32111] " Ludovic Courtès
2018-07-12 16:35           ` bug#32132: " Clément Lassieur

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.