Skip to content

Fix SASL get/set options on big endian platforms #416

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

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

tiran
Copy link
Member

@tiran tiran commented Jun 28, 2021

The options OPT_X_SASL_SSF_MIN, OPT_X_SASL_SSF_MAX, and OPT_X_SASL_SSF
take *ber_len_t as input and output arguments. ber_len_t is defined as
unsigned long:

    /* LBER lengths (32 bits or larger) */
    #define LBER_LEN_T long

    typedef unsigned LBER_LEN_T ber_len_t;

Wrong type handling is causing issues on big endian platforms.

Signed-off-by: Christian Heimes cheimes@redhat.com

@tiran tiran added the bug label Jun 28, 2021
@tiran tiran force-pushed the sasl_endian branch 2 times, most recently from 30fb0a8 to 17a9c13 Compare June 29, 2021 16:10
@tiran tiran marked this pull request as ready for review June 29, 2021 16:10
@encukou
Copy link
Member

encukou commented Jul 1, 2021

LGTM.
Could you rebase to run with the latest CI config?
Also, add yourself to https://github.com/python-ldap/python-ldap/blob/master/LICENCE.MIT if you wish – I figure it's better if you do that explicitly.

The options OPT_X_SASL_SSF_MIN, OPT_X_SASL_SSF_MAX, and OPT_X_SASL_SSF
take *ber_len_t as input and output arguments. ber_len_t is defined as
unsigned long:

```
    /* LBER lengths (32 bits or larger) */
    #define LBER_LEN_T long

    typedef unsigned LBER_LEN_T ber_len_t;
```

Wrong type handling is causing issues on big endian platforms.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Copy link
Contributor

@droideck droideck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too!

@encukou encukou merged commit 84bbf5e into python-ldap:master Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants