in reply to Re: LDAP Authentication
in thread LDAP Authentication

Sorry for being vague. Here is some more details-

$userdn get valid value. I can see when i print $suerdn. However as rightly pointed it is the $cmd where script fails. It returns

ldap_simple_bind_s: Invalid credentials

Replies are listed 'Best First'.
Re^3: LDAP Authentication
by g0n (Priest) on Nov 08, 2005 at 13:19 UTC
    Have you tried printing out $cmd, inspecting the string to make sure it's a valid 'ldapsearch' command, and perhaps pasting it straight into the command line?

    --------------------------------------------------------------

    "If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."

    John Brunner, "The Shockwave Rider".

      Yes I did. In fact script is perfectly OK even if there is a $, = or # etc but fails with ',`,",! etc characters.
        Then it seems likely that the shell is interpreting those characters rather than passing them to ldapsearch. This really would be very much easier and more secure with Net::LDAP - is there a reason why you can't use the module?

        --------------------------------------------------------------

        "If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."

        John Brunner, "The Shockwave Rider".