[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Error to get LDAP_OPT_API_INFO

El mié, 15-01-2003 a las 00:15, German Poo Caaman~o escribió:
> Hello,
> I'm trying to get the version with a small C program, 
> however ldap_get_options always returns an error, I'm
> still can't see where is the problem. I can get other
> options, such as, LDAP_OPT_HOST_NAME, but not the version.
> I made an small test program, quite simple.  I'll appreaciate
> any hint.
> My server:
> ii  slapd          2.0.27-3       OpenLDAP server (slapd).

Well, After that I took a look the source code of
(ldap_get_option implementation), at line 109 the following code:

switch(option) {
	struct ldapapiinfo *info = (struct ldapapiinfo *) outvalue;

	if(info == NULL) {
	/* outvalue must point to an apiinfo structure /
		return LDAP_OPT_ERROR;			}

	if(info->ldapai_info_version != LDAP_API_INFO_VERSION) {
		/* api info version mismatch */
		info->ldapai_info_version = LDAP_API_INFO_VERSION;
		return LDAP_OPT_ERROR;

I set:

ldapinfo.ldapai_info_version = LDAP_API_INFO_VERSION;

before to call ldap_get_option, and it works.  However,
I'm getting:

vendor: OpenLDAP version: 20026

I was expecting 20027.


German Poo Caaman~o
"Hay 10 tipos de personas: las que entienden binario y las que no."