Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
JMM_91548
byJMM_91548, November 7, 2012
There is an error in the sript which isn't able to use an authenticated connection.
If USER (-u) and PASS (-p) are provided, they aren't used in the ldapsearch generated command and the connection is still anonymous.
Suggestion
the LDAP query should be modified as follow:
# do the ldap query
if [ "${USER}" = "" ];
then
# maybe you need the -Z here if you have the simple authentication deactivated
ldapsearch -H ${TYPE}://${HOST}:${PORT} -x -b "" -s base ${LDAPATTR} >${TMPFILE} 2>${ERRFILE}
EXITCODE=$?
else
# maybe you need the -Z here if you have the simple authentication deactivated
ldapsearch -H ${TYPE}://${HOST}:${PORT} -x -b "" -s base ${LDAPATTR} -D ${USER} -w ${PASS} >${TMPFILE} 2>${ERRFILE}
EXITCODE=$?
fi
Best regards
Jean-Marc
If USER (-u) and PASS (-p) are provided, they aren't used in the ldapsearch generated command and the connection is still anonymous.
Suggestion
the LDAP query should be modified as follow:
# do the ldap query
if [ "${USER}" = "" ];
then
# maybe you need the -Z here if you have the simple authentication deactivated
ldapsearch -H ${TYPE}://${HOST}:${PORT} -x -b "" -s base ${LDAPATTR} >${TMPFILE} 2>${ERRFILE}
EXITCODE=$?
else
# maybe you need the -Z here if you have the simple authentication deactivated
ldapsearch -H ${TYPE}://${HOST}:${PORT} -x -b "" -s base ${LDAPATTR} -D ${USER} -w ${PASS} >${TMPFILE} 2>${ERRFILE}
EXITCODE=$?
fi
Best regards
Jean-Marc