ocf / ocflib

Python libraries for account and server management
https://pypi.python.org/pypi/ocflib
Other
15 stars 32 forks source link

set max username length to 16 #209

Closed cg505 closed 4 years ago

cg505 commented 4 years ago

This was causing passwd to fail for usernames longer than 8 chars.

kpengboy commented 4 years ago

Lol, I guess we missed this back in 2015 (or whenever it was).

jvperrin commented 4 years ago

Yeah, looks like early 2016 from rt#4177, so it's been more than 4 years now 😅

cg505 commented 4 years ago

I feel a little scared injecting variables into a regex

nikhiljha commented 4 years ago

Side note, I don't actually understand this regex. Shouldn't it be ^([a-z]{3,16})(/[a-z]*)?@OCF\.BERKELEY\.EDU$ instead? I would think that the \\ is an escaped backslash character, followed by 1 of any non-whitespace character ., but when I run both regexes they seem to function as intended.

jvperrin commented 4 years ago

It's double escaping, once for python, and once for the dot so it's interpreted as a literal dot. Maybe using a r string here would be better to make that less confusing?

cg505 commented 4 years ago

I'm just going to go ahead and merge this now, the r string would be better but I think we should just get this out. If someone wants to make a PR for that, it would be great but I can't be bothered.