/[smeserver]/rpms/e-smith-qmail/sme9/e-smith-qmail-2.6.0-update_all_groups_alias.patch
ViewVC logotype

Contents of /rpms/e-smith-qmail/sme9/e-smith-qmail-2.6.0-update_all_groups_alias.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Jul 20 16:14:43 2017 UTC (6 years, 10 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-qmail-2_4_0-8_el6_sme, HEAD
* Thu Jul 20 2017 Daniel Berteaud <daniel@firewall-services.com> 2.4.0-8.sme
- Update aliases files for every groups passed as argument [SME: 10388]

1 diff -Nur e-smith-qmail-2.6.0/root/etc/e-smith/events/actions/qmail-update-group e-smith-qmail-2.6.0_bz10386/root/etc/e-smith/events/actions/qmail-update-group
2 --- e-smith-qmail-2.6.0/root/etc/e-smith/events/actions/qmail-update-group 2017-07-20 17:46:00.285609302 +0200
3 +++ e-smith-qmail-2.6.0_bz10386/root/etc/e-smith/events/actions/qmail-update-group 2017-07-20 17:49:57.171541855 +0200
4 @@ -33,28 +33,23 @@
5 my $event = $ARGV [0] || die "Event name arg missing\n";;
6 my @groups;
7
8 -if ($ARGV[1])
9 -{
10 - my $groupName = $ARGV [1];
11 - my $g = $a->get($groupName) ||
12 - die "Group $groupName not found in accounts db\n";
13 -
14 - my $type = $g->prop('type');
15 - if ($type =~ /^group/)
16 - {
17 - @groups = ($g);
18 - }
19 - # Is it a user?
20 - elsif ($type =~ /^user/)
21 - {
22 - # That's fine. We were probably just called from the user-delete
23 - # event, in which case we want to update all of the groups. So, leave
24 - # the groups array empty.
25 - @groups = ();
26 - }
27 - else
28 - {
29 - die "Expected a user or a group. Got neither: $type\n";
30 +if (scalar @ARGV)
31 +{
32 + @groups = map { $a->get($_); } @ARGV;
33 + foreach my $g (@groups)
34 + {
35 + my $type = $g->prop('type');
36 + if ($type =~ /^user/)
37 + {
38 + # That's fine. We were probably just called from the user-delete
39 + # event, in which case we want to update all of the groups. So, leave
40 + # the groups array empty.
41 + @groups = ();
42 + last;
43 + }
44 + elsif ($type !~ /^group/){
45 + die "Expected a user or a group. Got neither: $type\n";
46 + }
47 }
48 }
49

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed