lib/Kolab.pm

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Thu Jun 9 15:41:12 CEST 2011


 lib/Kolab.pm |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 24d6d8331eea25d38af1806b0afba14648978057
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Thu Jun 9 14:38:02 2011 +0100

    Check if hashmethod exists and is executable before actually executing. Solves #111

diff --git a/lib/Kolab.pm b/lib/Kolab.pm
index d9c1384..5b8197f 100644
--- a/lib/Kolab.pm
+++ b/lib/Kolab.pm
@@ -182,9 +182,13 @@ This function reloads the configuration for the Kolab perl library.
 
     # Make a hash of the bind password available too
     if( !exists $config{'bind_pw_hash'} ) {
-        my $hashcmd = $config{'hashmethod'} . " '".$config{'bind_pw'}."'";
-        $config{'bind_pw_hash'} = `$hashcmd`;
-        chomp($config{'bind_pw_hash'});
+        if ( exists $config{'hashmethod'} ) {
+            if ( -x $config{'hashmethod'} ) {
+                my $hashcmd = $config{'hashmethod'} . " '".$config{'bind_pw'}."'";
+                $config{'bind_pw_hash'} = `$hashcmd`;
+                chomp($config{'bind_pw_hash'});
+            }
+        }
     }
 
     # Retrieve the LDAP values of the main kolab object to complete our config hash





More information about the commits mailing list