summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-06-09 13:38:02 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-06-09 13:38:02 (GMT)
commit24d6d8331eea25d38af1806b0afba14648978057 (patch)
treedd96fa0866672b04d67852d7fb688aed6a7c4835
parentaec02a3a38b88d01d12bda3469fecb3de20ac067 (diff)
downloadperl-Kolab-24d6d8331eea25d38af1806b0afba14648978057.tar.gz
Check if hashmethod exists and is executable before actually executing. Solves #111
-rw-r--r--lib/Kolab.pm10
1 files changed, 7 insertions, 3 deletions
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