chainsaw 15/02/24 10:05:41
Added: lualdap-1.1.0-openldap-2.3.patch
lualdap-1.1.0-lua-5.1.patch
lualdap-1.1.0-destdir.patch
Log:
Initial commit. Ebuild and all patches by Dennis "devurandom" Schridde in bug
#418311.
(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key
0xB5058F9A)
Revision Changes Path
1.1 dev-lua/lualdap/files/lualdap-1.1.0-openldap-2.3.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-openldap-2.3.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-openldap-2.3.patch?rev=1.1&content-type=text/plain
Index: lualdap-1.1.0-openldap-2.3.patch
===================================================================
--- 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));
1.1 dev-lua/lualdap/files/lualdap-1.1.0-lua-5.1.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-lua-5.1.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-lua-5.1.patch?rev=1.1&content-type=text/plain
Index: lualdap-1.1.0-lua-5.1.patch
===================================================================
--- lualdap-1.1.0/src/lualdap.c.orig 2012-05-31 02:16:27.677987500 +0200
+++ lualdap-1.1.0/src/lualdap.c 2012-05-31 02:19:57.963987490 +0200
@@ -887,7 +887,11 @@
return 0;
/* define methods */
+#if LUA_VERSION_NUM >= 501
+ luaL_register (L, NULL, methods);
+#else
luaL_openlib (L, NULL, methods, 0);
+#endif
/* define metamethods */
lua_pushliteral (L, "__gc");
@@ -993,7 +997,11 @@
};
lualdap_createmeta (L);
+#if LUA_VERSION_NUM >= 501
+ luaL_register (L, LUALDAP_TABLENAME, lualdap);
+#else
luaL_openlib (L, LUALDAP_TABLENAME, lualdap, 0);
+#endif
set_info (L);
return 1;
1.1 dev-lua/lualdap/files/lualdap-1.1.0-destdir.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-destdir.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-destdir.patch?rev=1.1&content-type=text/plain
Index: lualdap-1.1.0-destdir.patch
===================================================================
--- lualdap-1.1.0/Makefile.orig 2012-05-31 01:14:53.773987493 +0200
+++ lualdap-1.1.0/Makefile 2012-05-31 01:15:46.539987507 +0200
@@ -20,9 +20,9 @@
$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
install: src/$(LIBNAME)
- mkdir -p $(LUA_LIBDIR)
- cp src/$(LIBNAME) $(LUA_LIBDIR)
- cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
+ mkdir -p $(DESTDIR)$(LUA_LIBDIR)
+ cp src/$(LIBNAME) $(DESTDIR)$(LUA_LIBDIR)
+ cd $(DESTDIR)$(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
clean:
rm -f $(OBJS) src/$(LIBNAME)