From 3dd1436fc3c3f0eeb985a04a8a2359a763f18e5f Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 18 May 2012 16:35:39 +0200 Subject: [PATCH] Fix typo and exit code --- ipasserelle-base.spec | 2 +- root/etc/e-smith/events/actions/update-ldap-pseudonyms | 2 +- root/etc/e-smith/events/actions/update-reverse-group | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ipasserelle-base.spec b/ipasserelle-base.spec index 5e20b09..99123ef 100644 --- a/ipasserelle-base.spec +++ b/ipasserelle-base.spec @@ -1,5 +1,5 @@ %define version 0.2.6 -%define release 1.beta0 +%define release 1.beta1 %define name ipasserelle-base diff --git a/root/etc/e-smith/events/actions/update-ldap-pseudonyms b/root/etc/e-smith/events/actions/update-ldap-pseudonyms index 5542e31..aa2ccf3 100644 --- a/root/etc/e-smith/events/actions/update-ldap-pseudonyms +++ b/root/etc/e-smith/events/actions/update-ldap-pseudonyms @@ -147,7 +147,7 @@ foreach my $acct (@accounts){ mail => \@alias } ); - $result->code && ($x = 255, warn "failed to modify entry $dn=$key,ou=$ou,$base: ", $result->error;) + $result->code && ($x = 255, warn "failed to modify entry $dn=$key,ou=$ou,$base: ", $result->error); } } diff --git a/root/etc/e-smith/events/actions/update-reverse-group b/root/etc/e-smith/events/actions/update-reverse-group index 28a1aa6..5f540af 100644 --- a/root/etc/e-smith/events/actions/update-reverse-group +++ b/root/etc/e-smith/events/actions/update-reverse-group @@ -38,9 +38,9 @@ my $a = esmith::AccountsDB->open_ro; my $i = $c->get('ipasserelle'); my $ip = $i->prop('status') || 'disabled'; my $reverse = $i->prop('LdapReverseGroups') || 'disabled'; +my $x = 0; -exit (0) if (($ip eq 'disabled') || ($reverse eq 'disabled')){ - +exit (0) if (($ip eq 'disabled') || ($reverse eq 'disabled')); my $l = $c->get('ldap'); my $status = $l->prop('status') || "disabled"; @@ -101,7 +101,7 @@ foreach my $acct (@accounts){ scope => 'sub', filter => "uid=$key" ); - $result->code && warn "Error looking for entry uid=$key,ou=Users,$base: ", $result->error; + $result->code && ($x = 255, warn "Error looking for entry uid=$key,ou=Users,$base: ", $result->error); my @oc = (); my @oldgroups = (); foreach my $entry ($result->all_entries()){ @@ -118,7 +118,7 @@ foreach my $acct (@accounts){ objectClass => \@oc } ); - $result->code && warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error; + $result->code && ($x = 255, warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error); } my @groups = $a->user_group_list($key); @@ -134,9 +134,10 @@ foreach my $acct (@accounts){ posixMemberOf => \@groups } ); - $result->code && warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error; + $result->code && ($x = 255, warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error); } } $ldap->unbind; +exit ($x);