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

LDAP C API: LDAP_OPT_ERROR_NUMBER/STRING clobbering



Per some offline discussions, I suggest the specification
state the following:

  ldap_set_option should not modify the session error
  number (accessible via LDAP_OPT_ERROR_NUMBER) or the
  error string (accessible via LDAP_OPT_ERROR_STRING) values
  of the LDAP session except:
       by request (LDAP_OPT_ERROR_NUMBER or LDAP_OPT_ERROR_STRING)
       was specified, or
	upon error.

  ldap_get_option should not modify the session error
  number (accessible via LDAP_OPT_ERROR_NUMBER) or the
  error string (accessible via LDAP_OPT_ERROR_STRING) values
  of the LDAP session except upon error.

The intent of this change is require implementations not
clobber the session error number/string when a successful
access was made.


Additional comments:

This does not prevent a implementation from clobberring a
protocol error number/string when an application is fetch
the protocol string/number.  Ie:

	rc = ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &s);

	if( rc ) {
		/* error, LDAP_OPT_ERROR_NUMBER is clobberred
			with API error */
	}

or:
	rc = ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &s);

	if( rc ) {
		/* error, LDAP_OPT_ERROR_STRING may be clobberred
			with API error string */
	}

But that's another rant...