Merge branch 'master' of ssh://git.samba.org/data/git/samba into singlelib
authorJelmer Vernooij <jelmer@samba.org>
Wed, 17 Sep 2008 12:34:54 +0000 (14:34 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 17 Sep 2008 12:34:54 +0000 (14:34 +0200)
370 files changed:
lib/README [new file with mode: 0644]
lib/compression/lzxpress.c [moved from source4/lib/compression/lzxpress.c with 100% similarity]
lib/compression/lzxpress.h [moved from source4/lib/compression/lzxpress.h with 100% similarity]
lib/compression/mszip.c [moved from source3/lib/compression/mszip.c with 99% similarity]
lib/compression/mszip.h [moved from source3/lib/compression/mszip.h with 100% similarity]
lib/compression/testsuite.c [moved from source4/lib/compression/testsuite.c with 96% similarity]
lib/nss_wrapper/config.m4 [moved from source4/lib/nss_wrapper/config.m4 with 88% similarity]
lib/nss_wrapper/config.mk [moved from source4/lib/nss_wrapper/config.mk with 100% similarity]
lib/nss_wrapper/nss_wrapper.c [moved from source3/lib/nss_wrapper/nss_wrapper.c with 99% similarity]
lib/nss_wrapper/nss_wrapper.h [moved from source3/lib/nss_wrapper/nss_wrapper.h with 100% similarity]
lib/nss_wrapper/nss_wrapper.pl [moved from source3/lib/nss_wrapper/nss_wrapper.pl with 100% similarity]
lib/popt/CHANGES [moved from source3/popt/CHANGES with 100% similarity]
lib/popt/COPYING [moved from source3/popt/COPYING with 100% similarity]
lib/popt/README [moved from source3/popt/README with 100% similarity]
lib/popt/config.mk [moved from source4/lib/popt/config.mk with 83% similarity]
lib/popt/dummy.in [moved from source3/popt/dummy.in with 100% similarity]
lib/popt/findme.c [moved from source3/popt/findme.c with 100% similarity]
lib/popt/findme.h [moved from source3/popt/findme.h with 100% similarity]
lib/popt/libpopt.m4 [moved from source4/lib/popt/libpopt.m4 with 100% similarity]
lib/popt/popt.c [moved from source3/popt/popt.c with 100% similarity]
lib/popt/popt.h [moved from source3/popt/popt.h with 100% similarity]
lib/popt/poptconfig.c [moved from source3/popt/poptconfig.c with 100% similarity]
lib/popt/popthelp.c [moved from source3/popt/popthelp.c with 100% similarity]
lib/popt/poptint.h [moved from source3/popt/poptint.h with 100% similarity]
lib/popt/poptparse.c [moved from source3/popt/poptparse.c with 100% similarity]
lib/popt/samba.m4 [moved from source4/lib/popt/samba.m4 with 52% similarity]
lib/popt/system.h [moved from source3/popt/system.h with 100% similarity]
lib/replace/.checker_innocent [moved from source3/lib/replace/.checker_innocent with 100% similarity]
lib/replace/Makefile.in [moved from source3/lib/replace/Makefile.in with 100% similarity]
lib/replace/README [moved from source3/lib/replace/README with 100% similarity]
lib/replace/aclocal.m4 [moved from source3/lib/replace/aclocal.m4 with 100% similarity]
lib/replace/autoconf-2.60.m4 [moved from source3/lib/replace/autoconf-2.60.m4 with 100% similarity]
lib/replace/autogen.sh [moved from source3/lib/replace/autogen.sh with 100% similarity]
lib/replace/config.guess [moved from source3/lib/replace/config.guess with 100% similarity]
lib/replace/config.sub [moved from source3/lib/replace/config.sub with 100% similarity]
lib/replace/configure.ac [moved from source3/lib/replace/configure.ac with 100% similarity]
lib/replace/dlfcn.c [moved from source3/lib/replace/dlfcn.c with 100% similarity]
lib/replace/dlfcn.m4 [moved from source3/lib/replace/dlfcn.m4 with 100% similarity]
lib/replace/getaddrinfo.c [moved from source3/lib/replace/getaddrinfo.c with 100% similarity]
lib/replace/getaddrinfo.h [moved from source4/lib/replace/getaddrinfo.h with 98% similarity]
lib/replace/getifaddrs.c [moved from source3/lib/replace/getifaddrs.c with 100% similarity]
lib/replace/getpass.c [moved from source3/lib/replace/getpass.c with 100% similarity]
lib/replace/getpass.m4 [moved from source3/lib/replace/getpass.m4 with 100% similarity]
lib/replace/inet_aton.c [moved from source3/lib/replace/inet_aton.c with 100% similarity]
lib/replace/inet_ntoa.c [moved from source3/lib/replace/inet_ntoa.c with 100% similarity]
lib/replace/inet_ntop.c [moved from source3/lib/replace/inet_ntop.c with 100% similarity]
lib/replace/inet_pton.c [moved from source3/lib/replace/inet_pton.c with 100% similarity]
lib/replace/install-sh [moved from source3/lib/replace/install-sh with 100% similarity]
lib/replace/libreplace.m4 [moved from source3/lib/replace/libreplace.m4 with 96% similarity]
lib/replace/libreplace_cc.m4 [moved from source3/lib/replace/libreplace_cc.m4 with 100% similarity]
lib/replace/libreplace_ld.m4 [moved from source3/lib/replace/libreplace_ld.m4 with 100% similarity]
lib/replace/libreplace_macros.m4 [moved from source3/lib/replace/libreplace_macros.m4 with 100% similarity]
lib/replace/libreplace_network.m4 [moved from source3/lib/replace/libreplace_network.m4 with 100% similarity]
lib/replace/repdir.m4 [moved from source3/lib/replace/repdir.m4 with 100% similarity]
lib/replace/repdir_getdents.c [moved from source3/lib/replace/repdir_getdents.c with 100% similarity]
lib/replace/repdir_getdirentries.c [moved from source3/lib/replace/repdir_getdirentries.c with 100% similarity]
lib/replace/replace.c [moved from source3/lib/replace/replace.c with 100% similarity]
lib/replace/replace.h [moved from source3/lib/replace/replace.h with 100% similarity]
lib/replace/samba.m4 [moved from source3/lib/replace/samba.m4 with 100% similarity]
lib/replace/snprintf.c [moved from source3/lib/replace/snprintf.c with 100% similarity]
lib/replace/socket.c [moved from source3/lib/replace/socket.c with 100% similarity]
lib/replace/socketpair.c [moved from source3/lib/replace/socketpair.c with 100% similarity]
lib/replace/strptime.c [moved from source3/lib/replace/strptime.c with 100% similarity]
lib/replace/strptime.m4 [moved from source3/lib/replace/strptime.m4 with 100% similarity]
lib/replace/system/README [moved from source3/lib/replace/system/README with 100% similarity]
lib/replace/system/aio.h [moved from source3/lib/replace/system/aio.h with 100% similarity]
lib/replace/system/capability.h [moved from source3/lib/replace/system/capability.h with 100% similarity]
lib/replace/system/config.m4 [moved from source3/lib/replace/system/config.m4 with 100% similarity]
lib/replace/system/dir.h [moved from source3/lib/replace/system/dir.h with 100% similarity]
lib/replace/system/filesys.h [moved from source3/lib/replace/system/filesys.h with 100% similarity]
lib/replace/system/glob.h [moved from source3/lib/replace/system/glob.h with 100% similarity]
lib/replace/system/iconv.h [moved from source3/lib/replace/system/iconv.h with 100% similarity]
lib/replace/system/kerberos.h [moved from source3/lib/replace/system/kerberos.h with 100% similarity]
lib/replace/system/locale.h [moved from source3/lib/replace/system/locale.h with 100% similarity]
lib/replace/system/network.h [moved from source4/lib/replace/system/network.h with 99% similarity]
lib/replace/system/passwd.h [moved from source4/lib/replace/system/passwd.h with 98% similarity]
lib/replace/system/readline.h [moved from source3/lib/replace/system/readline.h with 100% similarity]
lib/replace/system/select.h [moved from source3/lib/replace/system/select.h with 100% similarity]
lib/replace/system/shmem.h [moved from source3/lib/replace/system/shmem.h with 100% similarity]
lib/replace/system/syslog.h [moved from source3/lib/replace/system/syslog.h with 100% similarity]
lib/replace/system/terminal.h [moved from source3/lib/replace/system/terminal.h with 100% similarity]
lib/replace/system/time.h [moved from source3/lib/replace/system/time.h with 100% similarity]
lib/replace/system/wait.h [moved from source3/lib/replace/system/wait.h with 100% similarity]
lib/replace/test/getifaddrs.c [moved from source3/lib/replace/test/getifaddrs.c with 100% similarity]
lib/replace/test/os2_delete.c [moved from source3/lib/replace/test/os2_delete.c with 100% similarity]
lib/replace/test/shared_mmap.c [moved from source3/lib/replace/test/shared_mmap.c with 100% similarity]
lib/replace/test/strptime.c [moved from source3/lib/replace/test/strptime.c with 100% similarity]
lib/replace/test/testsuite.c [moved from source3/lib/replace/test/testsuite.c with 100% similarity]
lib/replace/timegm.c [moved from source3/lib/replace/timegm.c with 100% similarity]
lib/replace/timegm.m4 [moved from source3/lib/replace/timegm.m4 with 100% similarity]
lib/replace/win32.m4 [moved from source3/lib/replace/win32.m4 with 100% similarity]
lib/replace/win32_replace.h [moved from source3/lib/replace/win32_replace.h with 100% similarity]
lib/socket_wrapper/config.m4 [moved from source4/lib/socket_wrapper/config.m4 with 89% similarity]
lib/socket_wrapper/config.mk [moved from source3/lib/socket_wrapper/config.mk with 100% similarity]
lib/socket_wrapper/socket_wrapper.c [moved from source4/lib/socket_wrapper/socket_wrapper.c with 99% similarity]
lib/socket_wrapper/socket_wrapper.h [moved from source3/lib/socket_wrapper/socket_wrapper.h with 100% similarity]
lib/socket_wrapper/testsuite.c [moved from source3/lib/socket_wrapper/testsuite.c with 98% similarity]
lib/talloc/Makefile.in [moved from source3/lib/talloc/Makefile.in with 100% similarity]
lib/talloc/NEWS [moved from source3/lib/talloc/NEWS with 100% similarity]
lib/talloc/aclocal.m4 [moved from source3/lib/talloc/aclocal.m4 with 100% similarity]
lib/talloc/autogen.sh [moved from source3/lib/talloc/autogen.sh with 100% similarity]
lib/talloc/config.guess [moved from source3/lib/talloc/config.guess with 100% similarity]
lib/talloc/config.mk [moved from source4/lib/talloc/config.mk with 52% similarity]
lib/talloc/config.sub [moved from source3/lib/talloc/config.sub with 100% similarity]
lib/talloc/configure.ac [moved from source3/lib/talloc/configure.ac with 100% similarity]
lib/talloc/install-sh [moved from source3/lib/talloc/install-sh with 100% similarity]
lib/talloc/libtalloc.m4 [moved from source4/lib/talloc/libtalloc.m4 with 94% similarity]
lib/talloc/rules.mk [moved from source3/lib/talloc/rules.mk with 100% similarity]
lib/talloc/talloc.3.xml [moved from source3/lib/talloc/talloc.3.xml with 100% similarity]
lib/talloc/talloc.c [moved from source3/lib/talloc/talloc.c with 100% similarity]
lib/talloc/talloc.h [moved from source3/lib/talloc/talloc.h with 100% similarity]
lib/talloc/talloc.i [moved from source3/lib/talloc/talloc.i with 100% similarity]
lib/talloc/talloc.mk [moved from source3/lib/talloc/talloc.mk with 100% similarity]
lib/talloc/talloc.pc.in [moved from source3/lib/talloc/talloc.pc.in with 100% similarity]
lib/talloc/talloc_guide.txt [moved from source3/lib/talloc/talloc_guide.txt with 100% similarity]
lib/talloc/testsuite.c [moved from source3/lib/talloc/testsuite.c with 100% similarity]
lib/talloc/web/index.html [moved from source3/lib/talloc/web/index.html with 100% similarity]
lib/tdb/Makefile.in [moved from source3/lib/tdb/Makefile.in with 100% similarity]
lib/tdb/aclocal.m4 [moved from source3/lib/tdb/aclocal.m4 with 100% similarity]
lib/tdb/autogen.sh [moved from source3/lib/tdb/autogen.sh with 100% similarity]
lib/tdb/common/dump.c [moved from source3/lib/tdb/common/dump.c with 100% similarity]
lib/tdb/common/error.c [moved from source3/lib/tdb/common/error.c with 100% similarity]
lib/tdb/common/freelist.c [moved from source3/lib/tdb/common/freelist.c with 100% similarity]
lib/tdb/common/freelistcheck.c [moved from source3/lib/tdb/common/freelistcheck.c with 100% similarity]
lib/tdb/common/io.c [moved from source3/lib/tdb/common/io.c with 100% similarity]
lib/tdb/common/lock.c [moved from source3/lib/tdb/common/lock.c with 100% similarity]
lib/tdb/common/open.c [moved from source3/lib/tdb/common/open.c with 100% similarity]
lib/tdb/common/tdb.c [moved from source3/lib/tdb/common/tdb.c with 100% similarity]
lib/tdb/common/tdb_private.h [moved from source3/lib/tdb/common/tdb_private.h with 100% similarity]
lib/tdb/common/transaction.c [moved from source3/lib/tdb/common/transaction.c with 100% similarity]
lib/tdb/common/traverse.c [moved from source3/lib/tdb/common/traverse.c with 100% similarity]
lib/tdb/config.guess [moved from source3/lib/tdb/config.guess with 100% similarity]
lib/tdb/config.mk [moved from source4/lib/tdb/config.mk with 79% similarity]
lib/tdb/config.sub [moved from source3/lib/tdb/config.sub with 100% similarity]
lib/tdb/configure.ac [moved from source3/lib/tdb/configure.ac with 100% similarity]
lib/tdb/docs/README [moved from source3/lib/tdb/docs/README with 100% similarity]
lib/tdb/docs/tdb.magic [moved from source3/lib/tdb/docs/tdb.magic with 100% similarity]
lib/tdb/include/tdb.h [moved from source3/lib/tdb/include/tdb.h with 100% similarity]
lib/tdb/install-sh [moved from source3/lib/tdb/install-sh with 100% similarity]
lib/tdb/libtdb.m4 [moved from source4/lib/tdb/libtdb.m4 with 91% similarity]
lib/tdb/python.mk [moved from source3/lib/tdb/python.mk with 100% similarity]
lib/tdb/python/tdbdump.py [moved from source3/lib/tdb/python/tdbdump.py with 100% similarity]
lib/tdb/python/tests/simple.py [moved from source3/lib/tdb/python/tests/simple.py with 100% similarity]
lib/tdb/rules.mk [moved from source3/lib/tdb/rules.mk with 100% similarity]
lib/tdb/tdb.i [moved from source3/lib/tdb/tdb.i with 100% similarity]
lib/tdb/tdb.mk [moved from source3/lib/tdb/tdb.mk with 100% similarity]
lib/tdb/tdb.pc.in [moved from source3/lib/tdb/tdb.pc.in with 100% similarity]
lib/tdb/tdb.py [moved from source3/lib/tdb/tdb.py with 100% similarity]
lib/tdb/tdb_wrap.c [moved from source3/lib/tdb/tdb_wrap.c with 100% similarity]
lib/tdb/tools/tdbbackup.c [moved from source3/lib/tdb/tools/tdbbackup.c with 100% similarity]
lib/tdb/tools/tdbdump.c [moved from source3/lib/tdb/tools/tdbdump.c with 100% similarity]
lib/tdb/tools/tdbtest.c [moved from source3/lib/tdb/tools/tdbtest.c with 100% similarity]
lib/tdb/tools/tdbtool.c [moved from source3/lib/tdb/tools/tdbtool.c with 100% similarity]
lib/tdb/tools/tdbtorture.c [moved from source3/lib/tdb/tools/tdbtorture.c with 100% similarity]
lib/tdb/web/index.html [moved from source3/lib/tdb/web/index.html with 100% similarity]
source3/Makefile.in
source3/autogen.sh
source3/configure.in
source3/include/includes.h
source3/include/interfaces.h
source3/include/talloc_stack.h
source3/iniparser_build/dictionary.c
source3/iniparser_build/iniparser.c
source3/iniparser_build/strlib.c
source3/lib/interfaces.c
source3/lib/ldb/ldb_tdb/ldb_tdb.h
source3/lib/nss_wrapper/config.m4 [deleted file]
source3/lib/nss_wrapper/config.mk [deleted file]
source3/lib/replace/getaddrinfo.h [deleted file]
source3/lib/replace/system/network.h [deleted file]
source3/lib/replace/system/passwd.h [deleted file]
source3/lib/socket_wrapper/config.m4 [deleted file]
source3/lib/socket_wrapper/socket_wrapper.c [deleted file]
source3/lib/talloc/config.mk [deleted file]
source3/lib/talloc/libtalloc.m4 [deleted file]
source3/lib/tdb/config.mk [deleted file]
source3/lib/tdb/libtdb.m4 [deleted file]
source3/libaddns/dns.h
source3/librpc/ndr/ndr_compression.c
source3/m4/aclocal.m4
source3/nsswitch/winbind_nss_config.h
source3/samba4.m4
source3/samba4.mk
source4/Makefile
source4/aclocal.m4
source4/autogen.sh
source4/cluster/ctdb/brlock_ctdb.c
source4/cluster/ctdb/client/ctdb_client.c
source4/cluster/ctdb/common/ctdb_io.c
source4/cluster/ctdb/common/ctdb_ltdb.c
source4/cluster/ctdb/common/ctdb_message.c
source4/cluster/ctdb/common/ctdb_util.c
source4/cluster/ctdb/ctdb_cluster.c
source4/cluster/ctdb/opendb_ctdb.c
source4/cluster/ctdb/server/ctdb_call.c
source4/cluster/ctdb/server/ctdb_control.c
source4/cluster/ctdb/server/ctdb_daemon.c
source4/cluster/ctdb/server/ctdb_freeze.c
source4/cluster/ctdb/server/ctdb_lockwait.c
source4/cluster/ctdb/server/ctdb_ltdb_server.c
source4/cluster/ctdb/server/ctdb_recover.c
source4/cluster/ctdb/server/ctdb_server.c
source4/cluster/ctdb/server/ctdb_takeover.c
source4/cluster/ctdb/server/ctdb_traverse.c
source4/cluster/ctdb/takeover/ctdb_takeover.c
source4/cluster/ctdb/tcp/tcp_connect.c
source4/cluster/ctdb/tcp/tcp_init.c
source4/cluster/ctdb/tcp/tcp_io.c
source4/cluster/local.c
source4/configure.ac
source4/heimdal_build/config.h
source4/heimdal_build/gssapi-glue.c
source4/include/includes.h
source4/lib/compression/mszip.c [deleted file]
source4/lib/compression/mszip.h [deleted file]
source4/lib/dbwrap/dbwrap.c
source4/lib/dbwrap/dbwrap_ctdb.c
source4/lib/dbwrap/dbwrap_tdb.c
source4/lib/messaging/messaging.c
source4/lib/nss_wrapper/nss_wrapper.c [deleted file]
source4/lib/nss_wrapper/nss_wrapper.h [deleted file]
source4/lib/nss_wrapper/nss_wrapper.pl [deleted file]
source4/lib/popt/CHANGES [deleted file]
source4/lib/popt/COPYING [deleted file]
source4/lib/popt/README [deleted file]
source4/lib/popt/findme.c [deleted file]
source4/lib/popt/findme.h [deleted file]
source4/lib/popt/popt.c [deleted file]
source4/lib/popt/popt.h [deleted file]
source4/lib/popt/poptconfig.c [deleted file]
source4/lib/popt/popthelp.c [deleted file]
source4/lib/popt/poptint.h [deleted file]
source4/lib/popt/poptparse.c [deleted file]
source4/lib/popt/system.h [deleted file]
source4/lib/replace/.checker_innocent [deleted file]
source4/lib/replace/Makefile.in [deleted file]
source4/lib/replace/README [deleted file]
source4/lib/replace/aclocal.m4 [deleted file]
source4/lib/replace/autoconf-2.60.m4 [deleted file]
source4/lib/replace/autogen.sh [deleted file]
source4/lib/replace/config.guess [deleted file]
source4/lib/replace/config.sub [deleted file]
source4/lib/replace/configure.ac [deleted file]
source4/lib/replace/dlfcn.c [deleted file]
source4/lib/replace/dlfcn.m4 [deleted file]
source4/lib/replace/getaddrinfo.c [deleted file]
source4/lib/replace/getifaddrs.c [deleted file]
source4/lib/replace/getpass.c [deleted file]
source4/lib/replace/getpass.m4 [deleted file]
source4/lib/replace/inet_aton.c [deleted file]
source4/lib/replace/inet_ntoa.c [deleted file]
source4/lib/replace/inet_ntop.c [deleted file]
source4/lib/replace/inet_pton.c [deleted file]
source4/lib/replace/install-sh [deleted file]
source4/lib/replace/libreplace.m4 [deleted file]
source4/lib/replace/libreplace_cc.m4 [deleted file]
source4/lib/replace/libreplace_ld.m4 [deleted file]
source4/lib/replace/libreplace_macros.m4 [deleted file]
source4/lib/replace/libreplace_network.m4 [deleted file]
source4/lib/replace/repdir.m4 [deleted file]
source4/lib/replace/repdir_getdents.c [deleted file]
source4/lib/replace/repdir_getdirentries.c [deleted file]
source4/lib/replace/replace.c [deleted file]
source4/lib/replace/replace.h [deleted file]
source4/lib/replace/samba.m4 [deleted file]
source4/lib/replace/snprintf.c [deleted file]
source4/lib/replace/socket.c [deleted file]
source4/lib/replace/socketpair.c [deleted file]
source4/lib/replace/strptime.c [deleted file]
source4/lib/replace/strptime.m4 [deleted file]
source4/lib/replace/system/README [deleted file]
source4/lib/replace/system/aio.h [deleted file]
source4/lib/replace/system/capability.h [deleted file]
source4/lib/replace/system/config.m4 [deleted file]
source4/lib/replace/system/dir.h [deleted file]
source4/lib/replace/system/filesys.h [deleted file]
source4/lib/replace/system/glob.h [deleted file]
source4/lib/replace/system/iconv.h [deleted file]
source4/lib/replace/system/kerberos.h [deleted file]
source4/lib/replace/system/locale.h [deleted file]
source4/lib/replace/system/readline.h [deleted file]
source4/lib/replace/system/select.h [deleted file]
source4/lib/replace/system/shmem.h [deleted file]
source4/lib/replace/system/syslog.h [deleted file]
source4/lib/replace/system/terminal.h [deleted file]
source4/lib/replace/system/time.h [deleted file]
source4/lib/replace/system/wait.h [deleted file]
source4/lib/replace/test/getifaddrs.c [deleted file]
source4/lib/replace/test/os2_delete.c [deleted file]
source4/lib/replace/test/shared_mmap.c [deleted file]
source4/lib/replace/test/strptime.c [deleted file]
source4/lib/replace/test/testsuite.c [deleted file]
source4/lib/replace/timegm.c [deleted file]
source4/lib/replace/timegm.m4 [deleted file]
source4/lib/replace/win32.m4 [deleted file]
source4/lib/replace/win32_replace.h [deleted file]
source4/lib/socket_wrapper/config.mk [deleted file]
source4/lib/socket_wrapper/socket_wrapper.h [deleted file]
source4/lib/socket_wrapper/testsuite.c [deleted file]
source4/lib/talloc/Makefile.in [deleted file]
source4/lib/talloc/NEWS [deleted file]
source4/lib/talloc/aclocal.m4 [deleted file]
source4/lib/talloc/autogen.sh [deleted file]
source4/lib/talloc/config.guess [deleted file]
source4/lib/talloc/config.sub [deleted file]
source4/lib/talloc/configure.ac [deleted file]
source4/lib/talloc/install-sh [deleted file]
source4/lib/talloc/rules.mk [deleted file]
source4/lib/talloc/talloc.3.xml [deleted file]
source4/lib/talloc/talloc.c [deleted file]
source4/lib/talloc/talloc.h [deleted file]
source4/lib/talloc/talloc.i [deleted file]
source4/lib/talloc/talloc.mk [deleted file]
source4/lib/talloc/talloc.pc.in [deleted file]
source4/lib/talloc/talloc_guide.txt [deleted file]
source4/lib/talloc/testsuite.c [deleted file]
source4/lib/talloc/web/index.html [deleted file]
source4/lib/tdb/Makefile.in [deleted file]
source4/lib/tdb/aclocal.m4 [deleted file]
source4/lib/tdb/autogen.sh [deleted file]
source4/lib/tdb/common/dump.c [deleted file]
source4/lib/tdb/common/error.c [deleted file]
source4/lib/tdb/common/freelist.c [deleted file]
source4/lib/tdb/common/freelistcheck.c [deleted file]
source4/lib/tdb/common/io.c [deleted file]
source4/lib/tdb/common/lock.c [deleted file]
source4/lib/tdb/common/open.c [deleted file]
source4/lib/tdb/common/tdb.c [deleted file]
source4/lib/tdb/common/tdb_private.h [deleted file]
source4/lib/tdb/common/transaction.c [deleted file]
source4/lib/tdb/common/traverse.c [deleted file]
source4/lib/tdb/config.guess [deleted file]
source4/lib/tdb/config.sub [deleted file]
source4/lib/tdb/configure.ac [deleted file]
source4/lib/tdb/docs/README [deleted file]
source4/lib/tdb/docs/tdb.magic [deleted file]
source4/lib/tdb/include/tdb.h [deleted file]
source4/lib/tdb/install-sh [deleted file]
source4/lib/tdb/python.mk [deleted file]
source4/lib/tdb/python/tdbdump.py [deleted file]
source4/lib/tdb/python/tests/simple.py [deleted file]
source4/lib/tdb/rules.mk [deleted file]
source4/lib/tdb/tdb.i [deleted file]
source4/lib/tdb/tdb.mk [deleted file]
source4/lib/tdb/tdb.pc.in [deleted file]
source4/lib/tdb/tdb.py [deleted file]
source4/lib/tdb/tdb_wrap.c [deleted file]
source4/lib/tdb/tools/tdbbackup.c [deleted file]
source4/lib/tdb/tools/tdbdump.c [deleted file]
source4/lib/tdb/tools/tdbtest.c [deleted file]
source4/lib/tdb/tools/tdbtool.c [deleted file]
source4/lib/tdb/tools/tdbtorture.c [deleted file]
source4/lib/tdb/web/index.html [deleted file]
source4/lib/tdb_wrap.c
source4/lib/util/util_tdb.c
source4/librpc/ndr/ndr_compression.c
source4/main.mk
source4/nsswitch/winbind_nss_config.h
source4/ntvfs/common/brlock.c
source4/ntvfs/common/brlock_tdb.c
source4/ntvfs/common/notify.c
source4/ntvfs/common/opendb_tdb.c
source4/ntvfs/posix/vfs_posix.c
source4/ntvfs/posix/xattr_tdb.c
source4/param/secrets.c
source4/smbd/process_prefork.c
source4/smbd/process_standard.c
source4/torture/basic/mangle_test.c
source4/torture/local/config.mk
source4/torture/local/dbspeed.c

diff --git a/lib/README b/lib/README
new file mode 100644 (file)
index 0000000..b994447
--- /dev/null
@@ -0,0 +1,10 @@
+compression - Various compression algorithms (MSZIP, lzxpress)
+nss_wrapper - Wrapper for the user and group NSS API allowing the use 
+              of other data sources.
+popt - Command-line option parsing library
+replace - Provides replacements for standard (POSIX, C99) functions 
+          not provided by the host platform.
+socket_wrapper - Wrapper library allowing TCP/IP traffic to be redirected 
+                 over Unix domain sockets.
+talloc - Hierarchical pool based memory allocator 
+tdb - Simple but fast key/value database library, supporting multiple writers
similarity index 99%
rename from source3/lib/compression/mszip.c
rename to lib/compression/mszip.c
index aeeb2d8afd57681404f3edd61f66c3b56808b51c..9aa1772414bcbd0bc376e234799338654b161f4f 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #include "includes.h"
-#include "lib/compression/mszip.h"
+#include "../compression/mszip.h"
 
 /*--------------------------------------------------------------------------*/
 /* our archiver information / state */
similarity index 96%
rename from source4/lib/compression/testsuite.c
rename to lib/compression/testsuite.c
index f6e4d49afbcb1befac8e4d22ab9dec816c0202d6..b9cebb2e8d121e855cfe1844e6a8d890bb1a7999 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "includes.h"
 #include "torture/torture.h"
-#include "lib/compression/mszip.h"
+#include "../compression/mszip.h"
 
 struct torture_suite *torture_local_compression(TALLOC_CTX *mem_ctx)
 {
similarity index 88%
rename from source4/lib/nss_wrapper/config.m4
rename to lib/nss_wrapper/config.m4
index 58e94f9830ad4ea1a9ece359019d92c28c579d12..45423788d126ea9de3a019516ca1e78be340e310 100644 (file)
@@ -12,7 +12,7 @@ if eval "test x$enable_nss_wrapper = xyes"; then
        HAVE_NSS_WRAPPER=yes
 
        # this is only used for samba3
-       NSS_WRAPPER_OBJS="lib/nss_wrapper/nss_wrapper.o"
+       NSS_WRAPPER_OBJS="../lib/nss_wrapper/nss_wrapper.o"
 fi
 
 AC_SUBST(HAVE_NSS_WRAPPER)
similarity index 99%
rename from source3/lib/nss_wrapper/nss_wrapper.c
rename to lib/nss_wrapper/nss_wrapper.c
index 5d443facd3e7ed5402f4cb52eb9a2c7d34ef073b..da090832b0674948bc00d07a09f228378a8a1630 100644 (file)
@@ -34,7 +34,7 @@
 #ifdef _SAMBA_BUILD_
 
 #define NSS_WRAPPER_NOT_REPLACE
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #include "system/passwd.h"
 #include "system/filesys.h"
 
similarity index 100%
rename from source3/popt/CHANGES
rename to lib/popt/CHANGES
similarity index 100%
rename from source3/popt/COPYING
rename to lib/popt/COPYING
similarity index 100%
rename from source3/popt/README
rename to lib/popt/README
similarity index 83%
rename from source4/lib/popt/config.mk
rename to lib/popt/config.mk
index e015577aead0c40bb018764e5db51e186af28157..04cc2c7ea53694afaa888d6eb2ab1a4b4fdc27ba 100644 (file)
@@ -1,5 +1,5 @@
 [SUBSYSTEM::LIBPOPT]
-CFLAGS = -Ilib/popt
+CFLAGS = -I$(poptsrcdir)
 
 LIBPOPT_OBJ_FILES = $(addprefix $(poptsrcdir)/, findme.o popt.o poptconfig.o popthelp.o poptparse.o)
 
similarity index 100%
rename from source3/popt/dummy.in
rename to lib/popt/dummy.in
similarity index 100%
rename from source3/popt/findme.c
rename to lib/popt/findme.c
similarity index 100%
rename from source3/popt/findme.h
rename to lib/popt/findme.h
similarity index 100%
rename from source3/popt/popt.c
rename to lib/popt/popt.c
similarity index 100%
rename from source3/popt/popt.h
rename to lib/popt/popt.h
similarity index 100%
rename from source3/popt/popthelp.c
rename to lib/popt/popthelp.c
similarity index 100%
rename from source3/popt/poptint.h
rename to lib/popt/poptint.h
similarity index 52%
rename from source4/lib/popt/samba.m4
rename to lib/popt/samba.m4
index 855fd6c402690d2ff03d21f9ca51a666af537896..627dd854b2728e944428b9eb9ec8aa9dbe8d5ae7 100644 (file)
@@ -1,8 +1,8 @@
-m4_include(lib/popt/libpopt.m4)
+m4_include(../lib/popt/libpopt.m4)
 
 if test x"$POPT_OBJ" = "x"; then
        SMB_EXT_LIB(LIBPOPT, [${POPT_LIBS}])
 else
-       SMB_INCLUDE_MK(lib/popt/config.mk)
+       SMB_INCLUDE_MK(../lib/popt/config.mk)
 fi
 
similarity index 100%
rename from source3/popt/system.h
rename to lib/popt/system.h
similarity index 98%
rename from source4/lib/replace/getaddrinfo.h
rename to lib/replace/getaddrinfo.h
index dddd699b623f5ac3bd3da7288654600d67a5b8f2..cf040da2db47e19b21ae607a82b565f44d523639 100644 (file)
@@ -75,7 +75,9 @@ in lib/replace we use rep_xxx()
 #undef getnameinfo
 #endif
 #define getnameinfo rep_getnameinfo
+#ifndef HAVE_GETNAMEINFO
 #define HAVE_GETNAMEINFO
+#endif
 
 extern int rep_getaddrinfo(const char *node, const char *service,
                        const struct addrinfo * hints, struct addrinfo ** res);
similarity index 96%
rename from source3/lib/replace/libreplace.m4
rename to lib/replace/libreplace.m4
index 71fa0416721497d836c6bc2ca56663489df704e2..dc7d88e6e183b02f01486683a8466fca3f17cbd4 100644 (file)
@@ -5,7 +5,7 @@ echo "LIBREPLACE_LOCATION_CHECKS: START"
 dnl find the libreplace sources. This is meant to work both for 
 dnl libreplace standalone builds, and builds of packages using libreplace
 libreplacedir=""
-libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace"
+libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace"
 for d in $libreplacepaths; do
        if test -f "$d/replace.c"; then
                libreplacedir="$d"              
@@ -34,13 +34,18 @@ echo "LIBREPLACE_BROKEN_CHECKS: START"
 dnl find the libreplace sources. This is meant to work both for 
 dnl libreplace standalone builds, and builds of packages using libreplace
 libreplacedir=""
-for d in "$srcdir" "$srcdir/lib/replace" "$srcdir/libreplace" "$srcdir/../libreplace" "$srcdir/../replace"; do
+libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace"
+for d in $libreplacepaths; do
        if test -f "$d/replace.c"; then
                libreplacedir="$d"              
                AC_SUBST(libreplacedir)
                break;
        fi
 done
+if test x"$libreplacedir" = "x"; then
+       AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
+fi
+
 LIBREPLACEOBJ="replace.o"
 AC_SUBST(LIBREPLACEOBJ)
 
similarity index 99%
rename from source4/lib/replace/system/network.h
rename to lib/replace/system/network.h
index 077892a54e2d5d422d98d8daaff58c4ee93c3d54..473d79b5f2997835e9a6c426d0f63a721ece9feb 100644 (file)
@@ -326,7 +326,7 @@ struct addrinfo {
 #ifndef SOCKET_WRAPPER_NOT_REPLACE
 #define SOCKET_WRAPPER_REPLACE
 #endif
-#include "lib/socket_wrapper/socket_wrapper.h"
+#include "../socket_wrapper/socket_wrapper.h"
 #endif
 
 #endif
similarity index 98%
rename from source4/lib/replace/system/passwd.h
rename to lib/replace/system/passwd.h
index cad3197ccbac4cb5471787e5d36d580efa708018..9d7de34bce968ea6ff9c88c8ff9bcf3b60f6d246 100644 (file)
@@ -104,7 +104,7 @@ char *rep_getpass(const char *prompt);
 #ifndef NSS_WRAPPER_NOT_REPLACE
 #define NSS_WRAPPER_REPLACE
 #endif
-#include "lib/nss_wrapper/nss_wrapper.h"
+#include "../nss_wrapper/nss_wrapper.h"
 #endif
 
 #endif
similarity index 89%
rename from source4/lib/socket_wrapper/config.m4
rename to lib/socket_wrapper/config.m4
index f3ffb895a90600a1dd58956c417c405316aab2e9..68e392b3e70ecc03f5e4b9bcb5697f1a85a68636 100644 (file)
@@ -14,7 +14,7 @@ if eval "test x$enable_socket_wrapper = xyes"; then
        HAVE_SOCKET_WRAPPER=yes
 
        # this is only used for samba3
-       SOCKET_WRAPPER_OBJS="lib/socket_wrapper/socket_wrapper.o"
+       SOCKET_WRAPPER_OBJS="../lib/socket_wrapper/socket_wrapper.o"
 fi
 
 AC_SUBST(DEFAULT_TEST_OPTIONS)
similarity index 99%
rename from source4/lib/socket_wrapper/socket_wrapper.c
rename to lib/socket_wrapper/socket_wrapper.c
index 336179d837ba9c1a2fa9948206cb1f290b6c3fab..e8d27adc37fd8487a128c675aff582e009cc11c7 100644 (file)
@@ -42,7 +42,7 @@
 #ifdef _SAMBA_BUILD_
 
 #define SOCKET_WRAPPER_NOT_REPLACE
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/time.h"
similarity index 98%
rename from source3/lib/socket_wrapper/testsuite.c
rename to lib/socket_wrapper/testsuite.c
index 8877418e4cc46cfac37ca282fc471cc48d7f94c0..e6e08e3be685327f7b4c4fee83d4ecffa635372a 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "system/network.h"
-#include "lib/socket_wrapper/socket_wrapper.h"
+#include "../socket_wrapper/socket_wrapper.h"
 #include "torture/torture.h"
 
 static char *old_dir = NULL;
similarity index 100%
rename from source3/lib/talloc/NEWS
rename to lib/talloc/NEWS
similarity index 52%
rename from source4/lib/talloc/config.mk
rename to lib/talloc/config.mk
index c13e1b79abd4a43b887105c1e938392e57dc19ea..5cdf3a1a8e1611ffd69965bff18cea0f288aa973 100644 (file)
@@ -1,7 +1,7 @@
 [LIBRARY::LIBTALLOC]
 OUTPUT_TYPE = MERGED_OBJ
-CFLAGS = -Ilib/talloc
+CFLAGS = -I$(tallocsrcdir)
 
-LIBTALLOC_OBJ_FILES = lib/talloc/talloc.o
+LIBTALLOC_OBJ_FILES = $(tallocsrcdir)/talloc.o
 
 MANPAGES += $(tallocdir)/talloc.3
similarity index 94%
rename from source4/lib/talloc/libtalloc.m4
rename to lib/talloc/libtalloc.m4
index fd2b4b22cdbb21777d5ea90a7e303d4a9f12a7b5..e6830fbef680c8db31aef664af8a476d30731895 100644 (file)
@@ -1,7 +1,7 @@
 dnl find the talloc sources. This is meant to work both for 
 dnl talloc standalone builds, and builds of packages using talloc
 tallocdir=""
-tallocpaths=". lib/talloc talloc ../talloc"
+tallocpaths=". lib/talloc talloc ../talloc ../lib/talloc"
 for d in $tallocpaths; do
        if test -f "$srcdir/$d/talloc.c"; then
                tallocdir="$d"
similarity index 79%
rename from source4/lib/tdb/config.mk
rename to lib/tdb/config.mk
index b9a8f80dda597dabffd2fde9d551a3e28f986325..90c9ba2863bda2e7a419ba406fdabd3e1dd5690a 100644 (file)
@@ -2,12 +2,12 @@
 # Start SUBSYSTEM LIBTDB
 [LIBRARY::LIBTDB]
 OUTPUT_TYPE = STATIC_LIBRARY
-CFLAGS = -Ilib/tdb/include
+CFLAGS = -I$(tdbsrcdir)/include
 #
 # End SUBSYSTEM ldb
 ################################################
 
-LIBTDB_OBJ_FILES = $(addprefix lib/tdb/common/, \
+LIBTDB_OBJ_FILES = $(addprefix $(tdbsrcdir)/common/, \
        tdb.o dump.o io.o lock.o \
        open.o traverse.o freelist.o \
        error.o transaction.o)
@@ -21,7 +21,7 @@ PRIVATE_DEPENDENCIES = \
 # End BINARY tdbtool
 ################################################
 
-tdbtool_OBJ_FILES = lib/tdb/tools/tdbtool.o
+tdbtool_OBJ_FILES = $(tdbsrcdir)/tools/tdbtool.o
 
 ################################################
 # Start BINARY tdbtorture
@@ -32,7 +32,7 @@ PRIVATE_DEPENDENCIES = \
 # End BINARY tdbtorture
 ################################################
 
-tdbtorture_OBJ_FILES = lib/tdb/tools/tdbtorture.o
+tdbtorture_OBJ_FILES = $(tdbsrcdir)/tools/tdbtorture.o
 
 ################################################
 # Start BINARY tdbdump
@@ -43,7 +43,7 @@ PRIVATE_DEPENDENCIES = \
 # End BINARY tdbdump
 ################################################
 
-tdbdump_OBJ_FILES = lib/tdb/tools/tdbdump.o
+tdbdump_OBJ_FILES = $(tdbsrcdir)/tools/tdbdump.o
 
 ################################################
 # Start BINARY tdbbackup
@@ -54,4 +54,4 @@ PRIVATE_DEPENDENCIES = \
 # End BINARY tdbbackup
 ################################################
 
-tdbbackup_OBJ_FILES = lib/tdb/tools/tdbbackup.o
+tdbbackup_OBJ_FILES = $(tdbsrcdir)/tools/tdbbackup.o
similarity index 91%
rename from source4/lib/tdb/libtdb.m4
rename to lib/tdb/libtdb.m4
index 1e17a7a4f23c74ea30eaf3914c5346b1915776df..252e0b0be30b929adcd2f82275119bac81e6b211 100644 (file)
@@ -1,7 +1,7 @@
 dnl find the tdb sources. This is meant to work both for 
 dnl tdb standalone builds, and builds of packages using tdb
 tdbdir=""
-tdbpaths="$srcdir $srcdir/lib/tdb $srcdir/tdb $srcdir/../tdb"
+tdbpaths="$srcdir $srcdir/lib/tdb $srcdir/tdb $srcdir/../tdb $srcdir/../lib/tdb"
 for d in $tdbpaths; do
        if test -f "$d/common/tdb.c"; then
                tdbdir="$d"             
similarity index 100%
rename from source3/lib/tdb/python.mk
rename to lib/tdb/python.mk
similarity index 100%
rename from source3/lib/tdb/rules.mk
rename to lib/tdb/rules.mk
similarity index 100%
rename from source3/lib/tdb/tdb.i
rename to lib/tdb/tdb.i
similarity index 100%
rename from source3/lib/tdb/tdb.mk
rename to lib/tdb/tdb.mk
similarity index 100%
rename from source3/lib/tdb/tdb.pc.in
rename to lib/tdb/tdb.pc.in
similarity index 100%
rename from source3/lib/tdb/tdb.py
rename to lib/tdb/tdb.py
index 269bc15f3e6a7acd58077a1510faaf099fc97b78..1b0624a304869380d4c0dbe2eb0e93e11982873c 100644 (file)
@@ -249,7 +249,7 @@ LIBNDR_DRSUAPI_OBJ = librpc/ndr/ndr_drsuapi.o \
                     librpc/gen_ndr/ndr_drsuapi.o \
                     librpc/gen_ndr/ndr_drsblobs.o
 
-COMPRESSION_OBJ = lib/compression/mszip.o
+COMPRESSION_OBJ = ../lib/compression/mszip.o
 
 DRSUAPI_OBJ = $(LIBNDR_DRSUAPI_OBJ) \
              $(COMPRESSION_OBJ)
@@ -1061,8 +1061,8 @@ LDBMODIFY_OBJ = $(LDB_CMDLINE_OBJ) lib/ldb/tools/ldbmodify.o
 WINBIND_KRB5_LOCATOR_OBJ1 = nsswitch/winbind_krb5_locator.o
 WINBIND_KRB5_LOCATOR_OBJ = $(WINBIND_KRB5_LOCATOR_OBJ1) $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ)
 
-POPT_OBJ=popt/findme.o popt/popt.o popt/poptconfig.o \
-          popt/popthelp.o popt/poptparse.o
+POPT_OBJ=../popt/findme.o ../popt/popt.o ../popt/poptconfig.o \
+          ../popt/popthelp.o ../popt/poptparse.o
 
 INIPARSER_OBJ = iniparser_build/iniparser.o iniparser_build/dictionary.o \
                iniparser_build/strlib.o
index 355a742aa0377199e2a57af2ddc960d036a38825..deed774b39eec0cc815024192c041875c74f0101 100755 (executable)
@@ -53,7 +53,7 @@ echo "$0: running script/mkversion.sh"
 rm -rf autom4te*.cache
 rm -f configure include/config.h*
 
-IPATHS="-Im4 -Ilib/replace -I../source4"
+IPATHS="-Im4 -I../lib/replace -I../source4"
 
 echo "$0: running $AUTOHEADER $IPATHS"
 $AUTOHEADER $IPATHS || exit 1
index 8025cc35236d7e1ab27a31cf5ca4ec3ee3adc595..92dbf6de2d62f211c674e1a8a16f03069a107d87 100644 (file)
@@ -23,7 +23,7 @@ m4_include(m4/check_path.m4)
 
 AC_LIBREPLACE_CC_CHECKS
 
-m4_include(lib/talloc/libtalloc.m4)
+m4_include(../lib/talloc/libtalloc.m4)
 
 LIBTALLOC_OBJ0=""
 for obj in ${TALLOC_OBJ}; do
@@ -33,7 +33,7 @@ AC_SUBST(LIBTALLOC_OBJ0)
 
 # TODO: These should come from m4_include(lib/tdb/libtdb.m4)
 # but currently this fails: things have to get merged from s4.
-tdbdir="lib/tdb"
+tdbdir="../lib/tdb"
 AC_SUBST(tdbdir)
 TDB_CFLAGS="-I${srcdir-.}/$tdbdir/include"
 AC_SUBST(TDB_CFLAGS)
@@ -43,18 +43,18 @@ for o in common/tdb.o common/dump.o common/transaction.o common/error.o \
             common/traverse.o common/freelist.o common/freelistcheck.o \
                 common/io.o common/lock.o common/open.o; 
 do 
-       LIBTDB_OBJ0="$LIBTDB_OBJ0 lib/tdb/$o"
+       LIBTDB_OBJ0="$LIBTDB_OBJ0 $tdbdir/$o"
 done
 
 AC_SUBST(LIBTDB_OBJ0)
 SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include  -I. -I${srcdir-.}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/lib/replace"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TALLOC_CFLAGS}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/libaddns"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
 
-SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/popt"
+SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/popt"
 
 ## cleanup the $(srcdir) in the Makefile if we are outside of the tree
 if test "x${srcdir-.}" != "x."; then
@@ -131,8 +131,8 @@ else
        CFLAGS="-O"
 fi
 
-m4_include(lib/socket_wrapper/config.m4)
-m4_include(lib/nss_wrapper/config.m4)
+m4_include(../lib/socket_wrapper/config.m4)
+m4_include(../lib/nss_wrapper/config.m4)
 
 m4_include(m4/swat.m4)
 
@@ -5872,7 +5872,7 @@ if test x"$INCLUDED_POPT" = x"yes"; then
     AC_MSG_RESULT(yes)
     BUILD_POPT='$(POPT_OBJ)'
     POPTLIBS='$(POPT_OBJ)'
-    FLAGS1="-I\$(srcdir)/popt"
+    FLAGS1="-I\$(srcdir)/../lib/popt"
 else
     AC_MSG_RESULT(no)
        BUILD_POPT=""
index 9c5ea08f6d523a16278fb78b18774140f4ddcc66..ccdc6d3fd3c19ecc17947340b8e6b707026b95fd 100644 (file)
@@ -25,7 +25,7 @@
 #undef SIZEOF_LONG
 #endif
 
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 
 /* make sure we have included the correct config.h */
 #ifndef NO_CONFIG_H /* for some tests */
@@ -652,7 +652,7 @@ typedef char fstring[FSTRING_LEN];
 #include "tdb.h"
 #include "util_tdb.h"
 
-#include "lib/talloc/talloc.h"
+#include "../talloc/talloc.h"
 /* And a little extension. Abort on type mismatch */
 #define talloc_get_type_abort(ptr, type) \
        (type *)talloc_check_name_abort(ptr, #type)
index 84501cee412d020d8507a5e5a5139618fb1eed5c..9a19c33b57062f5a0ddb64c0cfccc1f4f006dc4c 100644 (file)
@@ -24,8 +24,8 @@
 #ifndef _INTERFACES_H
 #define _INTERFACES_H
 
-#include "lib/replace/replace.h"
-#include "lib/replace/system/network.h"
+#include "../replace/replace.h"
+#include "../replace/system/network.h"
 
 #define MAX_INTERFACES 128
 
index a2a12f8a633ba15c4785f69f0cccfd90db5fbf52..bb22b8a0294aed21a94eb412ed143c18d88aebed 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef _TALLOC_STACK_H
 #define _TALLOC_STACK_H
 
-#include "lib/talloc/talloc.h"
+#include "../talloc/talloc.h"
 
 /*
  * Create a new talloc stack frame.
index de98a4523f04f8b2ad5150cc457df4f65c5c4ea3..3147361746dcc6e618507ca445f1c1026d4b9e33 100644 (file)
@@ -3,5 +3,5 @@
  the iniparser source code
  --metze
 */
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #include "iniparser/src/dictionary.c"
index 4974f373ee55d54a251371e18d6292aab4b99d17..3f4a1aaf1a6d5c3c99c8b0cc9c46e56415087721 100644 (file)
@@ -3,5 +3,5 @@
  the iniparser source code
  --metze
 */
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #include "iniparser/src/iniparser.c"
index 685ec8e04db28961c506e24a82030bb99586417b..4ea95b73ae03f509f0703715dfdc78f4f5be4469 100644 (file)
@@ -3,5 +3,5 @@
  the iniparser source code
  --metze
 */
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #include "iniparser/src/strlib.c"
index dd857ae6722f31bc62de29318e7d8503ef6ea05c..4567fe457b83b0cc083aa22006606dc4d513ff37 100644 (file)
@@ -86,7 +86,7 @@
 
 #define SOCKET_WRAPPER_NOT_REPLACE
 #include "interfaces.h"
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 
 /****************************************************************************
  Utility functions.
index 42f3dc242122eb2309f9f4887e428c406e577271..486d948fa0ed766974d93d809ccc47f6ecbc0d05 100644 (file)
@@ -6,7 +6,7 @@
 #if (_SAMBA_BUILD_ >= 4)
 #include "lib/tdb/include/tdb.h"
 #elif defined(_SAMBA_BUILD_)
-#include "tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #else
 #include "tdb.h"
 #endif
diff --git a/source3/lib/nss_wrapper/config.m4 b/source3/lib/nss_wrapper/config.m4
deleted file mode 100644 (file)
index 58e94f9..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-AC_ARG_ENABLE(nss-wrapper,
-[  --enable-nss-wrapper         Turn on nss wrapper library (default=no)])
-
-HAVE_NSS_WRAPPER=no
-
-if eval "test x$developer = xyes"; then
-       enable_nss_wrapper=yes
-fi
-
-if eval "test x$enable_nss_wrapper = xyes"; then
-        AC_DEFINE(NSS_WRAPPER,1,[Use nss wrapper library])
-       HAVE_NSS_WRAPPER=yes
-
-       # this is only used for samba3
-       NSS_WRAPPER_OBJS="lib/nss_wrapper/nss_wrapper.o"
-fi
-
-AC_SUBST(HAVE_NSS_WRAPPER)
-AC_SUBST(NSS_WRAPPER_OBJS)
diff --git a/source3/lib/nss_wrapper/config.mk b/source3/lib/nss_wrapper/config.mk
deleted file mode 100644 (file)
index 9751d2b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-##############################
-# Start SUBSYSTEM NSS_WRAPPER
-[LIBRARY::NSS_WRAPPER]
-VERSION = 0.0.1
-SO_VERSION = 0
-DESCRIPTION = Wrapper library for testing nss calls without being root
-PUBLIC_HEADERS = nss_wrapper.h
-OBJ_FILES = nss_wrapper.o
-# End SUBSYSTEM NSS_WRAPPER
-##############################
diff --git a/source3/lib/replace/getaddrinfo.h b/source3/lib/replace/getaddrinfo.h
deleted file mode 100644 (file)
index dddd699..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-PostgreSQL Database Management System
-(formerly known as Postgres, then as Postgres95)
-
-Portions Copyright (c) 1996-2005, The PostgreSQL Global Development Group
-
-Portions Copyright (c) 1994, The Regents of the University of California
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose, without fee, and without a written agreement
-is hereby granted, provided that the above copyright notice and this paragraph
-and the following two paragraphs appear in all copies.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
-DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
-LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
-EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
-ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
-TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-*/
-
-/*-------------------------------------------------------------------------
- *
- * getaddrinfo.h
- *       Support getaddrinfo() on platforms that don't have it.
- *
- * Note: we use our own routines on platforms that don't HAVE_STRUCT_ADDRINFO,
- * whether or not the library routine getaddrinfo() can be found.  This
- * policy is needed because on some platforms a manually installed libbind.a
- * may provide getaddrinfo(), yet the system headers may not provide the
- * struct definitions needed to call it.  To avoid conflict with the libbind
- * definition in such cases, we rename our routines to pg_xxx() via macros.
- *
-
-in lib/replace we use rep_xxx()
-
- * This code will also work on platforms where struct addrinfo is defined
- * in the system headers but no getaddrinfo() can be located.
- *
- * Copyright (c) 2003-2007, PostgreSQL Global Development Group
- *
- *-------------------------------------------------------------------------
- */
-#ifndef GETADDRINFO_H
-#define GETADDRINFO_H
-
-#ifndef HAVE_GETADDRINFO
-
-/* Rename private copies per comments above */
-#ifdef getaddrinfo
-#undef getaddrinfo
-#endif
-#define getaddrinfo rep_getaddrinfo
-#define HAVE_GETADDRINFO
-
-#ifdef freeaddrinfo
-#undef freeaddrinfo
-#endif
-#define freeaddrinfo rep_freeaddrinfo
-#define HAVE_FREEADDRINFO
-
-#ifdef gai_strerror
-#undef gai_strerror
-#endif
-#define gai_strerror rep_gai_strerror
-#define HAVE_GAI_STRERROR
-
-#ifdef getnameinfo
-#undef getnameinfo
-#endif
-#define getnameinfo rep_getnameinfo
-#define HAVE_GETNAMEINFO
-
-extern int rep_getaddrinfo(const char *node, const char *service,
-                       const struct addrinfo * hints, struct addrinfo ** res);
-extern void rep_freeaddrinfo(struct addrinfo * res);
-extern const char *rep_gai_strerror(int errcode);
-extern int rep_getnameinfo(const struct sockaddr * sa, socklen_t salen,
-                       char *node, size_t nodelen,
-                       char *service, size_t servicelen, int flags);
-#endif   /* HAVE_GETADDRINFO */
-
-#endif   /* GETADDRINFO_H */
diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h
deleted file mode 100644 (file)
index 077892a..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-#ifndef _system_network_h
-#define _system_network_h
-/* 
-   Unix SMB/CIFS implementation.
-
-   networking system include wrappers
-
-   Copyright (C) Andrew Tridgell 2004
-   Copyright (C) Jelmer Vernooij 2007
-   
-     ** NOTE! The following LGPL license applies to the replace
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 3 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef LIBREPLACE_NETWORK_CHECKS
-#error "AC_LIBREPLACE_NETWORK_CHECKS missing in configure"
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_UNIXSOCKET
-#include <sys/un.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
-
-/*
- * The next three defines are needed to access the IPTOS_* options
- * on some systems.
- */
-
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_IP_H
-#include <netinet/in_ip.h>
-#endif
-
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-
-#ifdef HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-
-#ifdef HAVE_STROPTS_H
-#include <stropts.h>
-#endif
-
-#ifndef HAVE_SOCKLEN_T
-#define HAVE_SOCKLEN_T
-typedef int socklen_t;
-#endif
-
-#if !defined (HAVE_INET_NTOA) || defined(REPLACE_INET_NTOA)
-/* define is in "replace.h" */
-char *rep_inet_ntoa(struct in_addr ip);
-#endif
-
-#ifndef HAVE_INET_PTON
-/* define is in "replace.h" */
-int rep_inet_pton(int af, const char *src, void *dst);
-#endif
-
-#ifndef HAVE_INET_NTOP
-/* define is in "replace.h" */
-const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
-#endif
-
-#ifndef HAVE_INET_ATON
-/* define is in "replace.h" */
-int rep_inet_aton(const char *src, struct in_addr *dst);
-#endif
-
-#ifndef HAVE_CONNECT
-/* define is in "replace.h" */
-int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
-#endif
-
-#ifndef HAVE_GETHOSTBYNAME
-/* define is in "replace.h" */
-struct hostent *rep_gethostbyname(const char *name);
-#endif
-
-#ifdef HAVE_IFADDRS_H
-#include <ifaddrs.h>
-#endif
-
-#ifndef HAVE_STRUCT_IFADDRS
-struct ifaddrs {
-       struct ifaddrs   *ifa_next;         /* Pointer to next struct */
-       char             *ifa_name;         /* Interface name */
-       unsigned int     ifa_flags;         /* Interface flags */
-       struct sockaddr  *ifa_addr;         /* Interface address */
-       struct sockaddr  *ifa_netmask;      /* Interface netmask */
-#undef ifa_dstaddr
-       struct sockaddr  *ifa_dstaddr;      /* P2P interface destination */
-       void             *ifa_data;         /* Address specific data */
-};
-#endif
-
-#ifndef HAVE_GETIFADDRS
-int rep_getifaddrs(struct ifaddrs **);
-#endif
-
-#ifndef HAVE_FREEIFADDRS
-void rep_freeifaddrs(struct ifaddrs *);
-#endif
-
-#ifndef HAVE_SOCKETPAIR
-/* define is in "replace.h" */
-int rep_socketpair(int d, int type, int protocol, int sv[2]);
-#endif
-
-/*
- * Some systems have getaddrinfo but not the
- * defines needed to use it.
- */
-
-/* Various macros that ought to be in <netdb.h>, but might not be */
-
-#ifndef EAI_FAIL
-#define EAI_BADFLAGS   (-1)
-#define EAI_NONAME     (-2)
-#define EAI_AGAIN      (-3)
-#define EAI_FAIL       (-4)
-#define EAI_FAMILY     (-6)
-#define EAI_SOCKTYPE   (-7)
-#define EAI_SERVICE    (-8)
-#define EAI_MEMORY     (-10)
-#define EAI_SYSTEM     (-11)
-#endif   /* !EAI_FAIL */
-
-#ifndef AI_PASSIVE
-#define AI_PASSIVE     0x0001
-#endif
-
-#ifndef AI_CANONNAME
-#define AI_CANONNAME   0x0002
-#endif
-
-#ifndef AI_NUMERICHOST
-/*
- * some platforms don't support AI_NUMERICHOST; define as zero if using
- * the system version of getaddrinfo...
- */
-#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
-#define AI_NUMERICHOST 0
-#else
-#define AI_NUMERICHOST 0x0004
-#endif
-#endif
-
-#ifndef AI_ADDRCONFIG
-/*
- * logic copied from AI_NUMERICHOST
- */
-#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
-#define AI_ADDRCONFIG  0
-#else
-#define AI_ADDRCONFIG  0x0020
-#endif
-#endif
-
-#ifndef AI_NUMERICSERV
-/*
- * logic copied from AI_NUMERICHOST
- */
-#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
-#define AI_NUMERICSERV 0
-#else
-#define AI_NUMERICSERV 0x0400
-#endif
-#endif
-
-#ifndef NI_NUMERICHOST
-#define NI_NUMERICHOST 1
-#endif
-
-#ifndef NI_NUMERICSERV
-#define NI_NUMERICSERV 2
-#endif
-
-#ifndef NI_NOFQDN
-#define NI_NOFQDN      4
-#endif
-
-#ifndef NI_NAMEREQD
-#define NI_NAMEREQD    8
-#endif
-
-#ifndef NI_DGRAM
-#define NI_DGRAM       16
-#endif
-
-
-#ifndef NI_MAXHOST
-#define NI_MAXHOST     1025
-#endif
-
-#ifndef NI_MAXSERV
-#define NI_MAXSERV     32
-#endif
-
-/*
- * glibc on linux doesn't seem to have MSG_WAITALL
- * defined. I think the kernel has it though..
- */
-#ifndef MSG_WAITALL
-#define MSG_WAITALL 0
-#endif
-
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7f000001
-#endif
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT EINVAL
-#endif
-
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
-#endif
-
-#ifndef INET6_ADDRSTRLEN
-#define INET6_ADDRSTRLEN 46
-#endif
-
-#ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 256
-#endif
-
-#ifndef HAVE_SA_FAMILY_T
-#define HAVE_SA_FAMILY_T
-typedef unsigned short int sa_family_t;
-#endif
-
-#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
-#define HAVE_STRUCT_SOCKADDR_STORAGE
-#ifdef HAVE_STRUCT_SOCKADDR_IN6
-#define sockaddr_storage sockaddr_in6
-#define ss_family sin6_family
-#define HAVE_SS_FAMILY 1
-#else
-#define sockaddr_storage sockaddr_in
-#define ss_family sin_family
-#define HAVE_SS_FAMILY 1
-#endif
-#endif
-
-#ifndef HAVE_SS_FAMILY
-#ifdef HAVE___SS_FAMILY
-#define ss_family __ss_family
-#define HAVE_SS_FAMILY 1
-#endif
-#endif
-
-#ifndef HAVE_STRUCT_ADDRINFO
-#define HAVE_STRUCT_ADDRINFO
-struct addrinfo {
-       int                     ai_flags;
-       int                     ai_family;
-       int                     ai_socktype;
-       int                     ai_protocol;
-       socklen_t               ai_addrlen;
-       struct sockaddr         *ai_addr;
-       char                    *ai_canonname;
-       struct addrinfo         *ai_next;
-};
-#endif   /* HAVE_STRUCT_ADDRINFO */
-
-#if !defined(HAVE_GETADDRINFO)
-#include "getaddrinfo.h"
-#endif
-
-/* Needed for some systems that don't define it (Solaris). */
-#ifndef ifr_netmask
-#define ifr_netmask ifr_addr
-#endif
-
-#ifdef SOCKET_WRAPPER
-#ifndef SOCKET_WRAPPER_NOT_REPLACE
-#define SOCKET_WRAPPER_REPLACE
-#endif
-#include "lib/socket_wrapper/socket_wrapper.h"
-#endif
-
-#endif
diff --git a/source3/lib/replace/system/passwd.h b/source3/lib/replace/system/passwd.h
deleted file mode 100644 (file)
index cad3197..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef _system_passwd_h
-#define _system_passwd_h
-
-/* 
-   Unix SMB/CIFS implementation.
-
-   passwd system include wrappers
-
-   Copyright (C) Andrew Tridgell 2004
-   
-     ** NOTE! The following LGPL license applies to the replace
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 3 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-/* this needs to be included before nss_wrapper.h on some systems */
-#include <unistd.h>
-
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-#ifdef HAVE_GRP_H
-#include <grp.h>
-#endif
-#ifdef HAVE_SYS_PRIV_H
-#include <sys/priv.h>
-#endif
-#ifdef HAVE_SYS_ID_H
-#include <sys/id.h>
-#endif
-
-#ifdef HAVE_CRYPT_H
-#include <crypt.h>
-#endif
-
-#ifdef HAVE_SHADOW_H
-#include <shadow.h>
-#endif
-
-#ifdef HAVE_SYS_SECURITY_H
-#include <sys/security.h>
-#include <prot.h>
-#define PASSWORD_LENGTH 16
-#endif  /* HAVE_SYS_SECURITY_H */
-
-#ifdef HAVE_GETPWANAM
-#include <sys/label.h>
-#include <sys/audit.h>
-#include <pwdadj.h>
-#endif
-
-#ifdef HAVE_COMPAT_H
-#include <compat.h>
-#endif
-
-#ifdef REPLACE_GETPASS
-#if defined(REPLACE_GETPASS_BY_GETPASSPHRASE)
-#define getpass(prompt) getpassphrase(prompt)
-#else
-#define getpass(prompt) rep_getpass(prompt)
-char *rep_getpass(const char *prompt);
-#endif
-#endif
-
-#ifndef NGROUPS_MAX
-#define NGROUPS_MAX 32 /* Guess... */
-#endif
-
-/* what is the longest significant password available on your system? 
- Knowing this speeds up password searches a lot */
-#ifndef PASSWORD_LENGTH
-#define PASSWORD_LENGTH 8
-#endif
-
-#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
-#define OSF1_ENH_SEC 1
-#endif
-
-#ifndef ALLOW_CHANGE_PASSWORD
-#if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
-#define ALLOW_CHANGE_PASSWORD 1
-#endif
-#endif
-
-#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
-#define ULTRIX_AUTH 1
-#endif
-
-#ifdef NSS_WRAPPER
-#ifndef NSS_WRAPPER_NOT_REPLACE
-#define NSS_WRAPPER_REPLACE
-#endif
-#include "lib/nss_wrapper/nss_wrapper.h"
-#endif
-
-#endif
diff --git a/source3/lib/socket_wrapper/config.m4 b/source3/lib/socket_wrapper/config.m4
deleted file mode 100644 (file)
index f3ffb89..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-AC_ARG_ENABLE(socket-wrapper, 
-[  --enable-socket-wrapper         Turn on socket wrapper library (default=no)])
-
-DEFAULT_TEST_OPTIONS=
-HAVE_SOCKET_WRAPPER=no
-
-if eval "test x$developer = xyes"; then
-       enable_socket_wrapper=yes
-fi
-    
-if eval "test x$enable_socket_wrapper = xyes"; then
-        AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library])
-       DEFAULT_TEST_OPTIONS=--socket-wrapper
-       HAVE_SOCKET_WRAPPER=yes
-
-       # this is only used for samba3
-       SOCKET_WRAPPER_OBJS="lib/socket_wrapper/socket_wrapper.o"
-fi
-
-AC_SUBST(DEFAULT_TEST_OPTIONS)
-AC_SUBST(HAVE_SOCKET_WRAPPER)
-AC_SUBST(SOCKET_WRAPPER_OBJS)
diff --git a/source3/lib/socket_wrapper/socket_wrapper.c b/source3/lib/socket_wrapper/socket_wrapper.c
deleted file mode 100644 (file)
index 33e4b38..0000000
+++ /dev/null
@@ -1,1841 +0,0 @@
-/*
- * Copyright (C) Jelmer Vernooij 2005,2008 <jelmer@samba.org>
- * Copyright (C) Stefan Metzmacher 2006 <metze@samba.org>
- *
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * 3. Neither the name of the author nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-/*
-   Socket wrapper library. Passes all socket communication over
-   unix domain sockets if the environment variable SOCKET_WRAPPER_DIR
-   is set.
-*/
-
-#ifdef _SAMBA_BUILD_
-
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "lib/replace/replace.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "system/time.h"
-
-#else /* _SAMBA_BUILD_ */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/filio.h>
-#include <errno.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdint.h>
-
-#endif
-
-#ifndef _PUBLIC_
-#define _PUBLIC_
-#endif
-
-#define SWRAP_DLIST_ADD(list,item) do { \
-       if (!(list)) { \
-               (item)->prev    = NULL; \
-               (item)->next    = NULL; \
-               (list)          = (item); \
-       } else { \
-               (item)->prev    = NULL; \
-               (item)->next    = (list); \
-               (list)->prev    = (item); \
-               (list)          = (item); \
-       } \
-} while (0)
-
-#define SWRAP_DLIST_REMOVE(list,item) do { \
-       if ((list) == (item)) { \
-               (list)          = (item)->next; \
-               if (list) { \
-                       (list)->prev    = NULL; \
-               } \
-       } else { \
-               if ((item)->prev) { \
-                       (item)->prev->next      = (item)->next; \
-               } \
-               if ((item)->next) { \
-                       (item)->next->prev      = (item)->prev; \
-               } \
-       } \
-       (item)->prev    = NULL; \
-       (item)->next    = NULL; \
-} while (0)
-
-/* LD_PRELOAD doesn't work yet, so REWRITE_CALLS is all we support
- * for now */
-#define REWRITE_CALLS 
-
-#ifdef REWRITE_CALLS
-#define real_accept accept
-#define real_connect connect
-#define real_bind bind
-#define real_listen listen
-#define real_getpeername getpeername
-#define real_getsockname getsockname
-#define real_getsockopt getsockopt
-#define real_setsockopt setsockopt
-#define real_recvfrom recvfrom
-#define real_sendto sendto
-#define real_ioctl ioctl
-#define real_recv recv
-#define real_send send
-#define real_socket socket
-#define real_close close
-#endif
-
-#ifdef HAVE_GETTIMEOFDAY_TZ
-#define swrapGetTimeOfDay(tval) gettimeofday(tval,NULL)
-#else
-#define swrapGetTimeOfDay(tval)        gettimeofday(tval)
-#endif
-
-/* we need to use a very terse format here as IRIX 6.4 silently
-   truncates names to 16 chars, so if we use a longer name then we
-   can't tell which port a packet came from with recvfrom() 
-   
-   with this format we have 8 chars left for the directory name
-*/
-#define SOCKET_FORMAT "%c%02X%04X"
-#define SOCKET_TYPE_CHAR_TCP           'T'
-#define SOCKET_TYPE_CHAR_UDP           'U'
-#define SOCKET_TYPE_CHAR_TCP_V6                'X'
-#define SOCKET_TYPE_CHAR_UDP_V6                'Y'
-
-#define MAX_WRAPPED_INTERFACES 16
-
-#define SW_IPV6_ADDRESS 1
-
-static struct sockaddr *sockaddr_dup(const void *data, socklen_t len)
-{
-       struct sockaddr *ret = (struct sockaddr *)malloc(len);
-       memcpy(ret, data, len);
-       return ret;
-}
-
-static void set_port(int family, int prt, struct sockaddr *addr)
-{
-       switch (family) {
-       case AF_INET:
-               ((struct sockaddr_in *)addr)->sin_port = htons(prt);
-               break;
-#ifdef HAVE_IPV6
-       case AF_INET6:
-               ((struct sockaddr_in6 *)addr)->sin6_port = htons(prt);
-               break;
-#endif
-       }
-}
-
-static size_t socket_length(int family)
-{
-       switch (family) {
-       case AF_INET:
-               return sizeof(struct sockaddr_in);
-#ifdef HAVE_IPV6
-       case AF_INET6:
-               return sizeof(struct sockaddr_in6);
-#endif
-       }
-       return 0;
-}
-
-
-
-struct socket_info
-{
-       int fd;
-
-       int family;
-       int type;
-       int protocol;
-       int bound;
-       int bcast;
-       int is_server;
-
-       char *path;
-       char *tmp_path;
-
-       struct sockaddr *myname;
-       socklen_t myname_len;
-
-       struct sockaddr *peername;
-       socklen_t peername_len;
-
-       struct {
-               unsigned long pck_snd;
-               unsigned long pck_rcv;
-       } io;
-
-       struct socket_info *prev, *next;
-};
-
-static struct socket_info *sockets;
-
-const char *socket_wrapper_dir(void)
-{
-       const char *s = getenv("SOCKET_WRAPPER_DIR");
-       if (s == NULL) {
-               return NULL;
-       }
-       if (strncmp(s, "./", 2) == 0) {
-               s += 2;
-       }
-       return s;
-}
-
-unsigned int socket_wrapper_default_iface(void)
-{
-       const char *s = getenv("SOCKET_WRAPPER_DEFAULT_IFACE");
-       if (s) {
-               unsigned int iface;
-               if (sscanf(s, "%u", &iface) == 1) {
-                       if (iface >= 1 && iface <= MAX_WRAPPED_INTERFACES) {
-                               return iface;
-                       }
-               }
-       }
-
-       return 1;/* 127.0.0.1 */
-}
-
-static int convert_un_in(const struct sockaddr_un *un, struct sockaddr *in, socklen_t *len)
-{
-       unsigned int iface;
-       unsigned int prt;
-       const char *p;
-       char type;
-
-       p = strrchr(un->sun_path, '/');
-       if (p) p++; else p = un->sun_path;
-
-       if (sscanf(p, SOCKET_FORMAT, &type, &iface, &prt) != 3) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       if (iface == 0 || iface > MAX_WRAPPED_INTERFACES) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       if (prt > 0xFFFF) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       switch(type) {
-       case SOCKET_TYPE_CHAR_TCP:
-       case SOCKET_TYPE_CHAR_UDP: {
-               struct sockaddr_in *in2 = (struct sockaddr_in *)in;
-               
-               if ((*len) < sizeof(*in2)) {
-                   errno = EINVAL;
-                   return -1;
-               }
-
-               memset(in2, 0, sizeof(*in2));
-               in2->sin_family = AF_INET;
-               in2->sin_addr.s_addr = htonl((127<<24) | iface);
-               in2->sin_port = htons(prt);
-
-               *len = sizeof(*in2);
-               break;
-       }
-#ifdef HAVE_IPV6
-       case SOCKET_TYPE_CHAR_TCP_V6:
-       case SOCKET_TYPE_CHAR_UDP_V6: {
-               struct sockaddr_in6 *in2 = (struct sockaddr_in6 *)in;
-               
-               if ((*len) < sizeof(*in2)) {
-                       errno = EINVAL;
-                       return -1;
-               }
-
-               memset(in2, 0, sizeof(*in2));
-               in2->sin6_family = AF_INET6;
-               in2->sin6_addr.s6_addr[0] = SW_IPV6_ADDRESS;
-               in2->sin6_port = htons(prt);
-
-               *len = sizeof(*in2);
-               break;
-       }
-#endif
-       default:
-               errno = EINVAL;
-               return -1;
-       }
-
-       return 0;
-}
-
-static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *inaddr, struct sockaddr_un *un,
-                               int *bcast)
-{
-       char type = '\0';
-       unsigned int prt;
-       unsigned int iface;
-       int is_bcast = 0;
-
-       if (bcast) *bcast = 0;
-
-       switch (si->family) {
-       case AF_INET: {
-               const struct sockaddr_in *in = 
-                   (const struct sockaddr_in *)inaddr;
-               unsigned int addr = ntohl(in->sin_addr.s_addr);
-               char u_type = '\0';
-               char b_type = '\0';
-               char a_type = '\0';
-
-               switch (si->type) {
-               case SOCK_STREAM:
-                       u_type = SOCKET_TYPE_CHAR_TCP;
-                       break;
-               case SOCK_DGRAM:
-                       u_type = SOCKET_TYPE_CHAR_UDP;
-                       a_type = SOCKET_TYPE_CHAR_UDP;
-                       b_type = SOCKET_TYPE_CHAR_UDP;
-                       break;
-               }
-
-               prt = ntohs(in->sin_port);
-               if (a_type && addr == 0xFFFFFFFF) {
-                       /* 255.255.255.255 only udp */
-                       is_bcast = 2;
-                       type = a_type;
-                       iface = socket_wrapper_default_iface();
-               } else if (b_type && addr == 0x7FFFFFFF) {
-                       /* 127.255.255.255 only udp */
-                       is_bcast = 1;
-                       type = b_type;
-                       iface = socket_wrapper_default_iface();
-               } else if ((addr & 0xFFFFFF00) == 0x7F000000) {
-                       /* 127.0.0.X */
-                       is_bcast = 0;
-                       type = u_type;
-                       iface = (addr & 0x000000FF);
-               } else {
-                       errno = ENETUNREACH;
-                       return -1;
-               }
-               if (bcast) *bcast = is_bcast;
-               break;
-       }
-#ifdef HAVE_IPV6
-       case AF_INET6: {
-               const struct sockaddr_in6 *in = 
-                   (const struct sockaddr_in6 *)inaddr;
-
-               switch (si->type) {
-               case SOCK_STREAM:
-                       type = SOCKET_TYPE_CHAR_TCP_V6;
-                       break;
-               case SOCK_DGRAM:
-                       type = SOCKET_TYPE_CHAR_UDP_V6;
-                       break;
-               }
-
-               /* XXX no multicast/broadcast */
-
-               prt = ntohs(in->sin6_port);
-               iface = SW_IPV6_ADDRESS;
-               
-               break;
-       }
-#endif
-       default:
-               errno = ENETUNREACH;
-               return -1;
-       }
-
-       if (prt == 0) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       if (is_bcast) {
-               snprintf(un->sun_path, sizeof(un->sun_path), "%s/EINVAL", 
-                        socket_wrapper_dir());
-               /* the caller need to do more processing */
-               return 0;
-       }
-
-       snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT, 
-                socket_wrapper_dir(), type, iface, prt);
-
-       return 0;
-}
-
-static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *inaddr, struct sockaddr_un *un,
-                              int *bcast)
-{
-       char type = '\0';
-       unsigned int prt;
-       unsigned int iface;
-       struct stat st;
-       int is_bcast = 0;
-
-       if (bcast) *bcast = 0;
-
-       switch (si->family) {
-       case AF_INET: {
-               const struct sockaddr_in *in = 
-                   (const struct sockaddr_in *)inaddr;
-               unsigned int addr = ntohl(in->sin_addr.s_addr);
-               char u_type = '\0';
-               char d_type = '\0';
-               char b_type = '\0';
-               char a_type = '\0';
-
-               prt = ntohs(in->sin_port);
-
-               switch (si->type) {
-               case SOCK_STREAM:
-                       u_type = SOCKET_TYPE_CHAR_TCP;
-                       d_type = SOCKET_TYPE_CHAR_TCP;
-                       break;
-               case SOCK_DGRAM:
-                       u_type = SOCKET_TYPE_CHAR_UDP;
-                       d_type = SOCKET_TYPE_CHAR_UDP;
-                       a_type = SOCKET_TYPE_CHAR_UDP;
-                       b_type = SOCKET_TYPE_CHAR_UDP;
-                       break;
-               }
-
-               if (addr == 0) {
-                       /* 0.0.0.0 */
-                       is_bcast = 0;
-                       type = d_type;
-                       iface = socket_wrapper_default_iface();
-               } else if (a_type && addr == 0xFFFFFFFF) {
-                       /* 255.255.255.255 only udp */
-                       is_bcast = 2;
-                       type = a_type;
-                       iface = socket_wrapper_default_iface();
-               } else if (b_type && addr == 0x7FFFFFFF) {
-                       /* 127.255.255.255 only udp */
-                       is_bcast = 1;
-                       type = b_type;
-                       iface = socket_wrapper_default_iface();
-               } else if ((addr & 0xFFFFFF00) == 0x7F000000) {
-                       /* 127.0.0.X */
-                       is_bcast = 0;
-                       type = u_type;
-                       iface = (addr & 0x000000FF);
-               } else {
-                       errno = EADDRNOTAVAIL;
-                       return -1;
-               }
-               break;
-       }
-#ifdef HAVE_IPV6
-       case AF_INET6: {
-               const struct sockaddr_in6 *in = 
-                   (const struct sockaddr_in6 *)inaddr;
-
-               switch (si->type) {
-               case SOCK_STREAM:
-                       type = SOCKET_TYPE_CHAR_TCP_V6;
-                       break;
-               case SOCK_DGRAM:
-                       type = SOCKET_TYPE_CHAR_UDP_V6;
-                       break;
-               }
-
-               /* XXX no multicast/broadcast */
-
-               prt = ntohs(in->sin6_port);
-               iface = SW_IPV6_ADDRESS;
-               
-               break;
-       }
-#endif
-       default:
-               errno = ENETUNREACH;
-               return -1;
-       }
-
-
-       if (bcast) *bcast = is_bcast;
-
-       if (prt == 0) {
-               /* handle auto-allocation of ephemeral ports */
-               for (prt = 5001; prt < 10000; prt++) {
-                       snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT, 
-                                socket_wrapper_dir(), type, iface, prt);
-                       if (stat(un->sun_path, &st) == 0) continue;
-
-                       set_port(si->family, prt, si->myname);
-                       break;
-               }
-               if (prt == 10000) {
-                       errno = ENFILE;
-                       return -1;
-               }
-       }
-
-       snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT, 
-                socket_wrapper_dir(), type, iface, prt);
-       return 0;
-}
-
-static struct socket_info *find_socket_info(int fd)
-{
-       struct socket_info *i;
-       for (i = sockets; i; i = i->next) {
-               if (i->fd == fd) 
-                       return i;
-       }
-
-       return NULL;
-}
-
-static int sockaddr_convert_to_un(struct socket_info *si, const struct sockaddr *in_addr, socklen_t in_len, 
-                                 struct sockaddr_un *out_addr, int alloc_sock, int *bcast)
-{
-       if (!out_addr)
-               return 0;
-
-       out_addr->sun_family = AF_UNIX;
-
-       switch (in_addr->sa_family) {
-       case AF_INET:
-#ifdef HAVE_IPV6
-       case AF_INET6:
-#endif
-               switch (si->type) {
-               case SOCK_STREAM:
-               case SOCK_DGRAM:
-                       break;
-               default:
-                       errno = ESOCKTNOSUPPORT;
-                       return -1;
-               }
-               if (alloc_sock) {
-                       return convert_in_un_alloc(si, in_addr, out_addr, bcast);
-               } else {
-                       return convert_in_un_remote(si, in_addr, out_addr, bcast);
-               }
-       default:
-               break;
-       }
-       
-       errno = EAFNOSUPPORT;
-       return -1;
-}
-
-static int sockaddr_convert_from_un(const struct socket_info *si, 
-                                   const struct sockaddr_un *in_addr, 
-                                   socklen_t un_addrlen,
-                                   int family,
-                                   struct sockaddr *out_addr,
-                                   socklen_t *out_addrlen)
-{
-       if (out_addr == NULL || out_addrlen == NULL) 
-               return 0;
-
-       if (un_addrlen == 0) {
-               *out_addrlen = 0;
-               return 0;
-       }
-
-       switch (family) {
-       case AF_INET:
-#ifdef HAVE_IPV6
-       case AF_INET6:
-#endif
-               switch (si->type) {
-               case SOCK_STREAM:
-               case SOCK_DGRAM:
-                       break;
-               default:
-                       errno = ESOCKTNOSUPPORT;
-                       return -1;
-               }
-               return convert_un_in(in_addr, out_addr, out_addrlen);
-       default:
-               break;
-       }
-
-       errno = EAFNOSUPPORT;
-       return -1;
-}
-
-enum swrap_packet_type {
-       SWRAP_CONNECT_SEND,
-       SWRAP_CONNECT_UNREACH,
-       SWRAP_CONNECT_RECV,
-       SWRAP_CONNECT_ACK,
-       SWRAP_ACCEPT_SEND,
-       SWRAP_ACCEPT_RECV,
-       SWRAP_ACCEPT_ACK,
-       SWRAP_RECVFROM,
-       SWRAP_SENDTO,
-       SWRAP_SENDTO_UNREACH,
-       SWRAP_PENDING_RST,
-       SWRAP_RECV,
-       SWRAP_RECV_RST,
-       SWRAP_SEND,
-       SWRAP_SEND_RST,
-       SWRAP_CLOSE_SEND,
-       SWRAP_CLOSE_RECV,
-       SWRAP_CLOSE_ACK
-};
-
-struct swrap_file_hdr {
-       uint32_t        magic;
-       uint16_t        version_major;
-       uint16_t        version_minor;
-       int32_t         timezone;
-       uint32_t        sigfigs;
-       uint32_t        frame_max_len;
-#define SWRAP_FRAME_LENGTH_MAX 0xFFFF
-       uint32_t        link_type;
-};
-#define SWRAP_FILE_HDR_SIZE 24
-
-struct swrap_packet {
-       struct {
-               uint32_t seconds;
-               uint32_t micro_seconds;
-               uint32_t recorded_length;
-               uint32_t full_length;
-       } frame;
-#define SWRAP_PACKET__FRAME_SIZE 16
-
-       struct {
-               struct {
-                       uint8_t         ver_hdrlen;
-                       uint8_t         tos;
-                       uint16_t        packet_length;
-                       uint16_t        identification;
-                       uint8_t         flags;
-                       uint8_t         fragment;
-                       uint8_t         ttl;
-                       uint8_t         protocol;
-                       uint16_t        hdr_checksum;
-                       uint32_t        src_addr;
-                       uint32_t        dest_addr;
-               } hdr;
-#define SWRAP_PACKET__IP_HDR_SIZE 20
-
-               union {
-                       struct {
-                               uint16_t        source_port;
-                               uint16_t        dest_port;
-                               uint32_t        seq_num;
-                               uint32_t        ack_num;
-                               uint8_t         hdr_length;
-                               uint8_t         control;
-                               uint16_t        window;
-                               uint16_t        checksum;
-                               uint16_t        urg;
-                       } tcp;
-#define SWRAP_PACKET__IP_P_TCP_SIZE 20
-                       struct {
-                               uint16_t        source_port;
-                               uint16_t        dest_port;
-                               uint16_t        length;
-                               uint16_t        checksum;
-                       } udp;
-#define SWRAP_PACKET__IP_P_UDP_SIZE 8
-                       struct {
-                               uint8_t         type;
-                               uint8_t         code;
-                               uint16_t        checksum;
-                               uint32_t        unused;
-                       } icmp;
-#define SWRAP_PACKET__IP_P_ICMP_SIZE 8
-               } p;
-       } ip;
-};
-#define SWRAP_PACKET_SIZE 56
-
-static const char *socket_wrapper_pcap_file(void)
-{
-       static int initialized = 0;
-       static const char *s = NULL;
-       static const struct swrap_file_hdr h = { 0, };
-       static const struct swrap_packet p = { { 0, }, { { 0, }, { { 0, } } } };
-
-       if (initialized == 1) {
-               return s;
-       }
-       initialized = 1;
-
-       /*
-        * TODO: don't use the structs use plain buffer offsets
-        *       and PUSH_U8(), PUSH_U16() and PUSH_U32()
-        * 
-        * for now make sure we disable PCAP support
-        * if the struct has alignment!
-        */
-       if (sizeof(h) != SWRAP_FILE_HDR_SIZE) {
-               return NULL;
-       }
-       if (sizeof(p) != SWRAP_PACKET_SIZE) {
-               return NULL;
-       }
-       if (sizeof(p.frame) != SWRAP_PACKET__FRAME_SIZE) {
-               return NULL;
-       }
-       if (sizeof(p.ip.hdr) != SWRAP_PACKET__IP_HDR_SIZE) {
-               return NULL;
-       }
-       if (sizeof(p.ip.p.tcp) != SWRAP_PACKET__IP_P_TCP_SIZE) {
-               return NULL;
-       }
-       if (sizeof(p.ip.p.udp) != SWRAP_PACKET__IP_P_UDP_SIZE) {
-               return NULL;
-       }
-       if (sizeof(p.ip.p.icmp) != SWRAP_PACKET__IP_P_ICMP_SIZE) {
-               return NULL;
-       }
-
-       s = getenv("SOCKET_WRAPPER_PCAP_FILE");
-       if (s == NULL) {
-               return NULL;
-       }
-       if (strncmp(s, "./", 2) == 0) {
-               s += 2;
-       }
-       return s;
-}
-
-static struct swrap_packet *swrap_packet_init(struct timeval *tval,
-                                             const struct sockaddr_in *src_addr,
-                                             const struct sockaddr_in *dest_addr,
-                                             int socket_type,
-                                             const unsigned char *payload,
-                                             size_t payload_len,
-                                             unsigned long tcp_seqno,
-                                             unsigned long tcp_ack,
-                                             unsigned char tcp_ctl,
-                                             int unreachable,
-                                             size_t *_packet_len)
-{
-       struct swrap_packet *ret;
-       struct swrap_packet *packet;
-       size_t packet_len;
-       size_t alloc_len;
-       size_t nonwire_len = sizeof(packet->frame);
-       size_t wire_hdr_len = 0;
-       size_t wire_len = 0;
-       size_t icmp_hdr_len = 0;
-       size_t icmp_truncate_len = 0;
-       unsigned char protocol = 0, icmp_protocol = 0;
-       unsigned short src_port = src_addr->sin_port;
-       unsigned short dest_port = dest_addr->sin_port;
-
-       switch (socket_type) {
-       case SOCK_STREAM:
-               protocol = 0x06; /* TCP */
-               wire_hdr_len = sizeof(packet->ip.hdr) + sizeof(packet->ip.p.tcp);
-               wire_len = wire_hdr_len + payload_len;
-               break;
-
-       case SOCK_DGRAM:
-               protocol = 0x11; /* UDP */
-               wire_hdr_len = sizeof(packet->ip.hdr) + sizeof(packet->ip.p.udp);
-               wire_len = wire_hdr_len + payload_len;
-               break;
-
-       default:
-               return NULL;
-       }
-
-       if (unreachable) {
-               icmp_protocol = protocol;
-               protocol = 0x01; /* ICMP */
-               if (wire_len > 64 ) {
-                       icmp_truncate_len = wire_len - 64;
-               }
-               icmp_hdr_len = sizeof(packet->ip.hdr) + sizeof(packet->ip.p.icmp);
-               wire_hdr_len += icmp_hdr_len;
-               wire_len += icmp_hdr_len;
-       }
-
-       packet_len = nonwire_len + wire_len;
-       alloc_len = packet_len;
-       if (alloc_len < sizeof(struct swrap_packet)) {
-               alloc_len = sizeof(struct swrap_packet);
-       }
-       ret = (struct swrap_packet *)malloc(alloc_len);
-       if (!ret) return NULL;
-
-       packet = ret;
-
-       packet->frame.seconds           = tval->tv_sec;
-       packet->frame.micro_seconds     = tval->tv_usec;
-       packet->frame.recorded_length   = wire_len - icmp_truncate_len;
-       packet->frame.full_length       = wire_len - icmp_truncate_len;
-
-       packet->ip.hdr.ver_hdrlen       = 0x45; /* version 4 and 5 * 32 bit words */
-       packet->ip.hdr.tos              = 0x00;
-       packet->ip.hdr.packet_length    = htons(wire_len - icmp_truncate_len);
-       packet->ip.hdr.identification   = htons(0xFFFF);
-       packet->ip.hdr.flags            = 0x40; /* BIT 1 set - means don't fraqment */
-       packet->ip.hdr.fragment         = htons(0x0000);
-       packet->ip.hdr.ttl              = 0xFF;
-       packet->ip.hdr.protocol         = protocol;
-       packet->ip.hdr.hdr_checksum     = htons(0x0000);
-       packet->ip.hdr.src_addr         = src_addr->sin_addr.s_addr;
-       packet->ip.hdr.dest_addr        = dest_addr->sin_addr.s_addr;
-
-       if (unreachable) {
-               packet->ip.p.icmp.type          = 0x03; /* destination unreachable */
-               packet->ip.p.icmp.code          = 0x01; /* host unreachable */
-               packet->ip.p.icmp.checksum      = htons(0x0000);
-               packet->ip.p.icmp.unused        = htonl(0x00000000);
-
-               /* set the ip header in the ICMP payload */
-               packet = (struct swrap_packet *)(((unsigned char *)ret) + icmp_hdr_len);
-               packet->ip.hdr.ver_hdrlen       = 0x45; /* version 4 and 5 * 32 bit words */
-               packet->ip.hdr.tos              = 0x00;
-               packet->ip.hdr.packet_length    = htons(wire_len - icmp_hdr_len);
-               packet->ip.hdr.identification   = htons(0xFFFF);
-               packet->ip.hdr.flags            = 0x40; /* BIT 1 set - means don't fraqment */
-               packet->ip.hdr.fragment         = htons(0x0000);
-               packet->ip.hdr.ttl              = 0xFF;
-               packet->ip.hdr.protocol         = icmp_protocol;
-               packet->ip.hdr.hdr_checksum     = htons(0x0000);
-               packet->ip.hdr.src_addr         = dest_addr->sin_addr.s_addr;
-               packet->ip.hdr.dest_addr        = src_addr->sin_addr.s_addr;
-
-               src_port = dest_addr->sin_port;
-               dest_port = src_addr->sin_port;
-       }
-
-       switch (socket_type) {
-       case SOCK_STREAM:
-               packet->ip.p.tcp.source_port    = src_port;
-               packet->ip.p.tcp.dest_port      = dest_port;
-               packet->ip.p.tcp.seq_num        = htonl(tcp_seqno);
-               packet->ip.p.tcp.ack_num        = htonl(tcp_ack);
-               packet->ip.p.tcp.hdr_length     = 0x50; /* 5 * 32 bit words */
-               packet->ip.p.tcp.control        = tcp_ctl;
-               packet->ip.p.tcp.window         = htons(0x7FFF);
-               packet->ip.p.tcp.checksum       = htons(0x0000);
-               packet->ip.p.tcp.urg            = htons(0x0000);
-
-               break;
-
-       case SOCK_DGRAM:
-               packet->ip.p.udp.source_port    = src_addr->sin_port;
-               packet->ip.p.udp.dest_port      = dest_addr->sin_port;
-               packet->ip.p.udp.length         = htons(8 + payload_len);
-               packet->ip.p.udp.checksum       = htons(0x0000);
-
-               break;
-       }
-
-       if (payload && payload_len > 0) {
-               unsigned char *p = (unsigned char *)ret;
-               p += nonwire_len;
-               p += wire_hdr_len;
-               memcpy(p, payload, payload_len);
-       }
-
-       *_packet_len = packet_len - icmp_truncate_len;
-       return ret;
-}
-
-static int swrap_get_pcap_fd(const char *fname)
-{
-       static int fd = -1;
-
-       if (fd != -1) return fd;
-
-       fd = open(fname, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0644);
-       if (fd != -1) {
-               struct swrap_file_hdr file_hdr;
-               file_hdr.magic          = 0xA1B2C3D4;
-               file_hdr.version_major  = 0x0002;       
-               file_hdr.version_minor  = 0x0004;
-               file_hdr.timezone       = 0x00000000;
-               file_hdr.sigfigs        = 0x00000000;
-               file_hdr.frame_max_len  = SWRAP_FRAME_LENGTH_MAX;
-               file_hdr.link_type      = 0x0065; /* 101 RAW IP */
-
-               write(fd, &file_hdr, sizeof(file_hdr));
-               return fd;
-       }
-
-       fd = open(fname, O_WRONLY|O_APPEND, 0644);
-
-       return fd;
-}
-
-static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
-                                                                 const struct sockaddr *addr,
-                                                                 enum swrap_packet_type type,
-                                                                 const void *buf, size_t len,
-                                                                 size_t *packet_len)
-{
-       const struct sockaddr_in *src_addr;
-       const struct sockaddr_in *dest_addr;
-       unsigned long tcp_seqno = 0;
-       unsigned long tcp_ack = 0;
-       unsigned char tcp_ctl = 0;
-       int unreachable = 0;
-
-       struct timeval tv;
-
-       switch (si->family) {
-       case AF_INET:
-               break;
-       default:
-               return NULL;
-       }
-
-       switch (type) {
-       case SWRAP_CONNECT_SEND:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)addr;
-
-               tcp_seqno = si->io.pck_snd;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x02; /* SYN */
-
-               si->io.pck_snd += 1;
-
-               break;
-
-       case SWRAP_CONNECT_RECV:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)addr;
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x12; /** SYN,ACK */
-
-               si->io.pck_rcv += 1;
-
-               break;
-
-       case SWRAP_CONNECT_UNREACH:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)addr;
-
-               /* Unreachable: resend the data of SWRAP_CONNECT_SEND */
-               tcp_seqno = si->io.pck_snd - 1;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x02; /* SYN */
-               unreachable = 1;
-
-               break;
-
-       case SWRAP_CONNECT_ACK:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)addr;
-
-               tcp_seqno = si->io.pck_snd;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x10; /* ACK */
-
-               break;
-
-       case SWRAP_ACCEPT_SEND:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)addr;
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x02; /* SYN */
-
-               si->io.pck_rcv += 1;
-
-               break;
-
-       case SWRAP_ACCEPT_RECV:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)addr;
-
-               tcp_seqno = si->io.pck_snd;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x12; /* SYN,ACK */
-
-               si->io.pck_snd += 1;
-
-               break;
-
-       case SWRAP_ACCEPT_ACK:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)addr;
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x10; /* ACK */
-
-               break;
-
-       case SWRAP_SEND:
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)si->peername;
-
-               tcp_seqno = si->io.pck_snd;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x18; /* PSH,ACK */
-
-               si->io.pck_snd += len;
-
-               break;
-
-       case SWRAP_SEND_RST:
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)si->peername;
-
-               if (si->type == SOCK_DGRAM) {
-                       return swrap_marshall_packet(si, si->peername,
-                                         SWRAP_SENDTO_UNREACH,
-                                         buf, len, packet_len);
-               }
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x14; /** RST,ACK */
-
-               break;
-
-       case SWRAP_PENDING_RST:
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)si->peername;
-
-               if (si->type == SOCK_DGRAM) {
-                       return NULL;
-               }
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x14; /* RST,ACK */
-
-               break;
-
-       case SWRAP_RECV:
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)si->peername;
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x18; /* PSH,ACK */
-
-               si->io.pck_rcv += len;
-
-               break;
-
-       case SWRAP_RECV_RST:
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)si->peername;
-
-               if (si->type == SOCK_DGRAM) {
-                       return NULL;
-               }
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x14; /* RST,ACK */
-
-               break;
-
-       case SWRAP_SENDTO:
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)addr;
-
-               si->io.pck_snd += len;
-
-               break;
-
-       case SWRAP_SENDTO_UNREACH:
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)addr;
-
-               unreachable = 1;
-
-               break;
-
-       case SWRAP_RECVFROM:
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)addr;
-
-               si->io.pck_rcv += len;
-
-               break;
-
-       case SWRAP_CLOSE_SEND:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)si->peername;
-
-               tcp_seqno = si->io.pck_snd;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x11; /* FIN, ACK */
-
-               si->io.pck_snd += 1;
-
-               break;
-
-       case SWRAP_CLOSE_RECV:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               dest_addr = (const struct sockaddr_in *)si->myname;
-               src_addr = (const struct sockaddr_in *)si->peername;
-
-               tcp_seqno = si->io.pck_rcv;
-               tcp_ack = si->io.pck_snd;
-               tcp_ctl = 0x11; /* FIN,ACK */
-
-               si->io.pck_rcv += 1;
-
-               break;
-
-       case SWRAP_CLOSE_ACK:
-               if (si->type != SOCK_STREAM) return NULL;
-
-               src_addr = (const struct sockaddr_in *)si->myname;
-               dest_addr = (const struct sockaddr_in *)si->peername;
-
-               tcp_seqno = si->io.pck_snd;
-               tcp_ack = si->io.pck_rcv;
-               tcp_ctl = 0x10; /* ACK */
-
-               break;
-       default:
-               return NULL;
-       }
-
-       swrapGetTimeOfDay(&tv);
-
-       return swrap_packet_init(&tv, src_addr, dest_addr, si->type,
-                                  (const unsigned char *)buf, len,
-                                  tcp_seqno, tcp_ack, tcp_ctl, unreachable,
-                                  packet_len);
-}
-
-static void swrap_dump_packet(struct socket_info *si, 
-                                                         const struct sockaddr *addr,
-                                                         enum swrap_packet_type type,
-                                                         const void *buf, size_t len)
-{
-       const char *file_name;
-       struct swrap_packet *packet;
-       size_t packet_len = 0;
-       int fd;
-
-       file_name = socket_wrapper_pcap_file();
-       if (!file_name) {
-               return;
-       }
-
-       packet = swrap_marshall_packet(si, addr, type, buf, len, &packet_len);
-       if (!packet) {
-               return;
-       }
-
-       fd = swrap_get_pcap_fd(file_name);
-       if (fd != -1) {
-               write(fd, packet, packet_len);
-       }
-
-       free(packet);
-}
-
-_PUBLIC_ int swrap_socket(int family, int type, int protocol)
-{
-       struct socket_info *si;
-       int fd;
-
-       if (!socket_wrapper_dir()) {
-               return real_socket(family, type, protocol);
-       }
-
-       switch (family) {
-       case AF_INET:
-#ifdef HAVE_IPV6
-       case AF_INET6:
-#endif
-               break;
-       case AF_UNIX:
-               return real_socket(family, type, protocol);
-       default:
-               errno = EAFNOSUPPORT;
-               return -1;
-       }
-
-       switch (type) {
-       case SOCK_STREAM:
-               break;
-       case SOCK_DGRAM:
-               break;
-       default:
-               errno = EPROTONOSUPPORT;
-               return -1;
-       }
-
-       switch (protocol) {
-       case 0:
-               break;
-       case 6:
-               if (type == SOCK_STREAM) {
-                       break;
-               }
-               /*fall through*/
-       case 17:
-               if (type == SOCK_DGRAM) {
-                       break;
-               }
-               /*fall through*/
-       default:
-               errno = EPROTONOSUPPORT;
-               return -1;
-       }
-
-       fd = real_socket(AF_UNIX, type, 0);
-
-       if (fd == -1) return -1;
-
-       si = (struct socket_info *)calloc(1, sizeof(struct socket_info));
-
-       si->family = family;
-       si->type = type;
-       si->protocol = protocol;
-       si->fd = fd;
-
-       SWRAP_DLIST_ADD(sockets, si);
-
-       return si->fd;
-}
-
-_PUBLIC_ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
-{
-       struct socket_info *parent_si, *child_si;
-       int fd;
-       struct sockaddr_un un_addr;
-       socklen_t un_addrlen = sizeof(un_addr);
-       struct sockaddr_un un_my_addr;
-       socklen_t un_my_addrlen = sizeof(un_my_addr);
-       struct sockaddr *my_addr;
-       socklen_t my_addrlen, len;
-       int ret;
-
-       parent_si = find_socket_info(s);
-       if (!parent_si) {
-               return real_accept(s, addr, addrlen);
-       }
-
-       /* 
-        * assume out sockaddr have the same size as the in parent
-        * socket family
-        */
-       my_addrlen = socket_length(parent_si->family);
-       if (my_addrlen <= 0) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       my_addr = (struct sockaddr *)malloc(my_addrlen);
-       if (my_addr == NULL) {
-               return -1;
-       }
-
-       memset(&un_addr, 0, sizeof(un_addr));
-       memset(&un_my_addr, 0, sizeof(un_my_addr));
-
-       ret = real_accept(s, (struct sockaddr *)&un_addr, &un_addrlen);
-       if (ret == -1) {
-               free(my_addr);
-               return ret;
-       }
-
-       fd = ret;
-
-       len = my_addrlen;
-       ret = sockaddr_convert_from_un(parent_si, &un_addr, un_addrlen,
-                                      parent_si->family, my_addr, &len);
-       if (ret == -1) {
-               free(my_addr);
-               close(fd);
-               return ret;
-       }
-
-       child_si = (struct socket_info *)malloc(sizeof(struct socket_info));
-       memset(child_si, 0, sizeof(*child_si));
-
-       child_si->fd = fd;
-       child_si->family = parent_si->family;
-       child_si->type = parent_si->type;
-       child_si->protocol = parent_si->protocol;
-       child_si->bound = 1;
-       child_si->is_server = 1;
-
-       child_si->peername_len = len;
-       child_si->peername = sockaddr_dup(my_addr, len);
-
-       if (addr != NULL && addrlen != NULL) {
-           *addrlen = len;
-           if (*addrlen >= len)
-               memcpy(addr, my_addr, len);
-           *addrlen = 0;
-       }
-
-       ret = real_getsockname(fd, (struct sockaddr *)&un_my_addr, &un_my_addrlen);
-       if (ret == -1) {
-               free(child_si);
-               close(fd);
-               return ret;
-       }
-
-       len = my_addrlen;
-       ret = sockaddr_convert_from_un(child_si, &un_my_addr, un_my_addrlen,
-                                      child_si->family, my_addr, &len);
-       if (ret == -1) {
-               free(child_si);
-               free(my_addr);
-               close(fd);
-               return ret;
-       }
-
-       child_si->myname_len = len;
-       child_si->myname = sockaddr_dup(my_addr, len);
-       free(my_addr);
-
-       SWRAP_DLIST_ADD(sockets, child_si);
-
-       swrap_dump_packet(child_si, addr, SWRAP_ACCEPT_SEND, NULL, 0);
-       swrap_dump_packet(child_si, addr, SWRAP_ACCEPT_RECV, NULL, 0);
-       swrap_dump_packet(child_si, addr, SWRAP_ACCEPT_ACK, NULL, 0);
-
-       return fd;
-}
-
-static int autobind_start_init;
-static int autobind_start;
-
-/* using sendto() or connect() on an unbound socket would give the
-   recipient no way to reply, as unlike UDP and TCP, a unix domain
-   socket can't auto-assign emphemeral port numbers, so we need to
-   assign it here */
-static int swrap_auto_bind(struct socket_info *si)
-{
-       struct sockaddr_un un_addr;
-       int i;
-       char type;
-       int ret;
-       int port;
-       struct stat st;
-
-       if (autobind_start_init != 1) {
-               autobind_start_init = 1;
-               autobind_start = getpid();
-               autobind_start %= 50000;
-               autobind_start += 10000;
-       }
-
-       un_addr.sun_family = AF_UNIX;
-
-       switch (si->family) {
-       case AF_INET: {
-               struct sockaddr_in in;
-
-               switch (si->type) {
-               case SOCK_STREAM:
-                       type = SOCKET_TYPE_CHAR_TCP;
-                       break;
-               case SOCK_DGRAM:
-                       type = SOCKET_TYPE_CHAR_UDP;
-                       break;
-               default:
-                   errno = ESOCKTNOSUPPORT;
-                   return -1;
-               }
-
-               memset(&in, 0, sizeof(in));
-               in.sin_family = AF_INET;
-               in.sin_addr.s_addr = htonl(127<<24 | 
-                                          socket_wrapper_default_iface());
-
-               si->myname_len = sizeof(in);
-               si->myname = sockaddr_dup(&in, si->myname_len);
-               break;
-       }
-#ifdef HAVE_IPV6
-       case AF_INET6: {
-               struct sockaddr_in6 in6;
-
-               switch (si->type) {
-               case SOCK_STREAM:
-                       type = SOCKET_TYPE_CHAR_TCP_V6;
-                       break;
-               case SOCK_DGRAM:
-                       type = SOCKET_TYPE_CHAR_UDP_V6;
-                       break;
-               default:
-                   errno = ESOCKTNOSUPPORT;
-                   return -1;
-               }
-
-               memset(&in6, 0, sizeof(in6));
-               in6.sin6_family = AF_INET6;
-               in6.sin6_addr.s6_addr[0] = SW_IPV6_ADDRESS;
-               si->myname_len = sizeof(in6);
-               si->myname = sockaddr_dup(&in6, si->myname_len);
-               break;
-       }
-#endif
-       default:
-               errno = ESOCKTNOSUPPORT;
-               return -1;
-       }
-
-       if (autobind_start > 60000) {
-               autobind_start = 10000;
-       }
-
-       for (i=0;i<1000;i++) {
-               port = autobind_start + i;
-               snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), 
-                        "%s/"SOCKET_FORMAT, socket_wrapper_dir(),
-                        type, socket_wrapper_default_iface(), port);
-               if (stat(un_addr.sun_path, &st) == 0) continue;
-               
-               ret = real_bind(si->fd, (struct sockaddr *)&un_addr, sizeof(un_addr));
-               if (ret == -1) return ret;
-
-               si->tmp_path = strdup(un_addr.sun_path);
-               si->bound = 1;
-               autobind_start = port + 1;
-               break;
-       }
-       if (i == 1000) {
-               errno = ENFILE;
-               return -1;
-       }
-
-       set_port(si->family, port, si->myname);
-
-       return 0;
-}
-
-
-_PUBLIC_ int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen)
-{
-       int ret;
-       struct sockaddr_un un_addr;
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_connect(s, serv_addr, addrlen);
-       }
-
-       if (si->bound == 0) {
-               ret = swrap_auto_bind(si);
-               if (ret == -1) return -1;
-       }
-
-       if (si->family != serv_addr->sa_family) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       ret = sockaddr_convert_to_un(si, (const struct sockaddr *)serv_addr, addrlen, &un_addr, 0, NULL);
-       if (ret == -1) return -1;
-
-       swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_SEND, NULL, 0);
-
-       ret = real_connect(s, (struct sockaddr *)&un_addr, 
-                          sizeof(struct sockaddr_un));
-
-       /* to give better errors */
-       if (ret == -1 && errno == ENOENT) {
-               errno = EHOSTUNREACH;
-       }
-
-       if (ret == 0) {
-               si->peername_len = addrlen;
-               si->peername = sockaddr_dup(serv_addr, addrlen);
-
-               swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_RECV, NULL, 0);
-               swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_ACK, NULL, 0);
-       } else {
-               swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_UNREACH, NULL, 0);
-       }
-
-       return ret;
-}
-
-_PUBLIC_ int swrap_bind(int s, const struct sockaddr *myaddr, socklen_t addrlen)
-{
-       int ret;
-       struct sockaddr_un un_addr;
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_bind(s, myaddr, addrlen);
-       }
-
-       si->myname_len = addrlen;
-       si->myname = sockaddr_dup(myaddr, addrlen);
-
-       ret = sockaddr_convert_to_un(si, (const struct sockaddr *)myaddr, addrlen, &un_addr, 1, &si->bcast);
-       if (ret == -1) return -1;
-
-       unlink(un_addr.sun_path);
-
-       ret = real_bind(s, (struct sockaddr *)&un_addr,
-                       sizeof(struct sockaddr_un));
-
-       if (ret == 0) {
-               si->bound = 1;
-       }
-
-       return ret;
-}
-
-_PUBLIC_ int swrap_listen(int s, int backlog)
-{
-       int ret;
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_listen(s, backlog);
-       }
-
-       ret = real_listen(s, backlog);
-
-       return ret;
-}
-
-_PUBLIC_ int swrap_getpeername(int s, struct sockaddr *name, socklen_t *addrlen)
-{
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_getpeername(s, name, addrlen);
-       }
-
-       if (!si->peername)
-       {
-               errno = ENOTCONN;
-               return -1;
-       }
-
-       memcpy(name, si->peername, si->peername_len);
-       *addrlen = si->peername_len;
-
-       return 0;
-}
-
-_PUBLIC_ int swrap_getsockname(int s, struct sockaddr *name, socklen_t *addrlen)
-{
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_getsockname(s, name, addrlen);
-       }
-
-       memcpy(name, si->myname, si->myname_len);
-       *addrlen = si->myname_len;
-
-       return 0;
-}
-
-_PUBLIC_ int swrap_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
-{
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_getsockopt(s, level, optname, optval, optlen);
-       }
-
-       if (level == SOL_SOCKET) {
-               return real_getsockopt(s, level, optname, optval, optlen);
-       } 
-
-       errno = ENOPROTOOPT;
-       return -1;
-}
-
-_PUBLIC_ int swrap_setsockopt(int s, int  level,  int  optname,  const  void  *optval, socklen_t optlen)
-{
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_setsockopt(s, level, optname, optval, optlen);
-       }
-
-       if (level == SOL_SOCKET) {
-               return real_setsockopt(s, level, optname, optval, optlen);
-       }
-
-       switch (si->family) {
-       case AF_INET:
-               return 0;
-       default:
-               errno = ENOPROTOOPT;
-               return -1;
-       }
-}
-
-_PUBLIC_ ssize_t swrap_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen)
-{
-       struct sockaddr_un un_addr;
-       socklen_t un_addrlen = sizeof(un_addr);
-       int ret;
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_recvfrom(s, buf, len, flags, from, fromlen);
-       }
-
-       len = MIN(len, 1500);
-
-       /* irix 6.4 forgets to null terminate the sun_path string :-( */
-       memset(&un_addr, 0, sizeof(un_addr));
-       ret = real_recvfrom(s, buf, len, flags, (struct sockaddr *)&un_addr, &un_addrlen);
-       if (ret == -1) 
-               return ret;
-
-       if (sockaddr_convert_from_un(si, &un_addr, un_addrlen,
-                                    si->family, from, fromlen) == -1) {
-               return -1;
-       }
-
-       swrap_dump_packet(si, from, SWRAP_RECVFROM, buf, ret);
-
-       return ret;
-}
-
-
-_PUBLIC_ ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)
-{
-       struct sockaddr_un un_addr;
-       int ret;
-       struct socket_info *si = find_socket_info(s);
-       int bcast = 0;
-
-       if (!si) {
-               return real_sendto(s, buf, len, flags, to, tolen);
-       }
-
-       len = MIN(len, 1500);
-
-       switch (si->type) {
-       case SOCK_STREAM:
-               ret = real_send(s, buf, len, flags);
-               break;
-       case SOCK_DGRAM:
-               if (si->bound == 0) {
-                       ret = swrap_auto_bind(si);
-                       if (ret == -1) return -1;
-               }
-               
-               ret = sockaddr_convert_to_un(si, to, tolen, &un_addr, 0, &bcast);
-               if (ret == -1) return -1;
-               
-               if (bcast) {
-                       struct stat st;
-                       unsigned int iface;
-                       unsigned int prt = ntohs(((const struct sockaddr_in *)to)->sin_port);
-                       char type;
-                       
-                       type = SOCKET_TYPE_CHAR_UDP;
-                       
-                       for(iface=0; iface <= MAX_WRAPPED_INTERFACES; iface++) {
-                               snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s/"SOCKET_FORMAT, 
-                                        socket_wrapper_dir(), type, iface, prt);
-                               if (stat(un_addr.sun_path, &st) != 0) continue;
-                               
-                               /* ignore the any errors in broadcast sends */
-                               real_sendto(s, buf, len, flags, (struct sockaddr *)&un_addr, sizeof(un_addr));
-                       }
-                       
-                       swrap_dump_packet(si, to, SWRAP_SENDTO, buf, len);
-                       
-                       return len;
-               }
-               
-               ret = real_sendto(s, buf, len, flags, (struct sockaddr *)&un_addr, sizeof(un_addr));
-               break;
-       default:
-               ret = -1;
-               errno = EHOSTUNREACH;
-               break;
-       }
-               
-       /* to give better errors */
-       if (ret == -1 && errno == ENOENT) {
-               errno = EHOSTUNREACH;
-       }
-
-       if (ret == -1) {
-               swrap_dump_packet(si, to, SWRAP_SENDTO, buf, len);
-               swrap_dump_packet(si, to, SWRAP_SENDTO_UNREACH, buf, len);
-       } else {
-               swrap_dump_packet(si, to, SWRAP_SENDTO, buf, ret);
-       }
-
-       return ret;
-}
-
-_PUBLIC_ int swrap_ioctl(int s, int r, void *p)
-{
-       int ret;
-       struct socket_info *si = find_socket_info(s);
-       int value;
-
-       if (!si) {
-               return real_ioctl(s, r, p);
-       }
-
-       ret = real_ioctl(s, r, p);
-
-       switch (r) {
-       case FIONREAD:
-               value = *((int *)p);
-               if (ret == -1 && errno != EAGAIN && errno != ENOBUFS) {
-                       swrap_dump_packet(si, NULL, SWRAP_PENDING_RST, NULL, 0);
-               } else if (value == 0) { /* END OF FILE */
-                       swrap_dump_packet(si, NULL, SWRAP_PENDING_RST, NULL, 0);
-               }
-               break;
-       }
-
-       return ret;
-}
-
-_PUBLIC_ ssize_t swrap_recv(int s, void *buf, size_t len, int flags)
-{
-       int ret;
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_recv(s, buf, len, flags);
-       }
-
-       len = MIN(len, 1500);
-
-       ret = real_recv(s, buf, len, flags);
-       if (ret == -1 && errno != EAGAIN && errno != ENOBUFS) {
-               swrap_dump_packet(si, NULL, SWRAP_RECV_RST, NULL, 0);
-       } else if (ret == 0) { /* END OF FILE */
-               swrap_dump_packet(si, NULL, SWRAP_RECV_RST, NULL, 0);
-       } else {
-               swrap_dump_packet(si, NULL, SWRAP_RECV, buf, ret);
-       }
-
-       return ret;
-}
-
-
-_PUBLIC_ ssize_t swrap_send(int s, const void *buf, size_t len, int flags)
-{
-       int ret;
-       struct socket_info *si = find_socket_info(s);
-
-       if (!si) {
-               return real_send(s, buf, len, flags);
-       }
-
-       len = MIN(len, 1500);
-
-       ret = real_send(s, buf, len, flags);
-
-       if (ret == -1) {
-               swrap_dump_packet(si, NULL, SWRAP_SEND, buf, len);
-               swrap_dump_packet(si, NULL, SWRAP_SEND_RST, NULL, 0);
-       } else {
-               swrap_dump_packet(si, NULL, SWRAP_SEND, buf, ret);
-       }
-
-       return ret;
-}
-
-_PUBLIC_ int swrap_close(int fd)
-{
-       struct socket_info *si = find_socket_info(fd);
-       int ret;
-
-       if (!si) {
-               return real_close(fd);
-       }
-
-       SWRAP_DLIST_REMOVE(sockets, si);
-
-       if (si->myname && si->peername) {
-               swrap_dump_packet(si, NULL, SWRAP_CLOSE_SEND, NULL, 0);
-       }
-
-       ret = real_close(fd);
-
-       if (si->myname && si->peername) {
-               swrap_dump_packet(si, NULL, SWRAP_CLOSE_RECV, NULL, 0);
-               swrap_dump_packet(si, NULL, SWRAP_CLOSE_ACK, NULL, 0);
-       }
-
-       if (si->path) free(si->path);
-       if (si->myname) free(si->myname);
-       if (si->peername) free(si->peername);
-       if (si->tmp_path) {
-               unlink(si->tmp_path);
-               free(si->tmp_path);
-       }
-       free(si);
-
-       return ret;
-}
diff --git a/source3/lib/talloc/config.mk b/source3/lib/talloc/config.mk
deleted file mode 100644 (file)
index c13e1b7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-[LIBRARY::LIBTALLOC]
-OUTPUT_TYPE = MERGED_OBJ
-CFLAGS = -Ilib/talloc
-
-LIBTALLOC_OBJ_FILES = lib/talloc/talloc.o
-
-MANPAGES += $(tallocdir)/talloc.3
diff --git a/source3/lib/talloc/libtalloc.m4 b/source3/lib/talloc/libtalloc.m4
deleted file mode 100644 (file)
index fd2b4b2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-dnl find the talloc sources. This is meant to work both for 
-dnl talloc standalone builds, and builds of packages using talloc
-tallocdir=""
-tallocpaths=". lib/talloc talloc ../talloc"
-for d in $tallocpaths; do
-       if test -f "$srcdir/$d/talloc.c"; then
-               tallocdir="$d"
-               AC_SUBST(tallocdir)
-               break;
-       fi
-done
-if test x"$tallocdir" = "x"; then
-   AC_MSG_ERROR([cannot find talloc source in $tallocpaths])
-fi
-TALLOC_OBJ="talloc.o"
-AC_SUBST(TALLOC_OBJ)
-
-TALLOC_CFLAGS="-I$srcdir/$tallocdir"
-AC_SUBST(TALLOC_CFLAGS)
-
-TALLOC_LIBS=""
-AC_SUBST(TALLOC_LIBS)
-
-AC_CHECK_SIZEOF(size_t,cross)
-AC_CHECK_SIZEOF(void *,cross)
-
-if test $ac_cv_sizeof_size_t -lt $ac_cv_sizeof_void_p; then
-       AC_WARN([size_t cannot represent the amount of used memory of a process])
-       AC_WARN([please report this to <samba-technical@samba.org>])
-       AC_WARN([sizeof(size_t) = $ac_cv_sizeof_size_t])
-       AC_WARN([sizeof(void *) = $ac_cv_sizeof_void_p])
-       AC_ERROR([sizeof(size_t) < sizeof(void *)])
-fi
diff --git a/source3/lib/tdb/config.mk b/source3/lib/tdb/config.mk
deleted file mode 100644 (file)
index b9a8f80..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-################################################
-# Start SUBSYSTEM LIBTDB
-[LIBRARY::LIBTDB]
-OUTPUT_TYPE = STATIC_LIBRARY
-CFLAGS = -Ilib/tdb/include
-#
-# End SUBSYSTEM ldb
-################################################
-
-LIBTDB_OBJ_FILES = $(addprefix lib/tdb/common/, \
-       tdb.o dump.o io.o lock.o \
-       open.o traverse.o freelist.o \
-       error.o transaction.o)
-
-################################################
-# Start BINARY tdbtool
-[BINARY::tdbtool]
-INSTALLDIR = BINDIR
-PRIVATE_DEPENDENCIES = \
-               LIBTDB
-# End BINARY tdbtool
-################################################
-
-tdbtool_OBJ_FILES = lib/tdb/tools/tdbtool.o
-
-################################################
-# Start BINARY tdbtorture
-[BINARY::tdbtorture]
-INSTALLDIR = BINDIR
-PRIVATE_DEPENDENCIES = \
-               LIBTDB
-# End BINARY tdbtorture
-################################################
-
-tdbtorture_OBJ_FILES = lib/tdb/tools/tdbtorture.o
-
-################################################
-# Start BINARY tdbdump
-[BINARY::tdbdump]
-INSTALLDIR = BINDIR
-PRIVATE_DEPENDENCIES = \
-               LIBTDB
-# End BINARY tdbdump
-################################################
-
-tdbdump_OBJ_FILES = lib/tdb/tools/tdbdump.o
-
-################################################
-# Start BINARY tdbbackup
-[BINARY::tdbbackup]
-INSTALLDIR = BINDIR
-PRIVATE_DEPENDENCIES = \
-               LIBTDB
-# End BINARY tdbbackup
-################################################
-
-tdbbackup_OBJ_FILES = lib/tdb/tools/tdbbackup.o
diff --git a/source3/lib/tdb/libtdb.m4 b/source3/lib/tdb/libtdb.m4
deleted file mode 100644 (file)
index 1e17a7a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-dnl find the tdb sources. This is meant to work both for 
-dnl tdb standalone builds, and builds of packages using tdb
-tdbdir=""
-tdbpaths="$srcdir $srcdir/lib/tdb $srcdir/tdb $srcdir/../tdb"
-for d in $tdbpaths; do
-       if test -f "$d/common/tdb.c"; then
-               tdbdir="$d"             
-               AC_SUBST(tdbdir)
-               break;
-       fi
-done
-if test x"$tdbdir" = "x"; then
-   AC_MSG_ERROR([cannot find tdb source in $tdbpaths])
-fi
-TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
-TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o"
-AC_SUBST(TDB_OBJ)
-AC_SUBST(LIBREPLACEOBJ)
-
-TDB_LIBS=""
-AC_SUBST(TDB_LIBS)
-
-TDB_CFLAGS="-I$tdbdir/include"
-AC_SUBST(TDB_CFLAGS)
-
-AC_CHECK_FUNCS(mmap pread pwrite getpagesize utime)
-AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h)
-
-AC_HAVE_DECL(pread, [#include <unistd.h>])
-AC_HAVE_DECL(pwrite, [#include <unistd.h>])
index 2eaeaf7608423d05ca0d244d582d48913086f76f..3f95c739d51c6b185a43962639437bf0630727dd 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _DNS_H
 #define _DNS_H
 
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #include "system/network.h"
 
 /* make sure we have included the correct config.h */
index 9da0773f287a2cf2a16b01165a3e6f615524ef56..c1eae0bb006c8f91ae547ab7b564b6b77aff8ea2 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 #include "includes.h"
-#include "lib/compression/mszip.h"
+#include "../compression/mszip.h"
 #include "librpc/ndr/libndr.h"
 #include "librpc/ndr/ndr_compression.h"
 
index 9a4213d9767cb72e9d1e2e5b04d2282c8124dd03..aae729c82572b09a1c16c60905cb3f841079c5c0 100644 (file)
@@ -886,4 +886,4 @@ int main(void)
        ])
 ])
 
-m4_include(lib/replace/libreplace.m4)
+m4_include(../lib/replace/libreplace.m4)
index 64d52af771ec5f5a24a1c83b22c0d30039d4e839..bed507fdeb50e0e4c9771f539aad60e7980f35f1 100644 (file)
@@ -39,7 +39,7 @@
 /* Include header files from data in config.h file */
 
 #ifndef NO_CONFIG_H
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 #endif
 
 #include "system/filesys.h"
index 86047c19a65e52cae9a3545d5940d553bdde6bd0..0a2ceb96362f7023d66e5e4d9cf1b5e9abe14d91 100644 (file)
@@ -12,7 +12,7 @@ m4_include(lib/util/fsusage.m4)
 m4_include(lib/util/xattr.m4)
 m4_include(lib/util/capability.m4)
 m4_include(lib/util/time.m4)
-m4_include(lib/popt/samba.m4)
+m4_include(../lib/popt/samba.m4)
 m4_include(lib/charset/config.m4)
 m4_include(lib/socket/config.m4)
 m4_include(nsswitch/nsstest.m4)
@@ -31,19 +31,19 @@ AC_CONFIG_FILES(../source4/librpc/dcerpc_atsvc.pc)
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.2.0,
        [],
        [
-               SMB_INCLUDE_MK(lib/talloc/config.mk)
+               SMB_INCLUDE_MK(../lib/talloc/config.mk)
        ]
 )
 
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
        [],
        [
-               m4_include(lib/tdb/libtdb.m4)
-               SMB_INCLUDE_MK(lib/tdb/config.mk)
+               m4_include(../lib/tdb/libtdb.m4)
+               SMB_INCLUDE_MK(../lib/tdb/config.mk)
        ]
 )
 
-SMB_INCLUDE_MK(lib/tdb/python.mk) 
+SMB_INCLUDE_MK(../lib/tdb/python.mk) 
 
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb >= 0.9.1,
        [
index a842d1312afcb1b11c96fd95583643844b80a1c8..b145f4ca4b301389c77f1d55050189ceca627c0b 100644 (file)
@@ -12,7 +12,7 @@ samba4srcdir = $(call abspath,$(srcdir)/../source4)
 # Flags used for the samba 4 files
 # $(srcdir)/include is required for config.h
 SAMBA4_CFLAGS = -I$(samba4srcdir) -I$(samba4srcdir)/include \
-                -I$(samba4srcdir)/lib/replace -I$(samba4srcdir)/lib \
+                -I$(samba4srcdir)/../lib/replace -I$(samba4srcdir)/lib \
                 -I$(heimdalsrcdir)/lib/hcrypto -I$(tallocdir) \
                 -I$(srcdir)/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H
 
@@ -80,9 +80,9 @@ libregistrysrcdir := $(samba4srcdir)/lib/registry
 libmessagingsrcdir := $(samba4srcdir)/lib/messaging
 libeventssrcdir := $(samba4srcdir)/lib/events
 libcmdlinesrcdir := $(samba4srcdir)/lib/cmdline
-poptsrcdir := $(samba4srcdir)/lib/popt
-socketwrappersrcdir := $(samba4srcdir)/lib/socket_wrapper
-nsswrappersrcdir := $(samba4srcdir)/lib/nss_wrapper
+poptsrcdir := $(samba4srcdir)/../lib/popt
+socketwrappersrcdir := $(samba4srcdir)/../lib/socket_wrapper
+nsswrappersrcdir := $(samba4srcdir)/../lib/nss_wrapper
 appwebsrcdir := $(samba4srcdir)/lib/appweb
 libstreamsrcdir := $(samba4srcdir)/lib/stream
 libutilsrcdir := $(samba4srcdir)/lib/util
@@ -90,7 +90,7 @@ libtdrsrcdir := $(samba4srcdir)/lib/tdr
 libdbwrapsrcdir := $(samba4srcdir)/lib/dbwrap
 libcryptosrcdir := $(samba4srcdir)/lib/crypto
 libtorturesrcdir := $(samba4srcdir)/lib/torture
-libcompressionsrcdir := $(samba4srcdir)/lib/compression
+libcompressionsrcdir := $(samba4srcdir)/../lib/compression
 libgencachesrcdir := $(samba4srcdir)/lib
 paramsrcdir := $(samba4srcdir)/param
 smb_serversrcdir := $(samba4srcdir)/smb_server
@@ -113,8 +113,9 @@ pyscriptsrcdir := $(samba4srcdir)/scripting/python
 kdcsrcdir := $(samba4srcdir)/kdc
 smbreadlinesrcdir := $(samba4srcdir)/lib/smbreadline
 ntp_signdsrcdir := $(samba4srcdir)/ntp_signd
-tdbsrcdir := $(samba4srcdir)/lib/tdb
+tdbsrcdir := $(samba4srcdir)/../lib/tdb
 ldbsrcdir := $(samba4srcdir)/lib/ldb
+tallocsrcdir := $(samba4srcdir)/../lib/talloc
 override ASN1C = bin/asn1_compile4
 override ET_COMPILER = bin/compile_et4
 include samba4-data.mk
index 546eb072d8611ed40370936fe1468ee3ee9f9951..91390d833f885c6cb967ff330cb6b1f93ada74c1 100644 (file)
@@ -62,7 +62,7 @@ libsrcdir := lib
 libsocketsrcdir := lib/socket
 libcharsetsrcdir := lib/charset
 ldb_sambasrcdir := lib/ldb-samba
-tdbsrcdir := lib/tdb
+tdbsrcdir := ../lib/tdb
 ldbsrcdir := lib/ldb
 libtlssrcdir := lib/tls
 libregistrysrcdir := lib/registry
@@ -70,9 +70,9 @@ smbreadlinesrcdir := lib/smbreadline
 libmessagingsrcdir := lib/messaging
 libeventssrcdir := lib/events
 libcmdlinesrcdir := lib/cmdline
-poptsrcdir := lib/popt
-socketwrappersrcdir := lib/socket_wrapper
-nsswrappersrcdir := lib/nss_wrapper
+poptsrcdir := ../lib/popt
+socketwrappersrcdir := ../lib/socket_wrapper
+nsswrappersrcdir := ../lib/nss_wrapper
 appwebsrcdir := lib/appweb
 libstreamsrcdir := lib/stream
 libutilsrcdir := lib/util
@@ -81,7 +81,7 @@ libdbwrapsrcdir := lib/dbwrap
 libcryptosrcdir := lib/crypto
 libtorturesrcdir := lib/torture
 smb_serversrcdir := smb_server
-libcompressionsrcdir := lib/compression
+libcompressionsrcdir := ../lib/compression
 libgencachesrcdir := lib
 paramsrcdir := param
 rpc_serversrcdir := rpc_server
@@ -103,6 +103,7 @@ pyscriptsrcdir := $(srcdir)/scripting/python
 kdcsrcdir := kdc
 ntp_signdsrcdir := ntp_signd
 wmisrcdir := lib/wmi
+tallocsrcdir := ../lib/talloc
 
 include data.mk
 
index 57a66439a17af64ed02d84b8ba54e90bd58c243c..240a994f9df6de71a30bfe63236a0b76aae48665 100644 (file)
@@ -53,7 +53,7 @@ AC_DEFUN(LIB_REMOVE_USR_LIB,[
   $1=[$]ac_new_flags
 ])
 
-m4_include(lib/replace/libreplace.m4)
+m4_include(../lib/replace/libreplace.m4)
 m4_include(build/m4/ax_cflags_gcc_option.m4)
 m4_include(build/m4/ax_cflags_irix_option.m4)
 m4_include(build/m4/public.m4)
index b721a45a99c86d62ea7a91b4e7d52acbb31e2f03..a56c5a223871923a5318e6248969801bb3af3ead 100755 (executable)
@@ -53,7 +53,7 @@ echo "$0: running script/mkversion.sh"
 rm -rf autom4te*.cache
 rm -f configure include/config_tmp.h*
 
-IPATHS="-I. -Ilib/replace"
+IPATHS="-I. -I../lib/replace"
 
 echo "$0: running $AUTOHEADER $IPATHS"
 $AUTOHEADER $IPATHS || exit 1
index 1b22c6c72701b22ddba37b57b4ef99c76bc2a55a..01d60901a6e5d98f4afcd7f7dcef87966df2fd3b 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "messaging/messaging.h"
 #include "lib/messaging/irpc.h"
 #include "libcli/libcli.h"
index 2af0d418a8be1057272f2e61418990c53f0aac7d..a22cd09745f83346a9db2efe1938c23e62fe24fb 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "includes.h"
 #include "tdb_wrap.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/util/dlinklist.h"
 #include "lib/events/events.h"
 #include "system/network.h"
index ca9c635878c768e56591c87d9f451a464c4b1504..ecdbeae5160414bb3bb9ba910705a77e6d0f8cee 100644 (file)
@@ -21,7 +21,7 @@
 */
 
 #include "includes.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/events/events.h"
 #include "lib/util/dlinklist.h"
 #include "system/network.h"
index 92adc4a12af7aa7190db286459b355a86ac52252..cae0aea0d92c6c16da6312c08b81cc80093074b1 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
index 1aea28fd35d8a9f10801eccb6b298b1eb963cb64..28811b77f15960efb22ea2843f918bf0280719e1 100644 (file)
@@ -22,7 +22,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
index f11388331d33529ec3cc0db96859b51d17cee3dd..67eb32221ae72a29fc129f1b48a7c8991af273a5 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
index ce295c4474ff9a88981488d81f7a80920947c4b0..e782091eec229967b43cef776b96c6bf65385401 100644 (file)
@@ -24,7 +24,7 @@
 #include "cluster/cluster.h"
 #include "system/filesys.h"
 #include "cluster/cluster_private.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "include/ctdb.h"
 #include "tdb_wrap.h"
 #include "lib/util/dlinklist.h"
index b1faf9e0e645f5127e14f592a2e28f23d7a4fc73..3313798beee20e9cc49341e23f54054f5cf715fe 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "messaging/messaging.h"
 #include "tdb_wrap.h"
 #include "lib/messaging/irpc.h"
index bbe07717ed830ee84e95742cf88bdf0bbc5220e6..0d09241d52b2a8f54fa035870a258b825bc62d6b 100644 (file)
@@ -22,7 +22,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/util/dlinklist.h"
 #include "system/network.h"
 #include "system/filesys.h"
index 4b826b51879f0ca7ac56265e9a3eabc2b98dde62..ba94b9dd242fa7bd9d4aad9b9e8de5b637c73b5a 100644 (file)
@@ -18,7 +18,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/wait.h"
index f96cd86916bdb7c89f12c35268dca0ba06daddc1..46e81ab3c3dd9a6c2b10fcca4fe302b4e73c19dd 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "includes.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/events/events.h"
 #include "lib/util/dlinklist.h"
 #include "system/network.h"
index 22942668900487b5cfda5448c7def4714ff0c60f..391c6b86d03eff1204c71090849569571651129d 100644 (file)
@@ -18,7 +18,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/wait.h"
index 2fc3e7a3ed58a2aba9da225f667b0ef37cab3bef..1112ab2054de7cdfb104759718277d0326864c7b 100644 (file)
@@ -21,7 +21,7 @@
 #include "lib/events/events.h"
 #include "system/filesys.h"
 #include "system/wait.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "../include/ctdb_private.h"
 
 
index 68ed546b27f1ea436f034d076aa8a7015e8c85ba..cabdeb124c060c3c136fce81856320161025b1b2 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
index 6065016e1f30d6699f7833b454126a30ff45f631..1e70d1de7a0e36755af9339bbc3e482f7f9d6c71 100644 (file)
@@ -19,7 +19,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/wait.h"
index 1480127327cd24f0b679aa88e02f5516f1ca74c0..0cfbdc0f2f854309d54e344acbb7c670e831c6dc 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "includes.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/events/events.h"
 #include "lib/util/dlinklist.h"
 #include "system/network.h"
index 42a23808ddb2d7501556374c0c5da298c5c2b11e..53a5a1dc3c7e5e5f2f4ba5aae25274ac603f4569 100644 (file)
@@ -19,7 +19,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/util/dlinklist.h"
 #include "system/network.h"
 #include "system/filesys.h"
index 233de62e2b0c2b2f9bc29d4287b2f15042a659af..d735594e737a5caf47cc52e6d1d55d9602eb4ecd 100644 (file)
@@ -21,7 +21,7 @@
 #include "lib/events/events.h"
 #include "system/filesys.h"
 #include "system/wait.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "../include/ctdb_private.h"
 
 typedef void (*ctdb_traverse_fn_t)(void *private_data, TDB_DATA key, TDB_DATA data);
index 862382d90af04b525adf4dc4e78daef6c5f6400f..ae687252714e055ea8d2e1d7048d55897fbb38ef 100644 (file)
@@ -19,7 +19,7 @@
 */
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/wait.h"
index 2f828e5717451867f53643a7f141a6c43c53380c..3c167532babc827070a2ae109efaea50556b8e33 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
index f5d4e4c1d6b4a6d2d36792ab6569704bc4756242..b8296d52443909db3b968b9e712416df2d7bb5e6 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "includes.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "lib/events/events.h"
 #include "system/network.h"
 #include "system/filesys.h"
index c10afb34259057ce03430ffa15ed8efe15321aa4..d3afdc165a2753b85a33996984e9719debce3d2e 100644 (file)
@@ -20,7 +20,7 @@
 #include "includes.h"
 #include "lib/events/events.h"
 #include "lib/util/dlinklist.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "../include/ctdb_private.h"
index 96636927f13a27de40b5304eaadf7db2d1676680..f0357f0b073a0666052f2116a38974a293cc7e08 100644 (file)
@@ -22,7 +22,7 @@
 #include "includes.h"
 #include "cluster/cluster.h"
 #include "cluster/cluster_private.h"
-#include "lib/tdb/include/tdb.h"
+#include "../tdb/include/tdb.h"
 #include "tdb_wrap.h"
 #include "system/filesys.h"
 #include "param/param.h"
index d03092c6b665c454d9073b694aaa01578d43ee4a..099da400e73cbfeb8bf59f2a25d0d0c80a9ed939 100644 (file)
@@ -11,7 +11,7 @@ AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
 
 # Configuration rules.
 m4_include(build/m4/env.m4)
-m4_include(lib/replace/samba.m4)
+m4_include(../lib/replace/samba.m4)
 m4_include(lib/smbreadline/readline.m4)
 m4_include(heimdal_build/config.m4)
 m4_include(lib/util/fault.m4)
@@ -21,7 +21,7 @@ m4_include(lib/util/fsusage.m4)
 m4_include(lib/util/xattr.m4)
 m4_include(lib/util/capability.m4)
 m4_include(lib/util/time.m4)
-m4_include(lib/popt/samba.m4)
+m4_include(../lib/popt/samba.m4)
 m4_include(lib/charset/config.m4)
 m4_include(lib/socket/config.m4)
 m4_include(lib/zlib.m4)
@@ -41,20 +41,20 @@ AC_CONFIG_FILES(librpc/dcerpc_atsvc.pc)
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.2.0,
        [],
        [
-               m4_include(lib/talloc/libtalloc.m4)
-               SMB_INCLUDE_MK(lib/talloc/config.mk)
+               m4_include(../lib/talloc/libtalloc.m4)
+               SMB_INCLUDE_MK(../lib/talloc/config.mk)
        ]
 )
 
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
        [],
        [
-               m4_include(lib/tdb/libtdb.m4)
-               SMB_INCLUDE_MK(lib/tdb/config.mk)
+               m4_include(../lib/tdb/libtdb.m4)
+               SMB_INCLUDE_MK(../lib/tdb/config.mk)
        ]
 )
 
-SMB_INCLUDE_MK(lib/tdb/python.mk) 
+SMB_INCLUDE_MK(../lib/tdb/python.mk) 
 
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb >= 0.9.1,
        [
@@ -99,8 +99,8 @@ m4_include(auth/gensec/config.m4)
 m4_include(smbd/process_model.m4)
 m4_include(ntvfs/posix/config.m4)
 m4_include(ntvfs/unixuid/config.m4)
-m4_include(lib/socket_wrapper/config.m4)
-m4_include(lib/nss_wrapper/config.m4)
+m4_include(../lib/socket_wrapper/config.m4)
+m4_include(../lib/nss_wrapper/config.m4)
 m4_include(auth/config.m4)
 m4_include(kdc/config.m4)
 m4_include(ntvfs/sysdep/config.m4)
@@ -159,7 +159,7 @@ then
        builddir_headers="-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib ";
 fi
 
-CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS"
+CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/../lib/replace -I\$(srcdir)/../lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS"
 
 SMB_WRITE_PERLVARS(build/smb_build/config.pm)
 
index 38cdfbb6a6a78c24a045b8883c68282fead28b15..e15c6effa8207e3a7192eaf7472149469e2236f5 100644 (file)
@@ -7,7 +7,7 @@
 #define HAVE_HEIMDAL_CONFIG_H
 
 #include "include/config.h"
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 
 #define RCSID(msg) struct __rcsid { int __rcsdi; }
 #define KRB5
index 0885c2165b0144b743ef2827274fe3922bf1e124..c71b69463ccda892e5f5494683454ccae482e238 100644 (file)
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 
 void *__gss_ntlm_initialize(void)
 {
index df0d8f77132ba53d728f20fe09d25d86e6a61b5c..750ebc4137b31a343822b20fddf112a096746ec7 100644 (file)
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "lib/replace/replace.h"
+#include "../replace/replace.h"
 
 /* make sure we have included the correct config.h */
 #ifndef NO_CONFIG_H /* for some tests */
diff --git a/source4/lib/compression/mszip.c b/source4/lib/compression/mszip.c
deleted file mode 100644 (file)
index 59961d6..0000000
+++ /dev/null
@@ -1,676 +0,0 @@
-/* mszip decompression - based on cabextract.c code from
- * Stuart Caie
- *
- * adapted for Samba by Andrew Tridgell and Stefan Metzmacher 2005
- *
- * (C) 2000-2001 Stuart Caie <kyzer@4u.net>
- * reaktivate-specifics by Malte Starostik <malte@kde.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-#include "lib/compression/mszip.h"
-
-/*--------------------------------------------------------------------------*/
-/* our archiver information / state */
-
-/* MSZIP stuff */
-#define ZIPWSIZE       0x8000  /* window size */
-#define ZIPLBITS       9       /* bits in base literal/length lookup table */
-#define ZIPDBITS       6       /* bits in base distance lookup table */
-#define ZIPBMAX                16      /* maximum bit length of any code */
-#define ZIPN_MAX       288     /* maximum number of codes in any set */
-
-struct Ziphuft {
-  uint8_t e;                /* number of extra bits or operation */
-  uint8_t b;                /* number of bits in this code or subcode */
-  union {
-    uint16_t n;              /* literal, length base, or distance base */
-    struct Ziphuft *t;    /* pointer to next level of table */
-  } v;
-};
-
-struct ZIPstate {
-    uint32_t window_posn;     /* current offset within the window        */
-    uint32_t bb;              /* bit buffer */
-    uint32_t bk;              /* bits in bit buffer */
-    uint32_t ll[288+32];          /* literal/length and distance code lengths */
-    uint32_t c[ZIPBMAX+1];    /* bit length count table */
-    int32_t  lx[ZIPBMAX+1];   /* memory for l[-1..ZIPBMAX-1] */
-    struct Ziphuft *u[ZIPBMAX];                /* table stack */
-    uint32_t v[ZIPN_MAX];     /* values in order of bit length */
-    uint32_t x[ZIPBMAX+1];    /* bit offsets, then code stack */
-    uint8_t *inpos;
-};
-
-/* generic stuff */
-#define CAB(x) (decomp_state->x)
-#define ZIP(x) (decomp_state->methods.zip.x)
-
-/* CAB data blocks are <= 32768 bytes in uncompressed form. Uncompressed
- * blocks have zero growth. MSZIP guarantees that it won't grow above
- * uncompressed size by more than 12 bytes. LZX guarantees it won't grow
- * more than 6144 bytes.
- */
-#define CAB_BLOCKMAX (32768)
-#define CAB_INPUTMAX (CAB_BLOCKMAX+6144)
-
-struct decomp_state {
-  struct folder *current; /* current folder we're extracting from  */
-  uint32_t offset;           /* uncompressed offset within folder     */
-  uint8_t *outpos;          /* (high level) start of data to use up  */
-  uint16_t outlen;           /* (high level) amount of data to use up */
-  uint16_t split;            /* at which split in current folder?     */
-  int (*decompress)(int, int); /* the chosen compression func      */
-  uint8_t inbuf[CAB_INPUTMAX+2]; /* +2 for lzx bitbuffer overflows!  */
-  uint8_t outbuf[CAB_BLOCKMAX];
-  union {
-    struct ZIPstate zip;
-  } methods;
-};
-
-
-/* MSZIP decruncher */
-
-/* Dirk Stoecker wrote the ZIP decoder, based on the InfoZip deflate code */
-
-/* Tables for deflate from PKZIP's appnote.txt. */
-static const uint8_t Zipborder[] = /* Order of the bit length code lengths */
-{ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-static const uint16_t Zipcplens[] = /* Copy lengths for literal codes 257..285 */
-{ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51,
- 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
-static const uint16_t Zipcplext[] = /* Extra bits for literal codes 257..285 */
-{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4,
-  4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */
-static const uint16_t Zipcpdist[] = /* Copy offsets for distance codes 0..29 */
-{ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385,
-513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577};
-static const uint16_t Zipcpdext[] = /* Extra bits for distance codes */
-{ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
-10, 11, 11, 12, 12, 13, 13};
-
-/* And'ing with Zipmask[n] masks the lower n bits */
-static const uint16_t Zipmask[17] = {
- 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
- 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
-};
-
-#define ZIPNEEDBITS(n) {while(k<(n)){int32_t c=*(ZIP(inpos)++);\
-    b|=((uint32_t)c)<<k;k+=8;}}
-#define ZIPDUMPBITS(n) {b>>=(n);k-=(n);}
-
-static void Ziphuft_free(struct Ziphuft *t)
-{
-  register struct Ziphuft *p, *q;
-
-  /* Go through linked list, freeing from the allocated (t[-1]) address. */
-  p = t;
-  while (p != (struct Ziphuft *)NULL)
-  {
-    q = (--p)->v.t;
-    free(p);
-    p = q;
-  } 
-}
-
-static int32_t Ziphuft_build(struct decomp_state *decomp_state,
-                         uint32_t *b, uint32_t n, uint32_t s, const uint16_t *d, const uint16_t *e,
-                         struct Ziphuft **t, int32_t *m)
-{
-  uint32_t a;                          /* counter for codes of length k */
-  uint32_t el;                         /* length of EOB code (value 256) */
-  uint32_t f;                          /* i repeats in table every f entries */
-  int32_t g;                           /* maximum code length */
-  int32_t h;                           /* table level */
-  register uint32_t i;                 /* counter, current code */
-  register uint32_t j;                 /* counter */
-  register int32_t k;                  /* number of bits in current code */
-  int32_t *l;                  /* stack of bits per table */
-  register uint32_t *p;                /* pointer into ZIP(c)[],ZIP(b)[],ZIP(v)[] */
-  register struct Ziphuft *q;   /* points to current table */
-  struct Ziphuft r;             /* table entry for structure assignment */
-  register int32_t w;              /* bits before this table == (l * h) */
-  uint32_t *xp;                        /* pointer into x */
-  int32_t y;                       /* number of dummy codes added */
-  uint32_t z;                          /* number of entries in current table */
-
-  l = ZIP(lx)+1;
-
-  /* Generate counts for each bit length */
-  el = n > 256 ? b[256] : ZIPBMAX; /* set length of EOB code, if any */
-
-  for(i = 0; i < ZIPBMAX+1; ++i)
-    ZIP(c)[i] = 0;
-  p = b;  i = n;
-  do
-  {
-    ZIP(c)[*p]++; p++;               /* assume all entries <= ZIPBMAX */
-  } while (--i);
-  if (ZIP(c)[0] == n)                /* null input--all zero length codes */
-  {
-    *t = (struct Ziphuft *)NULL;
-    *m = 0;
-    return 0;
-  }
-
-  /* Find minimum and maximum length, bound *m by those */
-  for (j = 1; j <= ZIPBMAX; j++)
-    if (ZIP(c)[j])
-      break;
-  k = j;                        /* minimum code length */
-  if ((uint32_t)*m < j)
-    *m = j;
-  for (i = ZIPBMAX; i; i--)
-    if (ZIP(c)[i])
-      break;
-  g = i;                        /* maximum code length */
-  if ((uint32_t)*m > i)
-    *m = i;
-
-  /* Adjust last length count to fill out codes, if needed */
-  for (y = 1 << j; j < i; j++, y <<= 1)
-    if ((y -= ZIP(c)[j]) < 0)
-      return 2;                 /* bad input: more codes than bits */
-  if ((y -= ZIP(c)[i]) < 0)
-    return 2;
-  ZIP(c)[i] += y;
-
-  /* Generate starting offsets int32_to the value table for each length */
-  ZIP(x)[1] = j = 0;
-  p = ZIP(c) + 1;  xp = ZIP(x) + 2;
-  while (--i)
-  {                 /* note that i == g from above */
-    *xp++ = (j += *p++);
-  }
-
-  /* Make a table of values in order of bit lengths */
-  p = b;  i = 0;
-  do{
-    if ((j = *p++) != 0)
-      ZIP(v)[ZIP(x)[j]++] = i;
-  } while (++i < n);
-
-
-  /* Generate the Huffman codes and for each, make the table entries */
-  ZIP(x)[0] = i = 0;                 /* first Huffman code is zero */
-  p = ZIP(v);                        /* grab values in bit order */
-  h = -1;                       /* no tables yet--level -1 */
-  w = l[-1] = 0;                /* no bits decoded yet */
-  ZIP(u)[0] = (struct Ziphuft *)NULL;   /* just to keep compilers happy */
-  q = (struct Ziphuft *)NULL;      /* ditto */
-  z = 0;                        /* ditto */
-
-  /* go through the bit lengths (k already is bits in shortest code) */
-  for (; k <= g; k++)
-  {
-    a = ZIP(c)[k];
-    while (a--)
-    {
-      /* here i is the Huffman code of length k bits for value *p */
-      /* make tables up to required level */
-      while (k > w + l[h])
-      {
-        w += l[h++];            /* add bits already decoded */
-
-        /* compute minimum size table less than or equal to *m bits */
-        z = (z = g - w) > (uint32_t)*m ? *m : z;        /* upper limit */
-        if ((f = 1 << (j = k - w)) > a + 1)     /* try a k-w bit table */
-        {                       /* too few codes for k-w bit table */
-          f -= a + 1;           /* deduct codes from patterns left */
-          xp = ZIP(c) + k;
-          while (++j < z)       /* try smaller tables up to z bits */
-          {
-            if ((f <<= 1) <= *++xp)
-              break;            /* enough codes to use up j bits */
-            f -= *xp;           /* else deduct codes from patterns */
-          }
-        }
-        if ((uint32_t)w + j > el && (uint32_t)w < el)
-          j = el - w;           /* make EOB code end at table */
-        z = 1 << j;             /* table entries for j-bit table */
-        l[h] = j;               /* set table size in stack */
-
-        /* allocate and link in new table */
-        if (!(q = (struct Ziphuft *) malloc((z + 1)*sizeof(struct Ziphuft))))
-        {
-          if(h)
-            Ziphuft_free(ZIP(u)[0]);
-          return 3;             /* not enough memory */
-        }
-        *t = q + 1;             /* link to list for Ziphuft_free() */
-        *(t = &(q->v.t)) = (struct Ziphuft *)NULL;
-        ZIP(u)[h] = ++q;             /* table starts after link */
-
-        /* connect to last table, if there is one */
-        if (h)
-        {
-          ZIP(x)[h] = i;             /* save pattern for backing up */
-          r.b = (uint8_t)l[h-1];    /* bits to dump before this table */
-          r.e = (uint8_t)(16 + j);  /* bits in this table */
-          r.v.t = q;            /* pointer to this table */
-          j = (i & ((1 << w) - 1)) >> (w - l[h-1]);
-          ZIP(u)[h-1][j] = r;        /* connect to last table */
-        }
-      }
-
-      /* set up table entry in r */
-      r.b = (uint8_t)(k - w);
-      if (p >= ZIP(v) + n)
-        r.e = 99;               /* out of values--invalid code */
-      else if (*p < s)
-      {
-        r.e = (uint8_t)(*p < 256 ? 16 : 15);    /* 256 is end-of-block code */
-        r.v.n = *p++;           /* simple code is just the value */
-      }
-      else
-      {
-        r.e = (uint8_t)e[*p - s];   /* non-simple--look up in lists */
-        r.v.n = d[*p++ - s];
-      }
-
-      /* fill code-like entries with r */
-      f = 1 << (k - w);
-      for (j = i >> w; j < z; j += f)
-        q[j] = r;
-
-      /* backwards increment the k-bit code i */
-      for (j = 1 << (k - 1); i & j; j >>= 1)
-        i ^= j;
-      i ^= j;
-
-      /* backup over finished tables */
-      while ((i & ((1 << w) - 1)) != ZIP(x)[h])
-        w -= l[--h];            /* don't need to update q */
-    }
-  }
-
-  /* return actual size of base table */
-  *m = l[0];
-
-  /* Return true (1) if we were given an incomplete table */
-  return y != 0 && g != 1;
-}
-
-static int32_t Zipinflate_codes(struct decomp_state *decomp_state,
-                            struct Ziphuft *tl, struct Ziphuft *td,
-                            int32_t bl, int32_t bd)
-{
-  register uint32_t e;  /* table entry flag/number of extra bits */
-  uint32_t n, d;        /* length and index for copy */
-  uint32_t w;           /* current window position */
-  struct Ziphuft *t; /* pointer to table entry */
-  uint32_t ml, md;      /* masks for bl and bd bits */
-  register uint32_t b;  /* bit buffer */
-  register uint32_t k;  /* number of bits in bit buffer */
-
-  DEBUG(10,("Zipinflate_codes\n"));
-
-  /* make local copies of globals */
-  b = ZIP(bb);                       /* initialize bit buffer */
-  k = ZIP(bk);
-  w = ZIP(window_posn);                       /* initialize window position */
-
-  /* inflate the coded data */
-  ml = Zipmask[bl];            /* precompute masks for speed */
-  md = Zipmask[bd];
-
-  for(;;)
-  {
-    ZIPNEEDBITS((uint32_t)bl)
-    if((e = (t = tl + ((uint32_t)b & ml))->e) > 16)
-      do
-      {
-        if (e == 99)
-          return 1;
-        ZIPDUMPBITS(t->b)
-        e -= 16;
-        ZIPNEEDBITS(e)
-      } while ((e = (t = t->v.t + ((uint32_t)b & Zipmask[e]))->e) > 16);
-    ZIPDUMPBITS(t->b)
-    if (w >= CAB_BLOCKMAX) break;
-    if (e == 16)                /* then it's a literal */
-      CAB(outbuf)[w++] = (uint8_t)t->v.n;
-    else                        /* it's an EOB or a length */
-    {
-      /* exit if end of block */
-      if(e == 15)
-        break;
-
-      /* get length of block to copy */
-      ZIPNEEDBITS(e)
-      n = t->v.n + ((uint32_t)b & Zipmask[e]);
-      ZIPDUMPBITS(e);
-
-      /* decode distance of block to copy */
-      ZIPNEEDBITS((uint32_t)bd)
-      if ((e = (t = td + ((uint32_t)b & md))->e) > 16)
-        do {
-          if (e == 99)
-            return 1;
-          ZIPDUMPBITS(t->b)
-          e -= 16;
-          ZIPNEEDBITS(e)
-        } while ((e = (t = t->v.t + ((uint32_t)b & Zipmask[e]))->e) > 16);
-      ZIPDUMPBITS(t->b)
-      ZIPNEEDBITS(e)
-      d = w - t->v.n - ((uint32_t)b & Zipmask[e]);
-      ZIPDUMPBITS(e)
-      do
-      {
-        n -= (e = (e = ZIPWSIZE - ((d &= ZIPWSIZE-1) > w ? d : w)) > n ?n:e);
-        do
-        {
-          CAB(outbuf)[w++] = CAB(outbuf)[d++];
-        } while (--e);
-      } while (n);
-    }
-  }
-
-  /* restore the globals from the locals */
-  ZIP(window_posn) = w;              /* restore global window pointer */
-  ZIP(bb) = b;                       /* restore global bit buffer */
-  ZIP(bk) = k;
-
-  /* done */
-  return 0;
-}
-
-/* "decompress" an inflated type 0 (stored) block. */
-static int32_t Zipinflate_stored(struct decomp_state *decomp_state)
-{
-  uint32_t n;           /* number of bytes in block */
-  uint32_t w;           /* current window position */
-  register uint32_t b;  /* bit buffer */
-  register uint32_t k;  /* number of bits in bit buffer */
-
-  /* make local copies of globals */
-  b = ZIP(bb);                       /* initialize bit buffer */
-  k = ZIP(bk);
-  w = ZIP(window_posn);              /* initialize window position */
-
-  /* go to byte boundary */
-  n = k & 7;
-  ZIPDUMPBITS(n);
-
-  /* get the length and its complement */
-  ZIPNEEDBITS(16)
-  n = ((uint32_t)b & 0xffff);
-  ZIPDUMPBITS(16)
-  ZIPNEEDBITS(16)
-  if (n != (uint32_t)((~b) & 0xffff))
-    return 1;                   /* error in compressed data */
-  ZIPDUMPBITS(16)
-
-  /* read and output the compressed data */
-  while(n--)
-  {
-    ZIPNEEDBITS(8)
-    CAB(outbuf)[w++] = (uint8_t)b;
-    ZIPDUMPBITS(8)
-  }
-
-  /* restore the globals from the locals */
-  ZIP(window_posn) = w;              /* restore global window pointer */
-  ZIP(bb) = b;                       /* restore global bit buffer */
-  ZIP(bk) = k;
-  return 0;
-}
-
-static int32_t Zipinflate_fixed(struct decomp_state *decomp_state)
-{
-  struct Ziphuft *fixed_tl;
-  struct Ziphuft *fixed_td;
-  int32_t fixed_bl, fixed_bd;
-  int32_t i;                /* temporary variable */
-  uint32_t *l;
-
-  l = ZIP(ll);
-
-  /* literal table */
-  for(i = 0; i < 144; i++)
-    l[i] = 8;
-  for(; i < 256; i++)
-    l[i] = 9;
-  for(; i < 280; i++)
-    l[i] = 7;
-  for(; i < 288; i++)          /* make a complete, but wrong code set */
-    l[i] = 8;
-  fixed_bl = 7;
-  if((i = Ziphuft_build(decomp_state, l, 288, 257, Zipcplens, Zipcplext, &fixed_tl, &fixed_bl)))
-    return i;
-
-  /* distance table */
-  for(i = 0; i < 30; i++)      /* make an incomplete code set */
-    l[i] = 5;
-  fixed_bd = 5;
-  if((i = Ziphuft_build(decomp_state, l, 30, 0, Zipcpdist, Zipcpdext, &fixed_td, &fixed_bd)) > 1)
-  {
-    Ziphuft_free(fixed_tl);
-    return i;
-  }
-
-  /* decompress until an end-of-block code */
-  i = Zipinflate_codes(decomp_state, fixed_tl, fixed_td, fixed_bl, fixed_bd);
-
-  Ziphuft_free(fixed_td);
-  Ziphuft_free(fixed_tl);
-  return i;
-}
-
-/* decompress an inflated type 2 (dynamic Huffman codes) block. */
-static int32_t Zipinflate_dynamic(struct decomp_state *decomp_state)
-{
-  int32_t i;           /* temporary variables */
-  uint32_t j;
-  uint32_t *ll;
-  uint32_t l;                  /* last length */
-  uint32_t m;                  /* mask for bit lengths table */
-  uint32_t n;                  /* number of lengths to get */
-  struct Ziphuft *tl;      /* literal/length code table */
-  struct Ziphuft *td;      /* distance code table */
-  int32_t bl;              /* lookup bits for tl */
-  int32_t bd;              /* lookup bits for td */
-  uint32_t nb;                 /* number of bit length codes */
-  uint32_t nl;                 /* number of literal/length codes */
-  uint32_t nd;                 /* number of distance codes */
-  register uint32_t b;     /* bit buffer */
-  register uint32_t k; /* number of bits in bit buffer */
-
-  /* make local bit buffer */
-  b = ZIP(bb);
-  k = ZIP(bk);
-  ll = ZIP(ll);
-
-  /* read in table lengths */
-  ZIPNEEDBITS(5)
-  nl = 257 + ((uint32_t)b & 0x1f);      /* number of literal/length codes */
-  ZIPDUMPBITS(5)
-  ZIPNEEDBITS(5)
-  nd = 1 + ((uint32_t)b & 0x1f);        /* number of distance codes */
-  ZIPDUMPBITS(5)
-  ZIPNEEDBITS(4)
-  nb = 4 + ((uint32_t)b & 0xf);         /* number of bit length codes */
-  ZIPDUMPBITS(4)
-  if(nl > 288 || nd > 32)
-    return 1;                   /* bad lengths */
-
-  /* read in bit-length-code lengths */
-  for(j = 0; j < nb; j++)
-  {
-    ZIPNEEDBITS(3)
-    ll[Zipborder[j]] = (uint32_t)b & 7;
-    ZIPDUMPBITS(3)
-  }
-  for(; j < 19; j++)
-    ll[Zipborder[j]] = 0;
-
-  /* build decoding table for trees--single level, 7 bit lookup */
-  bl = 7;
-  if((i = Ziphuft_build(decomp_state, ll, 19, 19, NULL, NULL, &tl, &bl)) != 0)
-  {
-    if(i == 1)
-      Ziphuft_free(tl);
-    return i;                   /* incomplete code set */
-  }
-
-  /* read in literal and distance code lengths */
-  n = nl + nd;
-  m = Zipmask[bl];
-  i = l = 0;
-  while((uint32_t)i < n)
-  {
-    ZIPNEEDBITS((uint32_t)bl)
-    j = (td = tl + ((uint32_t)b & m))->b;
-    ZIPDUMPBITS(j)
-    j = td->v.n;
-    if (j < 16)                 /* length of code in bits (0..15) */
-      ll[i++] = l = j;          /* save last length in l */
-    else if (j == 16)           /* repeat last length 3 to 6 times */
-    {
-      ZIPNEEDBITS(2)
-      j = 3 + ((uint32_t)b & 3);
-      ZIPDUMPBITS(2)
-      if((uint32_t)i + j > n)
-        return 1;
-      while (j--)
-        ll[i++] = l;
-    }
-    else if (j == 17)           /* 3 to 10 zero length codes */
-    {
-      ZIPNEEDBITS(3)
-      j = 3 + ((uint32_t)b & 7);
-      ZIPDUMPBITS(3)
-      if ((uint32_t)i + j > n)
-        return 1;
-      while (j--)
-        ll[i++] = 0;
-      l = 0;
-    }
-    else                        /* j == 18: 11 to 138 zero length codes */
-    {
-      ZIPNEEDBITS(7)
-      j = 11 + ((uint32_t)b & 0x7f);
-      ZIPDUMPBITS(7)
-      if ((uint32_t)i + j > n)
-        return 1;
-      while (j--)
-        ll[i++] = 0;
-      l = 0;
-    }
-  }
-
-  /* free decoding table for trees */
-  Ziphuft_free(tl);
-
-  /* restore the global bit buffer */
-  ZIP(bb) = b;
-  ZIP(bk) = k;
-
-  /* build the decoding tables for literal/length and distance codes */
-  bl = ZIPLBITS;
-  if((i = Ziphuft_build(decomp_state, ll, nl, 257, Zipcplens, Zipcplext, &tl, &bl)) != 0)
-  {
-    if(i == 1)
-      Ziphuft_free(tl);
-    return i;                   /* incomplete code set */
-  }
-  bd = ZIPDBITS;
-  Ziphuft_build(decomp_state, ll + nl, nd, 0, Zipcpdist, Zipcpdext, &td, &bd);
-
-  /* decompress until an end-of-block code */
-  if(Zipinflate_codes(decomp_state, tl, td, bl, bd))
-    return 1;
-
-  /* free the decoding tables, return */
-  Ziphuft_free(tl);
-  Ziphuft_free(td);
-  return 0;
-}
-
-/* e == last block flag */
-static int32_t Zipinflate_block(struct decomp_state *decomp_state, int32_t *e)
-{ /* decompress an inflated block */
-  uint32_t t;                  /* block type */
-  register uint32_t b;     /* bit buffer */
-  register uint32_t k;     /* number of bits in bit buffer */
-
-  DEBUG(10,("Zipinflate_block\n"));
-
-  /* make local bit buffer */
-  b = ZIP(bb);
-  k = ZIP(bk);
-
-  /* read in last block bit */
-  ZIPNEEDBITS(1)
-  *e = (int32_t)b & 1;
-  ZIPDUMPBITS(1)
-
-  /* read in block type */
-  ZIPNEEDBITS(2)
-  t = (uint32_t)b & 3;
-  ZIPDUMPBITS(2)
-
-  /* restore the global bit buffer */
-  ZIP(bb) = b;
-  ZIP(bk) = k;
-
-  DEBUG(10,("inflate type %d\n", t));
-
-  /* inflate that block type */
-  if(t == 2)
-    return Zipinflate_dynamic(decomp_state);
-  if(t == 0)
-    return Zipinflate_stored(decomp_state);
-  if(t == 1)
-    return Zipinflate_fixed(decomp_state);
-  /* bad block type */
-  return 2;
-}
-
-_PUBLIC_ struct decomp_state *ZIPdecomp_state(TALLOC_CTX *mem_ctx)
-{
-       return talloc_zero(mem_ctx, struct decomp_state);