aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/path.cc')
-rw-r--r--src/libstore/path.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstore/path.cc b/src/libstore/path.cc
index 552e83114..3c6b9fc10 100644
--- a/src/libstore/path.cc
+++ b/src/libstore/path.cc
@@ -11,6 +11,8 @@ static void checkName(std::string_view path, std::string_view name)
if (name.size() > StorePath::MaxPathLen)
throw BadStorePath("store path '%s' has a name longer than %d characters",
path, StorePath::MaxPathLen);
+ if (name[0] == '.')
+ throw BadStorePath("store path '%s' starts with illegal character '.'", path);
// See nameRegexStr for the definition
for (auto c : name)
if (!((c >= '0' && c <= '9')