Verified Commit 6e691c21 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

dsa: forbid - in usernames



Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 6210b2d5
Pipeline #257524 passed with stage
in 5 minutes and 24 seconds
......@@ -85,6 +85,12 @@ class LDAPFields(models.Model):
"uid": _("DSA expressed a preference against dots in usernames."
" Contact debian-admin@lists.debian.org for details."),
})
# See RT#8583: - breaks the email address extension.
if self.uid and "-" in self.uid:
raise ValidationError({
"uid": _("DSA forbids dashes in usernames."
" Contact debian-admin@lists.debian.org for details."),
})
if self.uid and self.uid in dam_forbidden_uids:
raise ValidationError({
"uid": _("The requested UID is a system user or a well known alias,"
......
......@@ -19,6 +19,7 @@ class TestLDAPFields(TestCase):
"bo",
"fooBar",
"foo.bar",
"foo-bar",
"root",
):
f.uid = u
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment