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