Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 155191 Details for
Bug 240904
libuser can't use SASL/GSSAPI with LDAP
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Enable Selection of SASL Mechanisms
libuser-0.56.2-sasl_mechs.patch (text/plain), 3.88 KB, created by
Simo Sorce
on 2007-05-22 19:17:52 UTC
(
hide
)
Description:
Enable Selection of SASL Mechanisms
Filename:
MIME Type:
Creator:
Simo Sorce
Created:
2007-05-22 19:17:52 UTC
Size:
3.88 KB
patch
obsolete
>diff -ur libuser-0.56.2.orig/modules/ldap.c libuser-0.56.2/modules/ldap.c >--- libuser-0.56.2.orig/modules/ldap.c 2007-02-17 07:33:51.000000000 -0500 >+++ libuser-0.56.2/modules/ldap.c 2007-05-21 21:23:40.000000000 -0400 >@@ -146,6 +146,7 @@ > struct lu_module *module; /* The module's structure. */ > struct lu_prompt prompts[LU_LDAP_MAX]; /* Questions and answers. */ > gboolean bind_simple, bind_sasl; /* What kind of bind to use. */ >+ const char *sasl_mechanism; /* what sasl mechanism to use. */ > const char *user_branch, *group_branch; /* Cached config values */ > char **mapped_user_attributes, **mapped_group_attributes; > LDAP *ldap; /* The connection. */ >@@ -262,7 +263,14 @@ > g_print("Sending SASL auth user `%s'.\n", (char*)interact_data[i].result); > #endif > break; >+ case SASL_CB_GETREALM: >+ interact_data[i].result = ""; /* always tell sasl to find it on its own */ >+ interact_data[i].len = strlen(interact_data[i].result); >+ break; > default: >+#ifdef DEBUG >+ g_print("Unhandled SASL Intreractive option `%d'.\n", interact_data[i].id); >+#endif > retval = LDAP_OTHER; > } > } >@@ -330,15 +338,18 @@ > binddn = NULL; > } > if (context->bind_sasl) { >+ >+ >+ > /* Try to bind using SASL, and if that fails... */ > if (binddn != NULL) { > #ifdef DEBUG > g_print("Attempting SASL bind to `%s'.\n", binddn); > #endif >- ret = ldap_sasl_interactive_bind_s(ldap, binddn, NULL, >+ ret = ldap_sasl_interactive_bind_s(ldap, binddn, >+ context->sasl_mechanism, > NULL, NULL, >- LDAP_SASL_INTERACTIVE | >- LDAP_SASL_QUIET, >+ LDAP_SASL_AUTOMATIC, > interact, > context); > if (ret != LDAP_SUCCESS) { >@@ -353,9 +364,9 @@ > #endif > ret = ldap_sasl_interactive_bind_s(ldap, > generated_binddn, >- NULL, NULL, NULL, >- LDAP_SASL_INTERACTIVE | >- LDAP_SASL_QUIET, >+ context->sasl_mechanism, >+ NULL, NULL, >+ LDAP_SASL_AUTOMATIC, > interact, context); > if (ret != LDAP_SUCCESS > && first_failure == LDAP_SUCCESS) { >@@ -2428,7 +2439,6 @@ > struct lu_module *ret; > struct lu_ldap_context *ctx; > struct lu_prompt prompts[G_N_ELEMENTS(ctx->prompts)]; >- char *user; > const char *bind_type; > char **bind_types; > size_t i; >@@ -2465,13 +2475,11 @@ > ctx->prompts[LU_LDAP_PASSWORD].prompt = N_("LDAP Bind Password"); > ctx->prompts[LU_LDAP_PASSWORD].visible = FALSE; > >- user = getuser(); >- > ctx->prompts[LU_LDAP_AUTHUSER].key = "ldap/user"; > ctx->prompts[LU_LDAP_AUTHUSER].prompt = N_("LDAP SASL User"); > ctx->prompts[LU_LDAP_AUTHUSER].visible = TRUE; > ctx->prompts[LU_LDAP_AUTHUSER].default_value = >- lu_cfg_read_single(context, "ldap/user", user); >+ lu_cfg_read_single(context, "ldap/user", ""); > > ctx->prompts[LU_LDAP_AUTHZUSER].key = "ldap/authuser"; > ctx->prompts[LU_LDAP_AUTHZUSER].prompt = >@@ -2480,15 +2488,10 @@ > ctx->prompts[LU_LDAP_AUTHZUSER].default_value = > lu_cfg_read_single(context, "ldap/authuser", ""); > >- if (user) { >- free(user); >- user = NULL; >- } >- > /* Try to be somewhat smart and allow the user to specify which bind > * type to use, which should prevent us from asking for information > * we can be certain we don't have a use for. */ >- bind_type = lu_cfg_read_single(context, "ldap/bindtype", "simple,sasl"); >+ bind_type = lu_cfg_read_single(context, "ldap/bindtype", "simple"); > bind_types = g_strsplit(bind_type, ",", 0); > for (i = 0; (bind_types != NULL) && (bind_types[i] != NULL); i++) { > if (g_ascii_strcasecmp(bind_types[i], "simple") == 0) { >@@ -2496,6 +2499,11 @@ > } else > if (g_ascii_strcasecmp(bind_types[i], "sasl") == 0) { > ctx->bind_sasl = TRUE; >+ ctx->sasl_mechanism = NULL; >+ } >+ if (g_ascii_strncasecmp(bind_types[i], "sasl/", 5) == 0) { >+ ctx->bind_sasl = TRUE; >+ ctx->sasl_mechanism = g_strdup(&bind_types[i][5]); > } > } > g_strfreev(bind_types); >Only in libuser-0.56.2/modules: ldap.c.orig
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 240904
: 155191