× 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 tried all sorts of combinations. Nothing worked. It seem to have
something to do with ldap version handling by the api.

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

ILE RPG apparently doesn't have a counter part to const void.

Version 3 wants ldap_set_option( LDAP **ld*, int *optionToSet*, *
*optionValue* )

In ILE RPG you'd have ldap_set_option( l*d*, *optionToSet*, %addr(
*optionValue* )) Doesn't work. But in C ldap_set_option( l*d*,
*optionToSet*, &*optionValue*) does.

Go figure.



Gary Monnier
*ATI Administrator*
*425.427.7959*

On Tue, May 1, 2018 at 3:42 PM, Hiebert, Chris <chris.hiebert@xxxxxxxxxxxxxx
wrote:

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

--

This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list

To post a message email: RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.
midrange.com_mailman_listinfo_rpg400-2Dl&d=DwIGaQ&c=2S-2xx8Cum_thMfWs-
kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=
JKiJnQNJfhL6JOXD1gGnOkwrlfT4GN31uqnKY2BYHzA&s=6gbTKuydDX9o9E75RD_
ZBKPJDbFbXHleol-UYtbAYGc&e=

or email: RPG400-L-request@xxxxxxxxxxxx

Before posting, please take a moment to review the archives

at https://urldefense.proofpoint.com/v2/url?u=https-3A__
archive.midrange.com_rpg400-2Dl&d=DwIGaQ&c=2S-2xx8Cum_thMfWs-
kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=
JKiJnQNJfhL6JOXD1gGnOkwrlfT4GN31uqnKY2BYHzA&s=
ZQWK0HUpmSgGTH6yaM3uOcQIuYGB6ZuSRrYE9vjoKHU&e=.



Please contact support@xxxxxxxxxxxx for any subscription related
questions.



Help support midrange.com by shopping at amazon.com with our affiliate
link: https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_
2dEadiD&d=DwIGaQ&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=
GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=
JKiJnQNJfhL6JOXD1gGnOkwrlfT4GN31uqnKY2BYHzA&s=
bOxcBAOJLu4dJn3uwvLfdURcrSAm7AsUwEEYyIU3SaY&e=

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.
midrange.com_mailman_listinfo_rpg400-2Dl&d=DwIGaQ&c=
pApUd0AUA6FmKRo01iR_VA&r=r7w16KGEqE6t2tVCvCsz4_ztz5b0wbCtdhwrG0PzYq8&m=
rhTQVSYplNbph9vkgxcikQkVWJWwkt9RAUsUWUBYVjM&s=73lUTDxZOKNtW23AdIZOO5S-
01I4sHNTdClVkVgmts0&e=
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://urldefense.proofpoint.com/v2/url?u=https-3A__
archive.midrange.com_rpg400-2Dl&d=DwIGaQ&c=pApUd0AUA6FmKRo01iR_VA&r=
r7w16KGEqE6t2tVCvCsz4_ztz5b0wbCtdhwrG0PzYq8&m=
rhTQVSYplNbph9vkgxcikQkVWJWwkt9RAUsUWUBYVjM&s=aaHeRFmZWTW_
ohTpIE3TffvtjxOvAatGhw7N6fVJtgY&e=.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_
2dEadiD&d=DwIGaQ&c=pApUd0AUA6FmKRo01iR_VA&r=r7w16KGEqE6t2tVCvCsz4_
ztz5b0wbCtdhwrG0PzYq8&m=rhTQVSYplNbph9vkgxcikQkVWJWwkt
9RAUsUWUBYVjM&s=B4ZEk6_T8bK4tnr0R7Hw983nTOZeoulDPdBRgxrJ0JY&e=

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.