From 1f9fbfa71eaacec179d6d2694384531568adfdd0 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 7 Feb 2010 19:10:53 +0530 Subject: [PATCH] get "info" for users other than yourself if you have read access to the admin repo, you can say ssh git@server info user1 [...] Original idea and code by Karteek E. The motivation is to quickly and easily check what perms a user has. Technically nothing that you can't glean from the config file itself but it serves as a double check or a mild debugging aid perhaps. However note that the branch level rules are much more complex and they do not, as yet, have any such "helpful" aids. Life is like that sometimes. --- src/gitolite.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gitolite.pm b/src/gitolite.pm index 0f84272..5638d05 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -352,6 +352,14 @@ sub special_cmd if ($cmd eq 'info') { &report_basic($GL_ADMINDIR, $GL_CONF_COMPILED, $user); print "you also have shell access\n\r" if $shell_allowed; + } elsif ($cmd =~ /^info\s+(.+)$/) { + my @otherusers = split ' ', $1; + &parse_acl($GL_CONF_COMPILED); + die "you can't ask for others' permissions\n" unless $repos{'gitolite-admin'}{'R'}{$user}; + for my $otheruser (@otherusers) { + warn("ignoring illegal username $otheruser\n"), next unless $otheruser =~ $USERNAME_PATT; + &report_basic($GL_ADMINDIR, $GL_CONF_COMPILED, $otheruser); + } } elsif ($HTPASSWD_FILE and $cmd eq 'htpasswd') { &ext_cmd_htpasswd($HTPASSWD_FILE); } elsif ($RSYNC_BASE and $cmd =~ /^rsync /) {