ldap_search_s(...) fail sometimes; LdapErr: "...successful..

G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory,microsoft.public.platformsdk.active.directory (More info?)

Hi,

I have a question relating to ldap_search_s.

Before I call the ldap_search_s function, I do following steps:

1. ldap_initialize(&pldap, hostname);
2. ldap_set_option(….);
3. ldap_bind_s(pldap, NULL, NULL, LDAP_AUTH_SIMPLE);

Then I call the function:
ldap_search_s(pldap,base,LDAP_SCOPE_SUBTREE,filter,attrs,0,&result);


My simple program works in a strange way:
Sometimes the ldap_search_s functions works and receives the wanted
information.
But after a few runs, the same code fails and returns "operations
error":

I call the function "ldap_get_option(pldap,LDAP_OPT_ERROR_STRING,&errorstring)"
to get more informations. It receives following string…

"00000000: LdapErr: DSID-0C0905FF, comment: In order to perform this
operation a successful bind must be completed on the connection., data
0, vece"

Why does it sometimes work/not work? What can I do that my program
runs without this strange habit?

Regards,
berni
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory,microsoft.public.platformsdk.active.directory (More info?)

I am guessing the problem you are seeing is related to a feature of simple
ldap bind. The feature is that a simple bind with empty password never
fails. If the username/pwd does not match, then it is treated as "become
anonymous" request. You should stop using simple bind, it is unsafe, because
it involves sending clear-text password over the wire. Use negotiate
instead.

--
Dmitri Gavrilov
SDE, DS Admin eXperience

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"berni_z" <berni_z@gmx.at> wrote in message
news:a0566bea.0506132319.fa1c19b@posting.google.com...
> Hi,
>
> I have a question relating to ldap_search_s.
>
> Before I call the ldap_search_s function, I do following steps:
>
> 1. ldap_initialize(&pldap, hostname);
> 2. ldap_set_option(..);
> 3. ldap_bind_s(pldap, NULL, NULL, LDAP_AUTH_SIMPLE);
>
> Then I call the function:
> ldap_search_s(pldap,base,LDAP_SCOPE_SUBTREE,filter,attrs,0,&result);
>
>
> My simple program works in a strange way:
> Sometimes the ldap_search_s functions works and receives the wanted
> information.
> But after a few runs, the same code fails and returns "operations
> error":
>
> I call the function
> "ldap_get_option(pldap,LDAP_OPT_ERROR_STRING,&errorstring)"
> to get more informations. It receives following string.
>
> "00000000: LdapErr: DSID-0C0905FF, comment: In order to perform this
> operation a successful bind must be completed on the connection., data
> 0, vece"
>
> Why does it sometimes work/not work? What can I do that my program
> runs without this strange habit?
>
> Regards,
> berni
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory,microsoft.public.platformsdk.active.directory (More info?)

thank you for help...

it works now, without any "strange behaviour".

regards,
berni



"Dmitri Gavrilov [MSFT]" <dmitrig@online.microsoft.com> wrote in message news:<eBdzt9XcFHA.3464@tk2msftngp13.phx.gbl>...
> I am guessing the problem you are seeing is related to a feature of simple
> ldap bind. The feature is that a simple bind with empty password never
> fails. If the username/pwd does not match, then it is treated as "become
> anonymous" request. You should stop using simple bind, it is unsafe, because
> it involves sending clear-text password over the wire. Use negotiate
> instead.
>
> --
> Dmitri Gavrilov
> SDE, DS Admin eXperience
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
> "berni_z" <berni_z@gmx.at> wrote in message
> news:a0566bea.0506132319.fa1c19b@posting.google.com...
> > Hi,
> >
> > I have a question relating to ldap_search_s.
> >
> > Before I call the ldap_search_s function, I do following steps:
> >
> > 1. ldap_initialize(&pldap, hostname);
> > 2. ldap_set_option(..);
> > 3. ldap_bind_s(pldap, NULL, NULL, LDAP_AUTH_SIMPLE);
> >
> > Then I call the function:
> > ldap_search_s(pldap,base,LDAP_SCOPE_SUBTREE,filter,attrs,0,&result);
> >
> >
> > My simple program works in a strange way:
> > Sometimes the ldap_search_s functions works and receives the wanted
> > information.
> > But after a few runs, the same code fails and returns "operations
> > error":
> >
> > I call the function
> > "ldap_get_option(pldap,LDAP_OPT_ERROR_STRING,&errorstring)"
> > to get more informations. It receives following string.
> >
> > "00000000: LdapErr: DSID-0C0905FF, comment: In order to perform this
> > operation a successful bind must be completed on the connection., data
> > 0, vece"
> >
> > Why does it sometimes work/not work? What can I do that my program
> > runs without this strange habit?
> >
> > Regards,
> > berni