Commit Graph

19 Commits (089f0f9d9ed37d44ad2d8d0eb574e1496b113579)

Author SHA1 Message Date
Sitaram Chamarty 089f0f9d9e on removing a repo...
Not following through on instructions to remove a repo, per [1], is not
sufficient.  Even if you did just the first step, the repo should  no
longer be accessible.  See [2] for discussion.

As a bonus, we get rid of one pesky warning that always confused people.
(In hindsight -- this confusion itself should have been a warning that
something is wrong and needed fixing!)

[1]: http://sitaramc.github.com/gitolite/repos.html
[2]: http://groups.google.com/group/gitolite/browse_thread/thread/a3d4c3e917056abb
2012-12-31 06:23:28 +05:30
Sitaram Chamarty b303694882 minor bugly...
please remember we make up words here, like refex was a word we created
to mean "a regex that matches a ref".

A "bugly", then, is a bug that's merely ugly (and not a real problem!)
2012-12-29 13:40:13 +05:30
Sitaram Chamarty 4f4658274d CREATOR need only be a "word" in wild repo patterns
this was a v2 compat breakage, caught by Dominik Schäfer
(schaedpq at gmail)
2012-12-19 06:27:24 +05:30
Sitaram Chamarty 2741fadc9d a few minor changes
* minor typos
  * perltidy on Tsh
  * a minor optimisation to "do" in gl-conf
  * remove inapplicable caveat in fork command
2012-12-04 05:43:48 +05:30
Sitaram Chamarty d3d93961a0 Uggh; horrible inner loop screwing up all performance :-(
This might actually make the redis version unnecessary for most people!
And if it does, well shame on me for not instrumenting things at a more
granular level before going all "oh we need a cache!"

[In my defense, I blame redis for being such a sweet little tool that I
felt compelled to use it somehow!]

----

t/sequence failed because the test itself was in error; fixed.
2012-11-14 15:43:57 +05:30
Sitaram Chamarty 8a9564f171 some minor rearrangements of code...
why?  now that would be telling!
2012-11-08 19:12:20 +05:30
Sitaram Chamarty a509b208e3 move %GL_REPO and %GL_CREATOR substitution into core
see usage example at the end of src/triggers/upstream
2012-11-07 05:36:28 +05:30
Sitaram Chamarty f636ce3ba3 (security) fix bug in pattern to detect path traversal
while we're about it, add the same check to some of the internal
routines, so that commands can also be protected.

finally, just to make sure we don't lose it again in some other fashion,
add a few tests for path traversal...
2012-10-05 12:28:20 +05:30
Sitaram Chamarty 0d371ac957 call GROUPLIST_PGM before determining user_roles()...
thanks to Stephane Chazelas [1]

[1]: https://groups.google.com/d/topic/gitolite/gy_ZkrxGSjg
2012-10-04 22:03:19 +05:30
Sitaram Chamarty 6328ec2cbe dont auto-vivify empty entries in %repos...
before this, trying to access a wild repo would create an empty hash in
%repos.  This is pretty harmless, but at some later point, memberships()
would try to use that in a pattern, attempting to match the real repo
being access-checked.

Which is still fine if your repo doesn't look like "libstdc++" AND
you're using some recent perl.

However, for perl 5.8.8, and if the repo has a ++ in it, perl barfs.

Here's a test program to check your perl:

    #!/usr/bin/perl

    $base="foo/u1/libstdc++";
    $i="foo/u1/libstdc++";

    if ( $base =~ /^$i$/ ) {
        print 1;
    } else {
        print 2;
    }

On 5.14.2 I get "2".  On 5.8.8 I get:

    Nested quantifiers in regex; marked by <-- HERE in m/^foo/u1/libstdc++ <-- HERE $/ at ./aa.pl line 6.
2012-09-25 19:10:47 +05:30
Sitaram Chamarty 3fe8ecf974 (minor) avoid spurious 'repo missing' messages for repo patterns 2012-09-25 19:05:57 +05:30
Sitaram Chamarty d9df70a04f allow getting config settings for non-existant repos also
It's reasonable to want to see config items (for example, mirror
settings) that *would* apply if the repo existed.
2012-06-01 16:01:36 +05:30
Sitaram Chamarty d04e79d291 (minor) single quotes around variables in error messages
(plus a couple of other minor fixups)
2012-05-21 17:44:30 +05:30
Sitaram Chamarty e76be7ff11 move repo/user validity check deeper
(but change repo check to allow repoPATT instead of just repoNAME)

This is because there are/will be some situations where access() is
called without those two checks being done (i.e., it is not only from
src/commands/access that it is called).
2012-05-06 19:02:42 +05:30
Sitaram Chamarty d8df4a9344 git-config bugfix + backward compat breakage in usage of 'config'
(1) the backward compat breakage: you can't create empty-valued config
    keys anymore.  That is, you can't do the eqvt of the following shell
    command using gitolite

        git config foo.bar ""

(2) fixed a bug where this:

        repo foo
            config foo.bar =

    when queried using

        gitolite git-config -r foo .

    would return even the empty valued ones, which -- remember! -- are
    not supposed to exist anymore.

    Fixing this bug allows situations like this to not show the admin
    repo in gitweb:

        repo [a-z].*
            config gitweb.owner = P-h B

        repo gitolite-admin
            config gitweb.owner =

----

background...

Somewhere in g3 (well actually in 057506b), we lost the ability to
distinguish
    config foo.bar  =   ""
from
    config foo.bar =

I decided that conflating them is more intuitive for most people,
because a survey [1] revealed that no one seemed to want the equivalent
of the following shell command:

----

[1] ...of a (small prime greater than 1) number of people on #git
2012-05-04 17:30:22 +05:30
Sitaram Chamarty 6b65e7853f (minor) add quotes to make repo name stand out in error message 2012-04-22 22:43:45 +05:30
Sitaram Chamarty c3ec518cef fork command, and some core changes to make it work...
- access command allows checking ^C
  - ^C check will fail when the repo exists
2012-04-22 16:56:21 +05:30
Sitaram Chamarty 1c15b4cc2d (perltidy) 2012-04-18 06:26:53 +05:30
Sitaram Chamarty d3610191d3 supporting DOS and fake Unix...
I was very, very, tempted to say "sorry; not supported".  Sadly,
prudence won over juvenile glee...

PS: DOS == dominant operating system
2012-04-06 21:13:56 +05:30