Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitolite's default "config" option filter is overly conservative, precluding usage of refFilter*Regex options (docs issue) #119

Closed
pfalcon opened this issue Aug 21, 2015 · 1 comment

Comments

@pfalcon
Copy link

pfalcon commented Aug 21, 2015

See #118 for background. We tried to use multimailhook.refFilterInclusionRegex option, and had gitolite barf about suspicious chars in option value (a regex). So, we had to adjust UNSAFE_PATT setting in gitolite.rc (see patch below). Again, maybe worth mentioned that in gitolite.rc (just mention that UNSAFE_PATT may need to be adjusted in that file to give user a direction, and let them research and decide what would be "safe" setting for them).

    gitolite.rc: Override and make more liberal UNSAFE_PATT.

    UNSAFE_PATT appears to be used to validate "config" directives in
    gitolite.conf file (i.e. entries to be added to .git/config of
    gitolite-managed repos). This changes is similar REMOTE_COMMAND_PATT
    override applied previously. Specific cause is the need to specify a
    regex for git-multimail hook.

diff --git a/per-service/git-servers/roles/gitolite/templates/gitolite.rc b/per-service/git-servers/roles/gitolite/templates/gitolite.rc
index 1e74588..d7406e1 100644
--- a/per-service/git-servers/roles/gitolite/templates/gitolite.rc
+++ b/per-service/git-servers/roles/gitolite/templates/gitolite.rc
@@ -190,6 +190,7 @@
 # Allow single quote appear in gitolite commands, useful e.g. with "desc"
 # command.
 $REMOTE_COMMAND_PATT = qr(^[-0-9a-zA-Z._\@/+ :,\%=']*$);
+$UNSAFE_PATT         = qr([`~#\&;<>]);

 # ------------------------------------------------------------------------------
 # per perl rules, this should be the last line in such a file:
@moy
Copy link
Contributor

moy commented Aug 21, 2015

I'm not a gitolite user (I've installed to test git-multimail, but that's all), so I may not be the best person to write the doc. I'll try a patch, but feel free to submit a PR to improve it.

@moy moy closed this as completed in a903d9f Aug 21, 2015
edward-dauvergne pushed a commit to edward-dauvergne/git-multimail that referenced this issue Aug 31, 2015
Fixes git-multimail#119.

The documentation is kept short and is purposely not sufficient for the
user to set UNSAFE_PATT, as I do not want people to blindly apply an
unsafe reciepe. Instead, add a link to the official documentation of
UNSAFE_PATT which explains the safety implications better than we would
do here.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants