aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-06-27 20:15:21 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-06-27 20:15:21 +0200
commit22796cd4f34bd10ecaa8f80e8cd9b098186aa38b (patch)
treed40e268ff3279e30d4642cea992fa66050f4b336
parent2eb63cfae624fbb80a81acc15a0429fca19beaa1 (diff)
downloadmgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.gz
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.bz2
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.tar.xz
mgagit-22796cd4f34bd10ecaa8f80e8cd9b098186aa38b.zip
Ignore group members not matching user re
-rw-r--r--NEWS2
-rw-r--r--lib/MGA/Git.pm5
2 files changed, 4 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 960bc00..9664e75 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- ignore group members not matching user re
+
Version 0.2
- add repodef_repo.gl template
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm
index 396e319..a9c0722 100644
--- a/lib/MGA/Git.pm
+++ b/lib/MGA/Git.pm
@@ -68,8 +68,7 @@ sub get_ldap {
sub re {
my ($re, $txt) = @_;
my $rr = qr/$config->{$re}/;
- $txt =~ s/$rr/$1/;
- return $txt;
+ return $txt =~ m/$rr/ ? $1 : undef;
}
sub load_groups {
@@ -82,7 +81,7 @@ sub load_groups {
);
my $res = $m->as_struct;
@{$r->{groups}}{map { re('group_re', $_) } keys %$res} =
- map { [ map { re('uid_username_re', $_) } @{$_->{member}} ] }
+ map { [ map { re('uid_username_re', $_) || () } @{$_->{member}} ] }
values %$res;
}