Commit graph

227 commits

Author SHA1 Message Date
Sitaram Chamarty 70ad045e08 (minor fixups to some non-code parts) 2012-10-31 06:24:44 +05:30
Andrew Page 2aa129bc70 fix for keysubdirs-as-groups sugar script to support "old style multi-keys" for users 2012-10-29 17:15:52 -06:00
Sitaram Chamarty 4eb8cd4ad1 (minor) bash -> sh changes in some non-core code
/bin/bash is muscle memory for me, although it appears that not too much
of the actual code is bash-specific, so it's reasonably easy to fix.
2012-10-27 07:07:30 +05:30
Sitaram Chamarty 3eefc06551 (minor) clarify that D only works on wild repos 2012-10-10 13:43:17 +05:30
Eugene E. Kashpureff Jr 896ada58c0 Fix spurious error in triggers/upstream
The initial fetch of a new repo which has 'upstream' read-only mirroring
configured will cause a spurious error concerning FETCH_HEAD not yet
existing. This silences the error.
2012-10-10 07:59:52 +00:00
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 2dbaa4d12e (minor) move a small chunk of code out of a loop 2012-09-26 14:58:56 +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 9606e35528 help cgit folks out a bit :) 2012-09-24 04:53:20 +05:30
Sitaram Chamarty 724c741335 prevent barfage when presetting the rc file 2012-09-20 06:21:44 +05:30
Sitaram Chamarty e59c3ba9f9 (minor docfix) add info on using Easy.pm from elsewhere 2012-09-19 17:47:12 +05:30
Sitaram Chamarty aec8c71890 'help' command barfage fix
should not barf if LOCAL_CODE is defined but it doesn't contain a
"commands" subdirectory.
2012-08-30 18:40:24 +05:30
Sitaram Chamarty cc9727c42b minor bug in include file handing...
gitolite does indeed try to not load itself twice, but I forgot that by
that time the pwd is ~/.gitolite/conf not ~/.gitolite so it always ended
up reading itself twice in case of a wildcard include.
2012-08-17 22:26:03 +05:30
Sitaram Chamarty 7409635823 (minor) add a 'dd' function to quickly dump stuff to STDERR 2012-08-17 10:04:32 +05:30
Olof Johansson ba67f6f9ca Bailout tests unless envvar $GITOLITE_TEST is 'y'
[committer made some changes to t/README]
2012-08-10 11:31:48 +05:30
Nate Jones 31166e1e1c find symlinked commands when generating help list 2012-08-03 13:48:19 -07:00
Patrick Westerhoff 57bea39a1e Add special %GL_CREATOR variable for git-config
Add a special variable `%GL_CREATOR` to the the git-config trigger that
is replaced by the name of the repository creator (if any).

This can be useful to set up the default owner configuration for wild
repositories.

Example:

    repo assignments/CREATOR/a[0-9][0-9]
        C   = @students
        RW+ = CREATOR
        config gitweb.owner = %GL_CREATOR

----

committer added an if condition to the s/// line.
2012-07-19 16:16:22 +05:30
Sitaram Chamarty f4eb6dcb53 'rsync' command to create and send bundles (manual smoke test only)
run 'ssh git@host rsync -h' for usage, as usual
2012-07-19 14:40:41 +05:30
Sitaram Chamarty 8ad1eee220 migrated 'who-pushed' command (manual smoke test only) 2012-07-17 16:52:56 +05:30
Sitaram Chamarty fd0778e6d6 (minor) don't keep adding the same thing to $PATH 2012-07-10 21:10:06 +05:30
Sitaram Chamarty f545bc08f6 minor fixups 2012-07-03 08:06:59 +05:30
Sitaram Chamarty db2cf23379 logical expressions on refexes :-) 2012-06-29 22:19:06 +05:30
Sitaram Chamarty 53543ee3e6 partial-copy would not propagate deletes; fixed 2012-06-23 09:11:08 +05:30
Konstantin Gribov fb9829a698 Fixed url decoding in http gitolite command bypass.
Only '+' sign was unescaped in `http_simulate_ssh_connection()`.
When user translates `ssh git@host perms <repo> + <role> <user>` to
`curl https://host/git/perms?<repo>+%2b+<role>+<user>` nothing happens.
This commit fixes it modifying url unescaping.

committer notes: changed the regex per 'man URI::Escape'
2012-06-22 11:49:28 +05:30
Sitaram Chamarty 621815611c (duh!) report rc file syntax errors
the "duh!" is because I should have done this long ago...
2012-06-21 06:49:22 +05:30
Sitaram Chamarty a454111d32 repo-specific umask
manually smoke tested but should be fine
2012-06-21 05:31:15 +05:30
Sitaram Chamarty c9d5a13194 help command learns to deal with LOCAL_CODE 2012-06-19 21:00:53 +05:30
Sitaram Chamarty 56d11deb55 (minor) one more 'internal' message bites the dust 2012-06-19 12:11:27 +05:30
Sitaram Chamarty a171053ab3 (minor) improve SNR of some error messages :) 2012-06-17 09:31:38 +05:30
Sitaram Chamarty fbd745958e PRE_ and POST_CREATE triggers get an extra argument...
...when invoked by single-repo operations like auto-creating a wild
repo, or running perms or fork.
2012-06-14 19:22:12 +05:30
Sitaram Chamarty 57f82ee044 new 'list-dangling-repos' command 2012-06-14 19:22:12 +05:30
Sitaram Chamarty 4373c5c74c GL_BINDIR2 becomes LOCAL_CODE, allows hook propagation also...
plus a bunch of doc changes
2012-06-14 19:22:12 +05:30
Sitaram Chamarty 3c0f177481 Allow user-specified programs to override system-installed ones
(manually tested)

  - new rc var: GL_BINDIR2; see doc update in this commit

  - added _which() function to search both $GL_BINDIR and $GL_BINDIR2
  - 'gitolite <command>', non-perl triggers, VREFs, and sugar, use this

  - unshifted $GL_BINDIR2/lib into @INC upfront in Rc.pm
  - perl triggers use this
2012-06-09 08:25:51 +05:30
Randal L. Schwartz 8e15d3a510 gitolite patch to enable keydir to be a symlink 2012-06-08 03:47:04 +05:30
Sitaram Chamarty 5300809103 ACCESS_2 gets 2 more arguments, and gets called for each VREF 2012-06-06 20:33:59 +05:30
Sitaram Chamarty 10cd5b9abe 'upstream' trigger can now be used as a server command also
i.e., a client fetch will invoke the push, (subject to 'nice' setting),
but you can also force a fetch regardless of last fetch time by running
this command directly on the server:

    gitolite ../triggers/upstream fetch <reponame>

Also, use FETCH_HEAD instead of own sentinel file (idea courtesy Luke Lu)
2012-06-06 19:28:18 +05:30
Sitaram Chamarty 8b78dee18c 'upstream' -- script to maintain local copies of external repos
instructions and notes in the source
2012-06-05 22:23:23 +05:30
Sitaram Chamarty f59ad8cafc (accumulated docfixes) esp a large section on the INPUT trigger 2012-06-05 11:39:18 +05:30
Sitaram Chamarty 17c41ce63b new 'sudo' command 2012-06-03 14:20:27 +05:30
Sitaram Chamarty ad34cf2856 minor backward incompat breakage in 'gitolite query-rc'
'gitolite query-rc' now only queries one variable at a time.  That is,
you cannot do something like this:

    gitolite query-rc UMASK GL_ADMIN_BASE

to query both variables.  I think this is rarely used, plus it is easy
to work-around (just run two separate commands), so it was sacrificed
for the ability to do this:

    gitolite query-rc -q COMMANDS fork

which tells you whether $rc{COMMANDS}{fork} exists or not.
2012-06-03 13:00:38 +05:30
John Keeping 4abadc2b54 Grant shell access to all keys for shell users
If a user has multiple keys, ssh-authkeys-shell-users will only add the
"-s" flag to the first key it finds.  Change the substitution to apply
to all matching lines and hence grant shell access to all of the user's
keys.

Signed-off-by: John Keeping <john@keeping.me.uk>
2012-06-03 13:00:38 +05:30
Sitaram Chamarty db70595b87 fixup to pushing wild repos permissions...
- fix docs to explicitly state that mirroring wild repos is a bad idea
    if the authentication data is not the same on the peers.

  - an important check against a malicious peer was missed out.  If
    people heed the warning above this check is not really needed but it
    is good for completeness.

  - warning about redirected pushes removed, thanks to Ronald Ip having
    tested it and reported it working.
2012-06-03 07:44:08 +05:30
Sitaram Chamarty 78866f6f28 (experimental code) push wild repos across a master slave connection
It creates the repo on the remote side (getting the creator name from
the gl-creator file and sending it across), as well as sending gl-perms
on subsequent connections.

This has only been minimally tested.  E.g., complex setups or asymmetric
configs on master and slave, etc. have NOT been tested.

This has also not been tested with redirected pushes.
2012-06-01 17:28:14 +05:30
Sitaram Chamarty 42e0bac48c 'perms' command learns to create repo if needed 2012-06-01 16:01:36 +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 7170ad9124 allow pubkey filename as extra argument to command in authkeys 2012-05-30 15:02:35 +05:30
Sitaram Chamarty 21dbe53d39 fix minor bug in handling 'desc = "some description"'
repo foo
        desc = "foo"
        RW  =   u1
        ...etc...

The order of the clauses was parsing this like the old 'reponame = "some
description"' and end up creating a repo called 'desc'!

It would also, as a side-effect, change the repo so what you thought
were access rules for 'foo' would become access rules for 'desc'.
2012-05-29 20:55:53 +05:30
Sitaram Chamarty 06d3398fb0 lock binary files... (manually tested)
Remember that true locking is not possible in a DVCS; see
doc/locking.mkd for details and limitations of what is offered here.
2012-05-27 19:06:46 +05:30