Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldap_set_option(LDAP_OPT_TIMEOUT, 1) on OpenLDAP returns -1 #21

Closed
phillipod opened this issue May 6, 2015 · 1 comment
Closed

ldap_set_option(LDAP_OPT_TIMEOUT, 1) on OpenLDAP returns -1 #21

phillipod opened this issue May 6, 2015 · 1 comment
Assignees
Milestone

Comments

@phillipod
Copy link
Collaborator

See #20 for full background.

ldap_set_option() and ldap_get_option() do not have support to serialize/deserialize 'struct timeval' option objects, and so for example an invalid parameter is passed into the C ldap_set_option(), resulting in a -1 return.

@phillipod
Copy link
Collaborator Author

Converting a perl timeout variable to a struct timeval will be done in 5 places once ldap_set_option() supports it, so it makes sense to refactor this into a helper.

And in order to better support Perl idioms and indeed increased granularity, it makes sense to use the Perl API to determine whether we are being passed an integer or a double, and populate the struct timeval accordingly.

The question is how to handle an erroneous value such as a string that is neither integer nor floating point - my preference would be to treat this as 'undef instead of settings tv_secs to -1', i.e, NULL is passed to the destination function as the struct timeval - allowing OpenLDAP's ldap_set_option(LDAP_OPT_TIMEOUT), or OpenLDAP and Mozilla LDAP's ldap_set_option(LDAP_OPT_TIMELIMIT) (as appropriate) to override these as well.

Edit: On second thought, it'd make more sense to return LDAP_PARAM_ERROR if an invalid timeout is specified.

quanah added a commit that referenced this issue May 20, 2015
 - Fixes #21: ldap_set_option(LDAP_OPT_TIMEOUT, 1) on OpenLDAP returns -1
rra pushed a commit to whm/libnet-ldapapi-perl that referenced this issue Dec 25, 2020
  * New upstream release.
  * Fix undef comparison
  * Misc variable initializations to quiet warnings
  * Fixed sasl mechanisms initializtion
  * Examples cleanup
  * LDAPv3 extended operation support
  * New developer mode test suite
  * Fixed quanah/net-ldapapi#3: ldap_set_rebind_proc XS being called with
    invalid arguments from set_rebind_proc
  * Fixed quanah/net-ldapapi#6: ldap_sasl_bind has wrong prototype in
    LDAPapi.xs
  * Fixed quanah/net-ldapapi#8: search_s() clobbers ATTRS parameter
  * Fixed quanah/net-ldapapi#11: result() blocking when called with output
    from rename()
  * Fixed quanah/net-ldapapi#20: ldap_result() doesn't honour passed
    timeout value
  * Fixed quanah/net-ldapapi#21: ldap_set_option(LDAP_OPT_TIMEOUT, 1) on
    OpenLDAP returns -1
  * Fixed quanah/net-ldapapi#28: Server control responses get eaten after
    a NULL character in the berval
  * Fixed quanah/net-ldapapi#30: ldap_search_ext() and ldap_search_ext_s()
    segfault when used with timeout
  * Fixed quanah/net-ldapapi#31: ldap_result() and ldap_url_search_st()
    timeout parameters have a granularity of 1 second
  * Fixed quanah/net-ldapapi#40: Server control requests get eaten after a
    NULL character in the berval
  * Correct merge problem with POD error.
  * Update standards version to 3.9.8 (no changes required).

[dgit import package libnet-ldapapi-perl 3.0.4-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant