aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-04 22:46:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-04 22:46:37 +0000
commit0d56e4d7733f30729ce610f46011d56526f069f2 (patch)
treeb230738494c1c13bb773c61e84f94722e4b82e81
parent3dfd20069c351038a701eb161235086e747f59d3 (diff)
downloadpaludis-0d56e4d7733f30729ce610f46011d56526f069f2.tar.gz
paludis-0d56e4d7733f30729ce610f46011d56526f069f2.tar.xz
Make RepositoryNameValidator::validate do some validation rather than just accepting anything.
-rw-r--r--paludis/repository_name.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/paludis/repository_name.cc b/paludis/repository_name.cc
index e9e2b6c..f675bf6 100644
--- a/paludis/repository_name.cc
+++ b/paludis/repository_name.cc
@@ -24,11 +24,19 @@ using namespace paludis;
void
RepositoryNameValidator::validate(const std::string & s)
{
+ static const std::string allowed_chars(
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789-+_/");
+
do
{
if (s.empty())
break;
+ if (std::string::npos != s.find_first_not_of(allowed_chars))
+ break;
+
return;
} while (false);