× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I looked at the page on the knowledgecenter for ldap_set_option.
It says you can set LDAP_OPT_REFERRALS using LDAP_OPT_ON or LDAP_OPT_OFF.

When I looked in QSYSINC/H(LDAP) I found these definitions:
#define LDAP_OPT_ON 0x01
#define LDAP_OPT_OFF 0x00

Which leads me to believe you could try a char instead of an int(10).
Dcl-s debugOffValue Char(1) Inz(x'00');



Also, there appears to be a difference depending on your version of LDAP.

OptionValue - (Input) The address of the value. For LDAP V3 client options, optionValue is the actual value to be set.

So with LDAP V3 you send the value, otherwise you send the address.


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Monnier
Sent: Friday, April 27, 2018 1:23 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: ldap_set_option() parameters

Hi,

I'm trying to set the LDAP_OPT_REFERRALS option off but I keep running
into a "Bad parameter to an ldap routine" error. I've searched the
archives and found two similar questions bu not answers. Doesn't mean the
aren't there I just can't find them so I'm asking too.

IBM's documentation has the following interface:


int ldap_set_option(
LDAP **ld*,
int *optionToSet*,
const void **optionValue* )


I have the following prototype defined:

D ldap_set_option...
D PR 10I 0 EXTPROC('ldap_set_option')
D ldapPointer * value
D LDAP_OPT_REFERRALS...
D 10I 0 value
D ldapOptValue * CONST

D LDAP_OPT_REFERRALS...
D S 10I 0 inz(2)
D ldapOptValue S *
D debugOffValue S 10I 0 inz(0)

/free
.
.
.
debugOffValue = ldapDebugOff;
ldapOptValue = %addr(debugOffValue);
returnCode = ldap_set_option(ldapPointer:
LDAP_OPT_REFERRALS:
ldapOptValue);
.
.
.
/end-free

I've tried other combinations but I keep receiving a return code value of
89 with a message text of "Bad parameter to an ldap routine".

Using

D ldapOptValue * value

results in the same error

What parameter is bad? I can't tell. My guess is parameter 3.

A trace dump is of no use.

ldap_start_operation: ld->ld_ref_count(1)
ldap_end_operation: ld->ld_ref_count(0)
ldap_err2string: err(89)


Does anyone see anything wrong with the way I set up the prototype?

Any suggestions?

T
​hank you,


Gary Monnier

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.