Package: ldap2zone
Version: 0.1-2
Severity: normal
Tags: patch
When running as a normal user, ldap2bind doesn't detect that rndc and
ldap2zone are not on the user's PATH.
That's because ot an improper use of the -z flag on the tests.
-z STRING returns true if the length of STRING is zero, but on ldap2bind
the tests are like:
if [ -z ${#rndc} ]; then
${#rndc} is the length of $rndc. If $rndc is the empty string, ${#rndc}
is 0, and -z 0 is false.
A better way to test that would be:
if [ -z "${rndc}" ]; then
diff -ur ldap2zone.orig/ldap2bind ldap2zone.new/ldap2bind
--- ldap2zone.orig/ldap2bind 2009-06-17 09:27:35.000000000 +0100
+++ ldap2zone.new/ldap2bind 2009-09-03 11:58:07.000000000 +0100
@@ -11,17 +11,17 @@
ldap2zone=`which ldap2zone`
rndc=`which rndc`
-if [ -z ${#ZONES} ]; then
+if [ -z "${ZONES}" ]; then
echo "No domains configured. Exiting..."
exit 0
fi
-if [ -z ${#rndc} ]; then
+if [ -z "${rndc}" ]; then
echo "rndc utilty not in $PATH. Exiting..."
exit 1
fi
-if [ -z ${#ldap2zone} ]; then
+if [ -z "${ldap2zone}" ]; then
echo "ldap2zone utilty not in $PATH. Exiting..."
exit 1
fi