summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2009-04-16 14:53:36 +0200
committerKai Blin <kai@samba.org>2009-05-30 09:17:37 +0200
commit57ea909b327812479e9c61f0398f257023a504b4 (patch)
treeaae6e4514a2ff09738d583ed4a4a0a640a8f0702
parent590a3afc8a22658075235b5b5eb30e977999b3a8 (diff)
downloadsamba-57ea909b327812479e9c61f0398f257023a504b4.tar.gz
samba-57ea909b327812479e9c61f0398f257023a504b4.tar.bz2
samba-57ea909b327812479e9c61f0398f257023a504b4.zip
libwbclient: Add async call framework.
-rw-r--r--lib/async_req/async_sock.c4
-rw-r--r--lib/async_req/config.mk1
-rw-r--r--nsswitch/config.mk6
-rw-r--r--nsswitch/libwbclient/config.mk15
-rw-r--r--nsswitch/libwbclient/libwbclient.h1
-rw-r--r--nsswitch/libwbclient/wb_reqtrans.c (renamed from source3/lib/wb_reqtrans.c)18
-rw-r--r--nsswitch/libwbclient/wbc_async.c (renamed from source3/lib/wbclient.c)13
-rw-r--r--nsswitch/libwbclient/wbc_async.h (renamed from source3/include/wbc_async.h)4
-rw-r--r--nsswitch/libwbclient/wbclient.c2
-rw-r--r--nsswitch/libwbclient/wbclient_internal.h1
-rw-r--r--nsswitch/winbind_struct_protocol.h5
-rw-r--r--source3/Makefile.in10
-rw-r--r--source3/samba4.mk1
-rw-r--r--source3/torture/torture.c2
-rw-r--r--source4/Makefile1
-rw-r--r--source4/libcli/wbclient/config.mk4
-rw-r--r--source4/main.mk1
-rw-r--r--source4/ntvfs/posix/config.mk2
-rw-r--r--source4/rpc_server/config.mk2
19 files changed, 76 insertions, 17 deletions
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index 598a126467..09eec10fc5 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -426,7 +426,7 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde,
to_write += state->iov[i].iov_len;
}
- written = sys_writev(state->fd, state->iov, state->count);
+ written = writev(state->fd, state->iov, state->count);
if (written == -1) {
tevent_req_error(req, errno);
return;
@@ -570,7 +570,7 @@ static void read_packet_handler(struct tevent_context *ev,
return;
}
- tmp = TALLOC_REALLOC_ARRAY(state, state->buf, uint8_t, total+more);
+ tmp = talloc_realloc(state, state->buf, uint8_t, total+more);
if (tevent_req_nomem(tmp, req)) {
return;
}
diff --git a/lib/async_req/config.mk b/lib/async_req/config.mk
index bf0fd6a2db..1f4b557ce4 100644
--- a/lib/async_req/config.mk
+++ b/lib/async_req/config.mk
@@ -1,3 +1,4 @@
[SUBSYSTEM::LIBASYNC_REQ]
+PUBLIC_DEPENDENCIES = LIBREPLACE_NETWORK
LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_sock.o)
diff --git a/nsswitch/config.mk b/nsswitch/config.mk
index 3a4f054d1f..264032e530 100644
--- a/nsswitch/config.mk
+++ b/nsswitch/config.mk
@@ -26,7 +26,11 @@ PRIVATE_DEPENDENCIES = \
LIBCLI_AUTH \
LIBPOPT \
POPT_SAMBA \
- LIBWINBIND-CLIENT
+ LIBWINBIND-CLIENT \
+ LIBWBCLIENT \
+ LIBTEVENT \
+ UTIL_TEVENT \
+ LIBASYNC_REQ
# End BINARY nsstest
#################################
diff --git a/nsswitch/libwbclient/config.mk b/nsswitch/libwbclient/config.mk
new file mode 100644
index 0000000000..ffdab159f8
--- /dev/null
+++ b/nsswitch/libwbclient/config.mk
@@ -0,0 +1,15 @@
+[SUBSYSTEM::LIBWBCLIENT]
+PUBLIC_DEPENDENCIES = LIBASYNC_REQ \
+ LIBTEVENT \
+ LIBTALLOC \
+ UTIL_TEVENT
+
+LIBWBCLIENT_OBJ_FILES = $(addprefix $(libwbclientsrcdir)/, wbc_async.o \
+ wbc_guid.o \
+ wbc_idmap.o \
+ wbclient.o \
+ wbc_pam.o \
+ wbc_pwd.o \
+ wbc_sid.o \
+ wbc_util.o \
+ wb_reqtrans.o )
diff --git a/nsswitch/libwbclient/libwbclient.h b/nsswitch/libwbclient/libwbclient.h
index 74cba7e796..5a25cf462c 100644
--- a/nsswitch/libwbclient/libwbclient.h
+++ b/nsswitch/libwbclient/libwbclient.h
@@ -36,6 +36,7 @@
/* Public headers */
#include "wbclient.h"
+#include "wbc_async.h"
/* Private headers */
diff --git a/source3/lib/wb_reqtrans.c b/nsswitch/libwbclient/wb_reqtrans.c
index 7088925927..84ed7198f2 100644
--- a/source3/lib/wb_reqtrans.c
+++ b/nsswitch/libwbclient/wb_reqtrans.c
@@ -23,11 +23,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
-#include "wbc_async.h"
-
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/network.h"
+#include <talloc.h>
+#include <tevent.h>
+struct fd_event;
+struct event_context;
+#include "lib/async_req/async_sock.h"
+#include "lib/util/tevent_unix.h"
+#include "nsswitch/winbind_struct_protocol.h"
+#include "nsswitch/libwbclient/wbclient.h"
+#include "nsswitch/libwbclient/wbc_async.h"
+
+#ifdef DBGC_CLASS
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
+#endif
struct req_read_state {
struct winbindd_request *wb_req;
diff --git a/source3/lib/wbclient.c b/nsswitch/libwbclient/wbc_async.c
index d0070ea349..141c9816aa 100644
--- a/source3/lib/wbclient.c
+++ b/nsswitch/libwbclient/wbc_async.c
@@ -21,8 +21,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
-#include "wbc_async.h"
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/network.h"
+#include <talloc.h>
+#include <tevent.h>
+struct fd_event;
+struct event_context;
+#include "lib/async_req/async_sock.h"
+#include "nsswitch/winbind_struct_protocol.h"
+#include "nsswitch/libwbclient/wbclient.h"
+#include "nsswitch/libwbclient/wbc_async.h"
wbcErr map_wbc_err_from_errno(int error)
{
diff --git a/source3/include/wbc_async.h b/nsswitch/libwbclient/wbc_async.h
index 96c5f8c348..a2e0eed448 100644
--- a/source3/include/wbc_async.h
+++ b/nsswitch/libwbclient/wbc_async.h
@@ -24,9 +24,13 @@
#ifndef _WBC_ASYNC_H_
#define _WBC_ASYNC_H_
+#include <talloc.h>
+#include <tevent.h>
#include "nsswitch/libwbclient/wbclient.h"
struct wb_context;
+struct winbindd_request;
+struct winbindd_response;
struct tevent_req *wb_trans_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
diff --git a/nsswitch/libwbclient/wbclient.c b/nsswitch/libwbclient/wbclient.c
index f5c72315f2..77b7e12d04 100644
--- a/nsswitch/libwbclient/wbclient.c
+++ b/nsswitch/libwbclient/wbclient.c
@@ -22,6 +22,8 @@
/* Required Headers */
+#include "lib/talloc/talloc.h"
+#include "lib/tevent/tevent.h"
#include "libwbclient.h"
/* From wb_common.c */
diff --git a/nsswitch/libwbclient/wbclient_internal.h b/nsswitch/libwbclient/wbclient_internal.h
index fc03c5409b..2d103ab3df 100644
--- a/nsswitch/libwbclient/wbclient_internal.h
+++ b/nsswitch/libwbclient/wbclient_internal.h
@@ -28,5 +28,4 @@ wbcErr wbcRequestResponse(int cmd,
struct winbindd_request *request,
struct winbindd_response *response);
-
#endif /* _WBCLIENT_INTERNAL_H */
diff --git a/nsswitch/winbind_struct_protocol.h b/nsswitch/winbind_struct_protocol.h
index 11b2069c3a..1785c30906 100644
--- a/nsswitch/winbind_struct_protocol.h
+++ b/nsswitch/winbind_struct_protocol.h
@@ -15,6 +15,11 @@
#define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0)
#endif
+#ifndef FSTRING_LEN
+#define FSTRING_LEN 256
+typedef char fstring[FSTRING_LEN];
+#endif
+
#ifndef _WINBINDD_NTDOM_H
#define _WINBINDD_NTDOM_H
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 72fce60faa..613e127770 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -992,7 +992,7 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/uta
SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
$(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
- lib/wb_reqtrans.o lib/wbclient.o \
+ @LIBWBCLIENT_STATIC@ \
$(LIBNDR_GEN_OBJ0)
MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) \
@@ -1876,7 +1876,10 @@ LIBWBCLIENT_OBJ0 = ../nsswitch/libwbclient/wbclient.o \
../nsswitch/libwbclient/wbc_idmap.o \
../nsswitch/libwbclient/wbc_sid.o \
../nsswitch/libwbclient/wbc_guid.o \
- ../nsswitch/libwbclient/wbc_pam.o
+ ../nsswitch/libwbclient/wbc_pam.o \
+ ../nsswitch/libwbclient/wb_reqtrans.o \
+ ../nsswitch/libwbclient/wbc_async.o
+
LIBWBCLIENT_OBJ = $(LIBWBCLIENT_OBJ0) \
$(WBCOMMON_OBJ) \
$(LIBREPLACE_OBJ)
@@ -1887,7 +1890,8 @@ LIBWBCLIENT_SHARED_TARGET_SONAME=$(LIBWBCLIENT_SHARED_TARGET).$(LIBWBCLIENT_SOVE
LIBWBCLIENT_STATIC_TARGET=@LIBWBCLIENT_STATIC_TARGET@
LIBWBCLIENT=@LIBWBCLIENT_STATIC@ @LIBWBCLIENT_SHARED@
LIBWBCLIENT_SYMS=$(srcdir)/exports/libwbclient.@SYMSEXT@
-LIBWBCLIENT_HEADERS=$(srcdir)/../nsswitch/libwbclient/wbclient.h
+LIBWBCLIENT_HEADERS=$(srcdir)/../nsswitch/libwbclient/wbclient.h \
+ $(srcdir)/../nsswitch/libwbclient/wbc_async.h
$(LIBWBCLIENT_SYMS): $(LIBWBCLIENT_HEADERS)
@$(MKSYMS_SH) $(AWK) $@ $(LIBWBCLIENT_HEADERS)
diff --git a/source3/samba4.mk b/source3/samba4.mk
index 3f661bdd14..e63a8453c0 100644
--- a/source3/samba4.mk
+++ b/source3/samba4.mk
@@ -74,6 +74,7 @@ clustersrcdir := $(samba4srcdir)/cluster
libnetsrcdir := $(samba4srcdir)/libnet
authsrcdir := $(samba4srcdir)/auth
nsswitchsrcdir := $(samba4srcdir)/../nsswitch
+libwbclientsrcdir := $(nsswitchsrcdir)/libwbclient
libsrcdir := $(samba4srcdir)/lib
libsocketsrcdir := $(samba4srcdir)/lib/socket
libcharsetsrcdir := $(samba4srcdir)/../lib/util/charset
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index cfd3d640f9..30e7e8cbc5 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -18,7 +18,7 @@
*/
#include "includes.h"
-#include "wbc_async.h"
+#include "nsswitch/libwbclient/wbc_async.h"
extern char *optarg;
extern int optind;
diff --git a/source4/Makefile b/source4/Makefile
index 7bc48b9fe4..2a3ad2def1 100644
--- a/source4/Makefile
+++ b/source4/Makefile
@@ -58,6 +58,7 @@ clustersrcdir := cluster
libnetsrcdir := libnet
authsrcdir := auth
nsswitchsrcdir := ../nsswitch
+libwbclientsrcdir := ../nsswitch/libwbclient
libsrcdir := lib
libsocketsrcdir := lib/socket
libcharsetsrcdir := ../lib/util/charset
diff --git a/source4/libcli/wbclient/config.mk b/source4/libcli/wbclient/config.mk
index 00df5dbb22..af4d3eff82 100644
--- a/source4/libcli/wbclient/config.mk
+++ b/source4/libcli/wbclient/config.mk
@@ -1,5 +1,5 @@
-[SUBSYSTEM::LIBWBCLIENT]
+[SUBSYSTEM::LIBWBCLIENT_OLD]
PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBEVENTS
PRIVATE_DEPENDENCIES = NDR_WINBIND MESSAGING
-LIBWBCLIENT_OBJ_FILES = $(libclisrcdir)/wbclient/wbclient.o
+LIBWBCLIENT_OLD_OBJ_FILES = $(libclisrcdir)/wbclient/wbclient.o
diff --git a/source4/main.mk b/source4/main.mk
index 2e74ba9a5b..b4a82017c8 100644
--- a/source4/main.mk
+++ b/source4/main.mk
@@ -7,6 +7,7 @@ mkinclude smbd/process_model.mk
mkinclude libnet/config.mk
mkinclude auth/config.mk
mkinclude ../nsswitch/config.mk
+mkinclude ../nsswitch/libwbclient/config.mk
mkinclude lib/samba3/config.mk
mkinclude lib/socket/config.mk
mkinclude ../lib/util/charset/config.mk
diff --git a/source4/ntvfs/posix/config.mk b/source4/ntvfs/posix/config.mk
index 1d7949214a..1aaef3f1d4 100644
--- a/source4/ntvfs/posix/config.mk
+++ b/source4/ntvfs/posix/config.mk
@@ -42,7 +42,7 @@ OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = ntvfs_posix_init
#PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4
PRIVATE_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING \
- LIBWBCLIENT pvfs_acl pvfs_aio
+ LIBWBCLIENT_OLD pvfs_acl pvfs_aio
# End MODULE ntvfs_posix
################################################
diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk
index dfc3d17bed..f3dc074125 100644
--- a/source4/rpc_server/config.mk
+++ b/source4/rpc_server/config.mk
@@ -85,7 +85,7 @@ PRIVATE_DEPENDENCIES = \
SAMDB \
NDR_UNIXINFO \
NSS_WRAPPER \
- LIBWBCLIENT
+ LIBWBCLIENT_OLD
# End MODULE dcerpc_unixinfo
################################################