1 |
chainsaw 15/02/24 10:05:41 |
2 |
|
3 |
Added: lualdap-1.1.0-openldap-2.3.patch |
4 |
lualdap-1.1.0-lua-5.1.patch |
5 |
lualdap-1.1.0-destdir.patch |
6 |
Log: |
7 |
Initial commit. Ebuild and all patches by Dennis "devurandom" Schridde in bug #418311. |
8 |
|
9 |
(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key 0xB5058F9A) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 dev-lua/lualdap/files/lualdap-1.1.0-openldap-2.3.patch |
13 |
|
14 |
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 |
15 |
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 |
16 |
|
17 |
Index: lualdap-1.1.0-openldap-2.3.patch |
18 |
=================================================================== |
19 |
--- lualdap-1.1.0/src/lualdap.c.orig 2012-05-31 03:32:44.337987490 +0200 |
20 |
+++ lualdap-1.1.0/src/lualdap.c 2012-05-31 03:33:35.515987505 +0200 |
21 |
@@ -461,7 +461,11 @@ |
22 |
luaL_argcheck(L, conn!=NULL, 1, LUALDAP_PREFIX"LDAP connection expected"); |
23 |
if (conn->ld == NULL) /* already closed */ |
24 |
return 0; |
25 |
+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 |
26 |
+ ldap_unbind_ext (conn->ld, NULL, NULL); |
27 |
+#else |
28 |
ldap_unbind (conn->ld); |
29 |
+#endif |
30 |
conn->ld = NULL; |
31 |
lua_pushnumber (L, 1); |
32 |
return 1; |
33 |
@@ -939,13 +947,27 @@ |
34 |
const char *password = luaL_optstring (L, 3, NULL); |
35 |
int use_tls = lua_toboolean (L, 4); |
36 |
conn_data *conn = (conn_data *)lua_newuserdata (L, sizeof(conn_data)); |
37 |
+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 |
38 |
+ struct berval cred = { 0, NULL }; |
39 |
+ char *host_with_schema = NULL; |
40 |
+#endif |
41 |
int err; |
42 |
|
43 |
/* Initialize */ |
44 |
lualdap_setmeta (L, LUALDAP_CONNECTION_METATABLE); |
45 |
conn->version = 0; |
46 |
+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 |
47 |
+ host_with_schema = malloc(strlen(host) + 8); |
48 |
+ strcpy(host_with_schema, "ldap://"); |
49 |
+ strcat(host_with_schema, host); |
50 |
+ err = ldap_initialize(&conn->ld, host_with_schema); |
51 |
+ free(host_with_schema); |
52 |
+ host_with_schema = NULL; |
53 |
+ if (err != LDAP_SUCCESS) |
54 |
+#else |
55 |
conn->ld = ldap_init (host, LDAP_PORT); |
56 |
if (conn->ld == NULL) |
57 |
+#endif |
58 |
return faildirect(L,LUALDAP_PREFIX"Error connecting to server"); |
59 |
/* Set protocol version */ |
60 |
conn->version = LDAP_VERSION3; |
61 |
@@ -959,7 +981,17 @@ |
62 |
return faildirect (L, ldap_err2string (rc)); |
63 |
} |
64 |
/* Bind to a server */ |
65 |
+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && LDAP_API_FEATURE_X_OPENLDAP >= 20300 |
66 |
+ cred.bv_len = strlen(password); |
67 |
+ cred.bv_val = malloc(cred.bv_len+1); |
68 |
+ strcpy(cred.bv_val, password); |
69 |
+ err = ldap_sasl_bind_s (conn->ld, who, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); |
70 |
+ free(cred.bv_val); |
71 |
+ cred.bv_len = 0; |
72 |
+ cred.bv_val = NULL; |
73 |
+#else |
74 |
err = ldap_bind_s (conn->ld, who, password, LDAP_AUTH_SIMPLE); |
75 |
+#endif |
76 |
if (err != LDAP_SUCCESS) |
77 |
return faildirect (L, ldap_err2string (err)); |
78 |
|
79 |
|
80 |
|
81 |
|
82 |
1.1 dev-lua/lualdap/files/lualdap-1.1.0-lua-5.1.patch |
83 |
|
84 |
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 |
85 |
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 |
86 |
|
87 |
Index: lualdap-1.1.0-lua-5.1.patch |
88 |
=================================================================== |
89 |
--- lualdap-1.1.0/src/lualdap.c.orig 2012-05-31 02:16:27.677987500 +0200 |
90 |
+++ lualdap-1.1.0/src/lualdap.c 2012-05-31 02:19:57.963987490 +0200 |
91 |
@@ -887,7 +887,11 @@ |
92 |
return 0; |
93 |
|
94 |
/* define methods */ |
95 |
+#if LUA_VERSION_NUM >= 501 |
96 |
+ luaL_register (L, NULL, methods); |
97 |
+#else |
98 |
luaL_openlib (L, NULL, methods, 0); |
99 |
+#endif |
100 |
|
101 |
/* define metamethods */ |
102 |
lua_pushliteral (L, "__gc"); |
103 |
@@ -993,7 +997,11 @@ |
104 |
}; |
105 |
|
106 |
lualdap_createmeta (L); |
107 |
+#if LUA_VERSION_NUM >= 501 |
108 |
+ luaL_register (L, LUALDAP_TABLENAME, lualdap); |
109 |
+#else |
110 |
luaL_openlib (L, LUALDAP_TABLENAME, lualdap, 0); |
111 |
+#endif |
112 |
set_info (L); |
113 |
|
114 |
return 1; |
115 |
|
116 |
|
117 |
|
118 |
1.1 dev-lua/lualdap/files/lualdap-1.1.0-destdir.patch |
119 |
|
120 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lua/lualdap/files/lualdap-1.1.0-destdir.patch?rev=1.1&view=markup |
121 |
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 |
122 |
|
123 |
Index: lualdap-1.1.0-destdir.patch |
124 |
=================================================================== |
125 |
--- lualdap-1.1.0/Makefile.orig 2012-05-31 01:14:53.773987493 +0200 |
126 |
+++ lualdap-1.1.0/Makefile 2012-05-31 01:15:46.539987507 +0200 |
127 |
@@ -20,9 +20,9 @@ |
128 |
$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c |
129 |
|
130 |
install: src/$(LIBNAME) |
131 |
- mkdir -p $(LUA_LIBDIR) |
132 |
- cp src/$(LIBNAME) $(LUA_LIBDIR) |
133 |
- cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so |
134 |
+ mkdir -p $(DESTDIR)$(LUA_LIBDIR) |
135 |
+ cp src/$(LIBNAME) $(DESTDIR)$(LUA_LIBDIR) |
136 |
+ cd $(DESTDIR)$(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so |
137 |
|
138 |
clean: |
139 |
rm -f $(OBJS) src/$(LIBNAME) |