Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 313667 Details for
Bug 418311
dev-lua/lualdap-1.1 - Simple interface from Lua to an LDAP client
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
lualdap-1.1.0-openldap-2.3.patch
lualdap-1.1.0-openldap-2.3.patch (text/plain), 2.06 KB, created by
Dennis Schridde
on 2012-05-31 02:15:05 UTC
(
hide
)
Description:
lualdap-1.1.0-openldap-2.3.patch
Filename:
MIME Type:
Creator:
Dennis Schridde
Created:
2012-05-31 02:15:05 UTC
Size:
2.06 KB
patch
obsolete
>--- lualdap-1.1.0/src/lualdap.c.orig 2012-05-31 03:32:44.337987490 +0200 >+++ lualdap-1.1.0/src/lualdap.c 2012-05-31 03:33:35.515987505 +0200 >@@ -461,7 +461,11 @@ > luaL_argcheck(L, conn!=NULL, 1, LUALDAP_PREFIX"LDAP connection expected"); > if (conn->ld == NULL) /* already closed */ > return 0; >+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 >+ ldap_unbind_ext (conn->ld, NULL, NULL); >+#else > ldap_unbind (conn->ld); >+#endif > conn->ld = NULL; > lua_pushnumber (L, 1); > return 1; >@@ -939,13 +947,27 @@ > const char *password = luaL_optstring (L, 3, NULL); > int use_tls = lua_toboolean (L, 4); > conn_data *conn = (conn_data *)lua_newuserdata (L, sizeof(conn_data)); >+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 >+ struct berval cred = { 0, NULL }; >+ char *host_with_schema = NULL; >+#endif > int err; > > /* Initialize */ > lualdap_setmeta (L, LUALDAP_CONNECTION_METATABLE); > conn->version = 0; >+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 >+ host_with_schema = malloc(strlen(host) + 8); >+ strcpy(host_with_schema, "ldap://"); >+ strcat(host_with_schema, host); >+ err = ldap_initialize(&conn->ld, host_with_schema); >+ free(host_with_schema); >+ host_with_schema = NULL; >+ if (err != LDAP_SUCCESS) >+#else > conn->ld = ldap_init (host, LDAP_PORT); > if (conn->ld == NULL) >+#endif > return faildirect(L,LUALDAP_PREFIX"Error connecting to server"); > /* Set protocol version */ > conn->version = LDAP_VERSION3; >@@ -959,7 +981,17 @@ > return faildirect (L, ldap_err2string (rc)); > } > /* Bind to a server */ >+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 >+ cred.bv_len = strlen(password); >+ cred.bv_val = malloc(cred.bv_len+1); >+ strcpy(cred.bv_val, password); >+ err = ldap_sasl_bind_s (conn->ld, who, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); >+ free(cred.bv_val); >+ cred.bv_len = 0; >+ cred.bv_val = NULL; >+#else > err = ldap_bind_s (conn->ld, who, password, LDAP_AUTH_SIMPLE); >+#endif > if (err != LDAP_SUCCESS) > return faildirect (L, ldap_err2string (err)); >
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 418311
:
313645
|
313653
|
313655
|
313657
|
313659
|
313663
|
313665
| 313667