1 diff -ruN lualdap-1.0.1.orig/config lualdap-1.0.1/config |
|
2 --- lualdap-1.0.1.orig/config 2005-12-26 22:26:03.000000000 +0100 |
|
3 +++ lualdap-1.0.1/config 2007-11-02 05:39:59.000000000 +0100 |
|
4 @@ -1,10 +1,10 @@ |
|
5 # Installation directories |
|
6 # System's libraries directory (where binary libraries are installed) |
|
7 -LUA_LIBDIR= /usr/local/lib/lua/5.0 |
|
8 +LUA_LIBDIR= /usr/lib/lua/5.1 |
|
9 # Lua includes directory |
|
10 -LUA_INC= /usr/local/include |
|
11 +LUA_INC= /usr/include |
|
12 # OpenLDAP includes directory |
|
13 -OPENLDAP_INC= /usr/local/include |
|
14 +OPENLDAP_INC= /usr/include |
|
15 # OpenLDAP library (an optional directory can be specified with -L<dir>) |
|
16 OPENLDAP_LIB= -lldap |
|
17 |
|
18 diff -ruN lualdap-1.0.1.orig/Makefile lualdap-1.0.1/Makefile |
|
19 --- lualdap-1.0.1.orig/Makefile 2005-12-26 22:26:03.000000000 +0100 |
|
20 +++ lualdap-1.0.1/Makefile 2007-11-02 05:41:57.000000000 +0100 |
|
21 @@ -6,7 +6,7 @@ |
|
22 |
|
23 include $(CONFIG) |
|
24 |
|
25 -OBJS= src/lualdap.o $(COMPAT_DIR)/compat-5.1.o |
|
26 +OBJS= src/lualdap.o |
|
27 |
|
28 |
|
29 src/$(LIBNAME): $(OBJS) |
|
30 @@ -16,9 +16,9 @@ |
|
31 $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c |
|
32 |
|
33 install: src/$(LIBNAME) |
|
34 - mkdir -p $(LUA_LIBDIR) |
|
35 - cp src/$(LIBNAME) $(LUA_LIBDIR) |
|
36 - cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so |
|
37 + mkdir -p $(DESTDIR)$(LUA_LIBDIR) |
|
38 + cp src/$(LIBNAME) $(DESTDIR)$(LUA_LIBDIR) |
|
39 + cd $(DESTDIR)$(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so |
|
40 |
|
41 clean: |
|
42 rm -f $(OBJS) src/$(LIBNAME) |
|
43 diff -ruN lualdap-1.0.1.orig/src/lualdap.c lualdap-1.0.1/src/lualdap.c |
|
44 --- lualdap-1.0.1.orig/src/lualdap.c 2006-04-04 22:11:51.000000000 +0200 |
|
45 +++ lualdap-1.0.1/src/lualdap.c 2007-11-02 05:46:26.000000000 +0100 |
|
46 @@ -16,7 +16,6 @@ |
|
47 |
|
48 #include "lua.h" |
|
49 #include "lauxlib.h" |
|
50 -#include "compat-5.1.h" |
|
51 |
|
52 |
|
53 #define LUALDAP_PREFIX "LuaLDAP: " |
|
54 @@ -462,7 +461,7 @@ |
|
55 */ |
|
56 static int lualdap_add (lua_State *L) { |
|
57 conn_data *conn = getconnection (L); |
|
58 - const char *dn = luaL_check_string (L, 2); |
|
59 + const char *dn = luaL_checkstring (L, 2); |
|
60 attrs_data attrs; |
|
61 int rc, msgid; |
|
62 A_init (&attrs); |
|
63 @@ -484,11 +483,11 @@ |
|
64 */ |
|
65 static int lualdap_compare (lua_State *L) { |
|
66 conn_data *conn = getconnection (L); |
|
67 - const char *dn = luaL_check_string (L, 2); |
|
68 - const char *attr = luaL_check_string (L, 3); |
|
69 + const char *dn = luaL_checkstring (L, 2); |
|
70 + const char *attr = luaL_checkstring (L, 3); |
|
71 BerValue bvalue; |
|
72 int rc, msgid; |
|
73 - bvalue.bv_val = (char *)luaL_check_string (L, 4); |
|
74 + bvalue.bv_val = (char *)luaL_checkstring (L, 4); |
|
75 bvalue.bv_len = lua_strlen (L, 4); |
|
76 rc = ldap_compare_ext (conn->ld, dn, attr, &bvalue, NULL, NULL, &msgid); |
|
77 return create_future (L, rc, 1, msgid, LDAP_RES_COMPARE); |
|
78 @@ -503,7 +502,7 @@ |
|
79 */ |
|
80 static int lualdap_delete (lua_State *L) { |
|
81 conn_data *conn = getconnection (L); |
|
82 - const char *dn = luaL_check_string (L, 2); |
|
83 + const char *dn = luaL_checkstring (L, 2); |
|
84 int rc, msgid; |
|
85 rc = ldap_delete_ext (conn->ld, dn, NULL, NULL, &msgid); |
|
86 return create_future (L, rc, 1, msgid, LDAP_RES_DELETE); |
|
87 @@ -538,7 +537,7 @@ |
|
88 */ |
|
89 static int lualdap_modify (lua_State *L) { |
|
90 conn_data *conn = getconnection (L); |
|
91 - const char *dn = luaL_check_string (L, 2); |
|
92 + const char *dn = luaL_checkstring (L, 2); |
|
93 attrs_data attrs; |
|
94 int rc, msgid, param = 3; |
|
95 A_init (&attrs); |
|
96 @@ -564,8 +563,8 @@ |
|
97 */ |
|
98 static int lualdap_rename (lua_State *L) { |
|
99 conn_data *conn = getconnection (L); |
|
100 - const char *dn = luaL_check_string (L, 2); |
|
101 - const char *rdn = luaL_check_string (L, 3); |
|
102 + const char *dn = luaL_checkstring (L, 2); |
|
103 + const char *rdn = luaL_checkstring (L, 3); |
|
104 const char *par = luaL_optlstring (L, 4, NULL, NULL); |
|
105 const int del = luaL_optnumber (L, 5, 0); |
|
106 int msgid; |
|
107 @@ -914,7 +913,7 @@ |
|
108 ** @return #1 Userdata with connection structure. |
|
109 */ |
|
110 static int lualdap_open_simple (lua_State *L) { |
|
111 - const char *host = luaL_check_string (L, 1); |
|
112 + const char *host = luaL_checkstring (L, 1); |
|
113 const char *who = luaL_optstring (L, 2, NULL); |
|
114 const char *password = luaL_optstring (L, 3, NULL); |
|
115 int use_tls = lua_toboolean (L, 4); |
|