projects
/
matthijs
/
upstream
/
backupninja-vserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Here is my trac commit
[matthijs/upstream/backupninja-vserver.git]
/
handlers
/
ldap
diff --git
a/handlers/ldap
b/handlers/ldap
index ee46831092d10688be9d67d09401c7329346aeb5..ba3d78a0d0f351de1c1e42ed49581afb080de822 100644
(file)
--- a/
handlers/ldap
+++ b/
handlers/ldap
@@
-12,6
+12,14
@@
getconf restart no
getconf method ldapsearch
getconf passwordfile
getconf binddn
getconf method ldapsearch
getconf passwordfile
getconf binddn
+getconf ldaphost
+getconf tls yes
+
+if [ $tls = 'yes' ]
+ URLBASE="ldaps"
+else
+ URLBASE="ldap"
+fi
status="ok"
status="ok"
@@
-54,9
+62,17
@@
if [ "$ldif" == "yes" ]; then
debug "$execstr"
else
if [ "$compress" == "yes" ]; then
debug "$execstr"
else
if [ "$compress" == "yes" ]; then
- execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile | $GZIP"
+ if [ -n "$ldaphost" ]
+ execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile | $GZIP"
+ else
+ execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile | $GZIP"
+ fi
else
else
- execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
+ if [ -n "$ldaphost" ]
+ execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
+ else
+ execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
+ fi
fi
[ -f "$passwordfile" ] || fatal "Password file $passwordfile not found. When method is set to ldapsearch, you must also specify a password file."
debug "$execstr"
fi
[ -f "$passwordfile" ] || fatal "Password file $passwordfile not found. When method is set to ldapsearch, you must also specify a password file."
debug "$execstr"