Closed Bug 466222 Opened 17 years ago Closed 17 years ago

update hg_helper.py on hg.m.o to know that '.' and '/' are valid characters in repository names

Categories

(mozilla.org Graveyard :: Server Operations, task)

x86
macOS
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: aravind)

References

Details

Attachments

(1 file)

The interactive cloning seems to bypass the name validation, but it is currently impossible to clone releases/mozilla-1.9.1 to a user repository via the 'ssh hg.m.o clone mymoz releases/mozilla-1.9.1' both because of the '/' and the '.'. I don't think this could be a security risk - neither of these are special characters.
Attachment #349482 - Flags: review?(aravind)
Assignee: server-ops → aravind
any update here?
I will work on updating the script this week. Should probably be ready sometime next week or so.
Is the patch which I attached not enough?
I haven't had a chance to look at it. Will do this week and integrate it into the script we have running. Also the current script is different from the prev version + your previous patches, so your patches may be all be applicable.
I am not sure this is valid. I was able to clone it exactly the way you described above. Here is the output from my session. ~ $ssh hg.mozilla.org clone mymoz releases/mozilla-1.9.1 Cloning /releases/mozilla-1.9.1 to /users/aravind_mozilla.com/mymoz (wait about 8 minutes..) Clone complete. Fixing permissions (wait a few more minutes..) ~ $ What the check_repo does is prevent users from naming their repos with a . and / in it. Otherwise things should be working correctly already. Am I missing the point of this bug? Did you want me to allow the . and / characters in user repos?
Hm, good point! Unless there's a reason not to it would be nice to allow '.' in user repository names, though.
Okay, will figure out a way to allow that, should be done sometime today.
Done, you can now have a repo with a . in the name.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Probably even more trivial than this bug was about, but does this allow: /^\.[a-zA-Z\.]/ as a repo name (yea regex, if you want 'english' I can too) The problem I see is pending how we serve up the info here, it may hide the repo from the public or even make it less discoverable for IT if they ever need to touch-up stuff there... (I'm not sure if it is a problem in practice basically)
(In reply to comment #9) > Probably even more trivial than this bug was about, but does this allow: > /^\.[a-zA-Z\.]/ as a repo name (yea regex, if you want 'english' I can too) Actually, it shouldn't allow that. Here is the regex that checks a user repos name. def check_repo_name (repo_name): good_chars = re.compile ('^(\w|-|\w\.\w)+$') if not good_chars.search (repo_name): sys.stderr.write ('Only alpha-numeric characters, ".", and "-" are allowed in the repository names.\n') sys.stderr.write ('Please try again with only those characters.\n') sys.exit (1) return 1
Attachment #349482 - Flags: review?(aravind)
Looks like this never got fixed. bitters-2:tmp bhearsum$ ssh hg.mozilla.org clone mozilla-1.9.1 releases/mozilla-1.9.1 Only alpha-numeric characters, ".", and "-" are allowed in the repository names. Please try again with only those characters.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The regex wasn't permissive enough. I changed it to def check_repo_name (repo_name): good_chars = re.compile ('^(\w|-|.\w)+$') if not good_chars.search (repo_name): sys.stderr.write ('Only alpha-numeric characters, ".", and "-" are allowed in the repository names.\n') sys.stderr.write ('Please try again with only those characters.\n') sys.exit (1) return 1 Seems to be working now.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
oops, I meant good_chars = re.compile ('^(\w|-|\.\w)+$')
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: