From 59b79e2d672a5183f345a3aae45bb615d495d122 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 19 Nov 2012 23:25:45 +1100 Subject: [PATCH 1/7] lib/replace: Do not use STRERROR_R_PROTO_COMPATIBLE as only roken.h sets this Currently, we put strerror_r into libreplace even on systems with strerror_r. Andrew Bartlett Reviewed-by: Andreas Schneider --- lib/replace/replace.c | 2 +- lib/replace/replace.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/replace/replace.c b/lib/replace/replace.c index 7ee5f4b..f37d69f 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -785,7 +785,7 @@ char *rep_get_current_dir_name(void) } #endif -#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE) +#if !defined(HAVE_STRERROR_R) && !defined(strerror_r) int rep_strerror_r(int errnum, char *buf, size_t buflen) { char *s = strerror(errnum); diff --git a/lib/replace/replace.h b/lib/replace/replace.h index cb412c2..4cdc362 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -570,9 +570,7 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset) char *rep_get_current_dir_name(void); #endif -#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE) -#undef strerror_r -#define strerror_r rep_strerror_r +#if !defined(HAVE_STRERROR_R) && !defined(strerror_r) int rep_strerror_r(int errnum, char *buf, size_t buflen); #endif -- 1.8.0 From 4ee75e3b9a6fb2e52aa1030d447002469b147742 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Nov 2012 15:34:43 +1100 Subject: [PATCH 2/7] build: Use ntlm_auth from source3 as the only ntlm_auth installed on the system The ntlm_auth4 binary is untested, and is missing major features compared with the source3 binary. The two are being slowly merged, but I have not finished that. Andrew Bartlett Reviewed-by: Andreas Schneider --- selftest/wscript | 2 +- source3/wscript_build | 2 +- source4/utils/wscript_build | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/selftest/wscript b/selftest/wscript index a5b2e53..4733dc1 100644 --- a/selftest/wscript +++ b/selftest/wscript @@ -121,7 +121,7 @@ def cmd_testonly(opt): 'smbclient3:smbclient,' + 'smbclient4:smbclient4,' + 'smbtorture4:smbtorture,' + - 'ntlm_auth3:ntlm_auth3') + 'ntlm_auth3:ntlm_auth') env.OPTIONS = '--binary-mapping=%s' % binary_mapping if not Options.options.SLOWTEST: diff --git a/source3/wscript_build b/source3/wscript_build index 351d22d..d21aa7b 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -1568,7 +1568,7 @@ bld.SAMBA3_BINARY('versiontest', param''', vars=locals()) -bld.SAMBA3_BINARY('ntlm_auth' + bld.env.suffix3, +bld.SAMBA3_BINARY('ntlm_auth', source=NTLM_AUTH_SRC, deps=''' talloc diff --git a/source4/utils/wscript_build b/source4/utils/wscript_build index da937dd..3b21eda 100644 --- a/source4/utils/wscript_build +++ b/source4/utils/wscript_build @@ -1,11 +1,13 @@ #!/usr/bin/env python -bld.SAMBA_BINARY('ntlm_auth', - source='ntlm_auth.c', - manpages='man/ntlm_auth.1', - deps='''samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS gensec LIBCLI_RESOLVE - auth4 NTLMSSP_COMMON MESSAGING events service''', - pyembed=True +bld.SAMBA_BINARY('ntlm_auth4', + source='ntlm_auth.c', + manpages='man/ntlm_auth.1', + deps='''samba-hostconfig samba-util popt + POPT_SAMBA POPT_CREDENTIALS gensec LIBCLI_RESOLVE + auth4 NTLMSSP_COMMON MESSAGING events service''', + pyembed=True, + install=False ) -- 1.8.0 From a272bd5a3c33485cafffd26a2e4307a7cae0cc22 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Nov 2012 16:00:53 +1100 Subject: [PATCH 3/7] torture: remove source3 locktest and masktest We now just build these in waf, using the source4/torture code. The source4 versions of these are tested in make test. Andrew Bartlett Reviewed-by: Andreas Schneider --- source3/Makefile.in | 9 - source3/torture/locktest.c | 692 --------------------------------------------- source3/wscript_build | 21 -- 3 files changed, 722 deletions(-) delete mode 100644 source3/torture/locktest.c diff --git a/source3/Makefile.in b/source3/Makefile.in index 759ee5a..03a6ab3 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -221,7 +221,6 @@ BIN_PROGS3 = bin/smbpasswd bin/rpcclient bin/smbcacls \ bin/smbcquotas bin/eventlogadm TORTURE_PROGS = bin/smbtorture bin/msgtest \ - bin/masktest bin/locktest \ bin/locktest2 bin/nsstest bin/vfstest \ $(TALLOCTORT) bin/replacetort \ $(TDBTORTURE) $(PTHREADPOOLTEST) \ @@ -1278,18 +1277,10 @@ SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) $(TLDAP_OBJ) \ lib/filename_util.o \ $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBCLI_ECHO_OBJ) -MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ - $(LIB_NONSMBD_OBJ) \ - $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) - MSGTEST_OBJ = torture/msgtest.o $(PARAM_OBJ) $(LIBSMB_ERR_OBJ) \ $(LIB_NONSMBD_OBJ) \ $(LIBNDR_GEN_OBJ0) -LOCKTEST_OBJ = torture/locktest.o $(PARAM_OBJ) $(LOCKING_OBJ) $(KRBCLIENT_OBJ) \ - $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \ - $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(FNAME_UTIL_OBJ) - NSSTEST_OBJ = ../nsswitch/nsstest.o ../lib/util/setid.o $(LIBSAMBAUTIL_OBJ) VFSTEST_OBJ = torture/cmd_vfs.o torture/vfstest.o $(SMBD_OBJ_BASE) $(READLINE_OBJ) \ diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c deleted file mode 100644 index 04928f2..0000000 --- a/source3/torture/locktest.c +++ /dev/null @@ -1,692 +0,0 @@ -/* - Unix SMB/CIFS implementation. - randomised byte range lock tester - Copyright (C) Andrew Tridgell 1999 - - 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 . -*/ - -#include "includes.h" -#include "libsmb/libsmb.h" -#include "system/filesys.h" -#include "locking/proto.h" -#include "libsmb/nmblib.h" -#include "../libcli/smb/smbXcli_base.h" - -static fstring password[2]; -static fstring username[2]; -static int got_user; -static int got_pass; -static bool use_kerberos; -static int numops = 1000; -static bool showall; -static bool analyze; -static bool hide_unlock_fails; -static bool use_oplocks; -static unsigned lock_range = 100; -static unsigned lock_base = 0; -static unsigned min_length = 0; -static bool exact_error_codes; -static bool zero_zero; - -extern char *optarg; -extern int optind; - -#define FILENAME "\\locktest.dat" - -#define READ_PCT 50 -#define LOCK_PCT 45 -#define UNLOCK_PCT 70 -#define RANGE_MULTIPLE 1 -#define NSERVERS 2 -#define NCONNECTIONS 2 -#define NFILES 2 -#define LOCK_TIMEOUT 0 - -#define NASTY_POSIX_LOCK_HACK 0 - -enum lock_op {OP_LOCK, OP_UNLOCK, OP_REOPEN}; - -static const char *lock_op_type(int op) -{ - if (op == WRITE_LOCK) return "write"; - else if (op == READ_LOCK) return "read"; - else return "other"; -} - -static const char *lock_op_name(enum lock_op op) -{ - if (op == OP_LOCK) return "lock"; - else if (op == OP_UNLOCK) return "unlock"; - else return "reopen"; -} - -struct record { - enum lock_op lock_op; - enum brl_type lock_type; - char conn, f; - uint64_t start, len; - char needed; -}; - -#define PRESETS 0 - -#if PRESETS -static struct record preset[] = { -{OP_LOCK, WRITE_LOCK, 0, 0, 2, 0, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 0, 0, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 3, 0, 1}, -{OP_UNLOCK, 0 , 0, 0, 2, 0, 1}, -{OP_REOPEN, 0, 0, 0, 0, 0, 1}, - -{OP_LOCK, READ_LOCK, 0, 0, 2, 0, 1}, -{OP_LOCK, READ_LOCK, 0, 0, 1, 1, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 0, 0, 1}, -{OP_REOPEN, 0, 0, 0, 0, 0, 1}, - -{OP_LOCK, READ_LOCK, 0, 0, 2, 0, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 3, 1, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 0, 0, 1}, -{OP_REOPEN, 0, 0, 0, 0, 0, 1}, - -{OP_LOCK, READ_LOCK, 0, 0, 2, 0, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 1, 1, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 0, 0, 1}, -{OP_REOPEN, 0, 0, 0, 0, 0, 1}, - -{OP_LOCK, WRITE_LOCK, 0, 0, 2, 0, 1}, -{OP_LOCK, READ_LOCK, 0, 0, 1, 1, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 0, 0, 1}, -{OP_REOPEN, 0, 0, 0, 0, 0, 1}, - -{OP_LOCK, WRITE_LOCK, 0, 0, 2, 0, 1}, -{OP_LOCK, READ_LOCK, 0, 0, 3, 1, 1}, -{OP_LOCK, WRITE_LOCK, 0, 0, 0, 0, 1}, -{OP_REOPEN, 0, 0, 0, 0, 0, 1}, - -}; -#endif - -static struct record *recorded; - -static void print_brl(struct file_id id, - struct server_id pid, - enum brl_type lock_type, - enum brl_flavour lock_flav, - br_off start, - br_off size, - void *private_data) -{ -#if NASTY_POSIX_LOCK_HACK - { - static SMB_INO_T lastino; - - if (lastino != ino) { - char *cmd; - if (asprintf(&cmd, - "egrep POSIX.*%u /proc/locks", (int)ino) > 0) { - system(cmd); - SAFE_FREE(cmd); - } - } - lastino = ino; - } -#endif - - printf("%s %s %s %.0f:%.0f(%.0f)\n", - procid_str_static(&pid), file_id_string_tos(&id), - lock_type==READ_LOCK?"R":"W", - (double)start, (double)start+size-1,(double)size); - -} - - -static void show_locks(void) -{ - brl_forall(print_brl, NULL); - /* system("cat /proc/locks"); */ -} - - -/***************************************************** -return a connection to a server -*******************************************************/ -static struct cli_state *connect_one(char *share, int snum) -{ - struct cli_state *c; - char *server_n; - fstring server; - fstring myname; - static int count; - NTSTATUS status; - int flags = 0; - - fstrcpy(server,share+2); - share = strchr_m(server,'\\'); - if (!share) return NULL; - *share = 0; - share++; - - server_n = server; - - slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++); - - /* have to open a new connection */ - - if (use_kerberos) { - flags |= CLI_FULL_CONNECTION_USE_KERBEROS; - } - if (use_oplocks) { - flags |= CLI_FULL_CONNECTION_OPLOCKS; - } - - status = cli_connect_nb(server_n, NULL, 0, 0x20, myname, - SMB_SIGNING_DEFAULT, flags, &c); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Connection to %s failed. Error %s\n", server_n, - nt_errstr(status))); - return NULL; - } - - status = smbXcli_negprot(c->conn, c->timeout, PROTOCOL_CORE, - PROTOCOL_NT1); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("protocol negotiation failed: %s\n", - nt_errstr(status))); - cli_shutdown(c); - return NULL; - } - - if (!got_pass) { - char *pass = getpass("Password: "); - if (pass) { - fstrcpy(password[0], pass); - fstrcpy(password[1], pass); - } - } - - if (got_pass == 1) { - strlcpy(password[1], password[0],sizeof(password[1])); - strlcpy(username[1], username[0],sizeof(username[1])); - } - - status = cli_session_setup(c, username[snum], - password[snum], strlen(password[snum]), - password[snum], strlen(password[snum]), - lp_workgroup()); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("session setup failed: %s\n", nt_errstr(status))); - return NULL; - } - - /* - * These next two lines are needed to emulate - * old client behaviour for people who have - * scripts based on client output. - * QUESTION ? Do we want to have a 'client compatibility - * mode to turn these on/off ? JRA. - */ - - if (*c->server_domain || *c->server_os || *c->server_type) - DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n", - c->server_domain,c->server_os,c->server_type)); - - DEBUG(4,(" session setup ok\n")); - - status = cli_tree_connect(c, share, "?????", password[snum], - strlen(password[snum])+1); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("tree connect failed: %s\n", nt_errstr(status))); - cli_shutdown(c); - return NULL; - } - - DEBUG(4,(" tconx ok\n")); - - return c; -} - - -static void reconnect(struct cli_state *cli[NSERVERS][NCONNECTIONS], uint16_t fnum[NSERVERS][NCONNECTIONS][NFILES], - char *share[NSERVERS]) -{ - int server, conn, f; - - for (server=0;serverconn; - unsigned f = rec->f; - uint64_t start = rec->start; - uint64_t len = rec->len; - enum brl_type op = rec->lock_type; - int server; - NTSTATUS status[NSERVERS]; - - switch (rec->lock_op) { - case OP_LOCK: - /* set a lock */ - for (server=0;server %s:%s\n", - conn, f, - (double)start, (double)len, - op==READ_LOCK?"READ_LOCK":"WRITE_LOCK", - nt_errstr(status[0]), nt_errstr(status[1])); - } - if (showall || !NT_STATUS_EQUAL(status[0],status[1])) show_locks(); - if (!NT_STATUS_EQUAL(status[0],status[1])) return False; - break; - - case OP_UNLOCK: - /* unset a lock */ - for (server=0;server %s:%s\n", - conn, f, - (double)start, (double)len, - nt_errstr(status[0]), nt_errstr(status[1])); - } - if (showall || !NT_STATUS_EQUAL(status[0],status[1])) show_locks(); - if (!hide_unlock_fails && !NT_STATUS_EQUAL(status[0],status[1])) - return False; - break; - - case OP_REOPEN: - /* reopen the file */ - for (server=0;server 1) { - skip = skip/2; - printf("skip=%d\n", skip); - continue; - } - - if (n1 == n) break; - } - - close_files(cli, fnum); - reconnect(cli, fnum, share); - open_files(cli, fnum); - showall = True; - n1 = retest(cli, fnum, n); - if (n1 != n-1) { - printf("ERROR - inconsistent result (%u %u)\n", n1, n); - } - close_files(cli, fnum); - - for (i=0;i Date: Wed, 21 Nov 2012 16:32:38 +1100 Subject: [PATCH 4/7] build: Be consistent with the name of smbtorture binaries This ensures that in both build systems, smbtorture3 is the source3 binary, and smbtoture is our main smbtorture binary, built with waf. Also included in this is the removal of bin/ndrdump4 as a special case. This removes the last cases of binaries with different names in each build system. Andrew Bartlett Reviewed-by: Andreas Schneider --- packaging/RHEL-CTDB/configure.rpm | 2 +- packaging/RHEL-CTDB/samba.spec.tmpl | 2 +- script/autobuild.py | 4 ++-- .../{Makefile-smbtorture4 => Makefile-smbtorture} | 14 ++++---------- source3/Makefile.in | 17 +++++++---------- source3/configure.in | 22 +++++++++++----------- source3/selftest/s3-selftest.sh | 4 ++-- 7 files changed, 28 insertions(+), 37 deletions(-) rename source3/{Makefile-smbtorture4 => Makefile-smbtorture} (70%) diff --git a/packaging/RHEL-CTDB/configure.rpm b/packaging/RHEL-CTDB/configure.rpm index 4387da1..d0ae8b5 100755 --- a/packaging/RHEL-CTDB/configure.rpm +++ b/packaging/RHEL-CTDB/configure.rpm @@ -66,7 +66,7 @@ CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE -O3" ./configure -C \ --without-dnsupdate \ --with-aio-support \ --disable-merged-build \ - --disable-smbtorture4 \ + --disable-smbtorture \ --disable-external-libtalloc \ --disable-external-libtdb \ $* diff --git a/packaging/RHEL-CTDB/samba.spec.tmpl b/packaging/RHEL-CTDB/samba.spec.tmpl index 16d2fa4..a57269e 100644 --- a/packaging/RHEL-CTDB/samba.spec.tmpl +++ b/packaging/RHEL-CTDB/samba.spec.tmpl @@ -184,7 +184,7 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \ --without-dnsupdate \ --with-aio-support \ --disable-merged-build \ - --disable-smbtorture4 \ + --disable-smbtorture \ --disable-external-libtalloc \ --disable-external-libtdb diff --git a/script/autobuild.py b/script/autobuild.py index efef2f4..1182d7f 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -39,10 +39,10 @@ tasks = { "samba3" : [ ("autogen", "./autogen.sh", "text/plain"), ("configure", "./configure.developer ${PREFIX}", "text/plain"), ("make basics", "make basics", "text/plain"), - # we split 'make -j 4', 'make bin/smbtorture4' and 'make -j 4 everything' + # we split 'make -j 4', 'make bin/smbtorture' and 'make -j 4 everything' # because it makes it much easier to find errors. ("make", "make -j 4", "text/plain"), # don't use too many processes - ("make bin/smbtorture4", "make bin/smbtorture4", "text/plain"), + ("make bin/smbtorture", "make bin/smbtorture", "text/plain"), ("make everything", "make -j 4 everything", "text/plain"), ("install", "make install", "text/plain"), ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"), diff --git a/source3/Makefile-smbtorture4 b/source3/Makefile-smbtorture similarity index 70% rename from source3/Makefile-smbtorture4 rename to source3/Makefile-smbtorture index dbc0e6d..4b5b143 100644 --- a/source3/Makefile-smbtorture4 +++ b/source3/Makefile-smbtorture @@ -1,7 +1,7 @@ WAF_BINARY=buildtools/bin/waf WAF=$(WAF_BINARY) WAF_BUILD=WAF_MAKE=1 $(WAF_BINARY) -SAMBA4_BINARIES="smbtorture,ndrdump" +SAMBA4_BINARIES="smbtorture" samba4-configure: @(cd .. && \ @@ -10,17 +10,11 @@ samba4-configure: .PHONY: samba4-configure -bin/smbtorture4: $(BINARY_PREREQS) samba4-configure samba4-config-compare +bin/smbtorture: $(BINARY_PREREQS) samba4-configure samba4-config-compare cd .. && $(WAF_BUILD) --targets=smbtorture - cp ../bin/smbtorture bin/smbtorture4 + cp ../bin/smbtorture bin/smbtorture -.PHONY: bin/smbtorture4 - -bin/ndrdump4: $(BINARY_PREREQS) samba4-configure - cd .. && $(WAF_BUILD) --targets=ndrdump - cp ../bin/ndrdump bin/ndrdump4 - -.PHONY: bin/ndrdump4 +.PHONY: bin/smbtorture samba4-config-compare: samba4-configure @echo "Comparing config.h from autoconf and waf" diff --git a/source3/Makefile.in b/source3/Makefile.in index 03a6ab3..772a590 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -220,7 +220,7 @@ BIN_PROGS3 = bin/smbpasswd bin/rpcclient bin/smbcacls \ bin/profiles bin/ntlm_auth bin/sharesec \ bin/smbcquotas bin/eventlogadm -TORTURE_PROGS = bin/smbtorture bin/msgtest \ +TORTURE_PROGS = bin/smbtorture3 bin/msgtest \ bin/locktest2 bin/nsstest bin/vfstest \ $(TALLOCTORT) bin/replacetort \ $(TDBTORTURE) $(PTHREADPOOLTEST) \ @@ -1601,9 +1601,9 @@ pam_winbind: SHOWFLAGS bin/pam_winbind.@SHLIBEXT@ gpext_modules:: $(GPEXT_MODULES) -torture:: SHOWFLAGS basics $(TORTURE_PROGS) @SMBTORTURE4@ +torture:: SHOWFLAGS basics $(TORTURE_PROGS) @SMBTORTURE@ -smbtorture : SHOWFLAGS bin/smbtorture +smbtorture3 : SHOWFLAGS bin/smbtorture3 masktest : SHOWFLAGS bin/masktest @@ -1954,7 +1954,7 @@ bin/nmblookup: $(BINARY_PREREQS) $(NMBLOOKUP_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LI @$(CC) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \ $(POPT_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) -bin/smbtorture: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) $(IDMAP_UTIL_OBJ) +bin/smbtorture3: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) $(IDMAP_UTIL_OBJ) @echo Linking $@ @$(CC) -o $@ $(SMBTORTURE_OBJ) $(IDMAP_UTIL_OBJ) $(LDFLAGS) $(DYNEXP) \ $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) \ @@ -3350,13 +3350,10 @@ libnetapi_examples: libnetapi clean_libnetapi_examples: $(MAKE) -C lib/netapi/examples clean -.PHONY: bin/smbtorture4 bin/ndrdump4 +.PHONY: bin/smbtorture -bin/smbtorture4: $(BINARY_PREREQS) - $(MAKE) -f Makefile-smbtorture4 bin/smbtorture4 - -bin/ndrdump4: $(BINARY_PREREQS) - $(MAKE) -f Makefile-smbtorture4 bin/ndrdump4 +bin/smbtorture: $(BINARY_PREREQS) + $(MAKE) -f Makefile-smbtorture bin/smbtorture .PHONY: vfs_examples diff --git a/source3/configure.in b/source3/configure.in index 2dfc388..b8e76de 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -203,13 +203,13 @@ AC_ARG_WITH(profiling-data, ) dnl Checks for programs. -AC_ARG_ENABLE(smbtorture4, - [AS_HELP_STRING([--enable-smbtorture4], [Enable building smbtorture4 (default=auto)])]) +AC_ARG_ENABLE(smbtorture, + [AS_HELP_STRING([--enable-smbtorture], [Enable building smbtorture (default=auto)])]) -if test x$enable_smbtorture4 != xno; then - smbtorture4_possible=yes +if test x$enable_smbtorture != xno; then + smbtorture_possible=yes else - smbtorture4_possible=no + smbtorture_possible=no fi AC_PROG_INSTALL @@ -220,11 +220,11 @@ AC_SAMBA_GNU_MAKE([true], [true]) # Check for perl m4_include(../m4/check_perl.m4) -AC_SAMBA_PERL([true], [smbtorture4_possible=no]) +AC_SAMBA_PERL([true], [smbtorture_possible=no]) # Check for python m4_include(../m4/check_python.m4) -AC_SAMBA_PYTHON_DEVEL([true], [smbtorture4_possible=no]) +AC_SAMBA_PYTHON_DEVEL([true], [smbtorture_possible=no]) AC_CHECK_TOOL(AR, ar) @@ -1710,7 +1710,7 @@ if test x"$BLDSHARED" != x"true"; then SHLD="shared-libraries-disabled" PICFLAG="${PIE_CFLAGS}" SHLIBEXT="shared_libraries_disabled" - smbtorture4_possible=no + smbtorture_possible=no fi AC_MSG_CHECKING([used PICFLAG]) @@ -6525,9 +6525,9 @@ fi m4_include(../lib/zlib/zlib.m4) -if test x$smbtorture4_possible = xyes; then - SMBTORTURE4="bin/smbtorture4" - AC_SUBST(SMBTORTURE4) +if test x$smbtorture_possible = xyes; then + SMBTORTURE="bin/smbtorture" + AC_SUBST(SMBTORTURE) fi AC_SUBST(ZLIB_LIBS) diff --git a/source3/selftest/s3-selftest.sh b/source3/selftest/s3-selftest.sh index 335398a..10cf115 100755 --- a/source3/selftest/s3-selftest.sh +++ b/source3/selftest/s3-selftest.sh @@ -24,7 +24,7 @@ st_test_done() { if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then ( rm -f ${SELFTESTPREFIX}/st_done && \ ${PERL} ${SELFTESTDIR}/selftest.pl \ - --binary-mapping=smbtorture3:smbtorture,nmblookup3:nmblookup,nmblookup4:nmblookup4,smbclient3:smbclient,smbclient4:smbclient4,ntlm_auth3:ntlm_auth \ + --binary-mapping=smbtorture3:smbtorture3,nmblookup3:nmblookup,nmblookup4:nmblookup4,smbclient3:smbclient,smbclient4:smbclient4,ntlm_auth3:ntlm_auth,smbtorture4:smbtorture \ --prefix=${SELFTESTPREFIX} --target=samba3 \ --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \ --exclude=${SELFTESTDIR}/skip \ @@ -38,7 +38,7 @@ if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then else ( rm -f ${SELFTESTPREFIX}/st_done && \ ${PERL} ${SELFTESTDIR}/selftest.pl \ - --binary-mapping=smbtorture3:smbtorture,nmblookup3:nmblookup,nmblookup4:nmblookup4,smbclient3:smbclient,smbclient4:smbclient4,ntlm_auth3:ntlm_auth \ + --binary-mapping=smbtorture3:smbtorture3,nmblookup3:nmblookup,nmblookup4:nmblookup4,smbclient3:smbclient,smbclient4:smbclient4,ntlm_auth3:ntlm_auth,smbtorture4:smbtorture \ --prefix=${SELFTESTPREFIX} --target=samba3 \ --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \ --exclude=${SELFTESTDIR}/skip \ -- 1.8.0 From 1da30c2ebce7406f106fa355edda14d9f9227da8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Nov 2012 17:52:35 +1100 Subject: [PATCH 5/7] build: Remove --enable-smbtorture, require bin/smbtorture (from waf) for make test This simply moves this to being a side-effect of --enable-selftest. The flag was renamed from --enable-smbtorture4 in a recent patch. Make test now relies on smbtorture4, and so this code to make the dependency optional for the tests is not required any more. Andrew Bartlett Reviewed-by: Andreas Schneider --- packaging/RHEL-CTDB/configure.rpm | 1 - packaging/RHEL-CTDB/samba.spec.tmpl | 1 - source3/Makefile.in | 6 +++--- source3/configure.in | 24 +++++++----------------- source3/m4/check_path.m4 | 1 + 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/packaging/RHEL-CTDB/configure.rpm b/packaging/RHEL-CTDB/configure.rpm index d0ae8b5..d6d7c5b 100755 --- a/packaging/RHEL-CTDB/configure.rpm +++ b/packaging/RHEL-CTDB/configure.rpm @@ -66,7 +66,6 @@ CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE -O3" ./configure -C \ --without-dnsupdate \ --with-aio-support \ --disable-merged-build \ - --disable-smbtorture \ --disable-external-libtalloc \ --disable-external-libtdb \ $* diff --git a/packaging/RHEL-CTDB/samba.spec.tmpl b/packaging/RHEL-CTDB/samba.spec.tmpl index a57269e..978f1a6 100644 --- a/packaging/RHEL-CTDB/samba.spec.tmpl +++ b/packaging/RHEL-CTDB/samba.spec.tmpl @@ -184,7 +184,6 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \ --without-dnsupdate \ --with-aio-support \ --disable-merged-build \ - --disable-smbtorture \ --disable-external-libtalloc \ --disable-external-libtdb diff --git a/source3/Makefile.in b/source3/Makefile.in index 772a590..c729e20 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -1601,7 +1601,7 @@ pam_winbind: SHOWFLAGS bin/pam_winbind.@SHLIBEXT@ gpext_modules:: $(GPEXT_MODULES) -torture:: SHOWFLAGS basics $(TORTURE_PROGS) @SMBTORTURE@ +torture:: SHOWFLAGS basics $(TORTURE_PROGS) smbtorture3 : SHOWFLAGS bin/smbtorture3 @@ -3277,7 +3277,7 @@ test_pam_modules:: pam_modules ## Targets for 'make test' ## -valgrindtest:: all torture timelimit +valgrindtest:: all torture timelimit bin/smbtorture @echo Running Test suite with valgrind @$(MAKE) test \ NMBD_VALGRIND="xterm -n nmbd -e valgrind -q --db-attach=yes --num-callers=30" \ @@ -3289,7 +3289,7 @@ selftestdir = ../selftest S3_LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)="$(builddir)/bin:$$$(LIB_PATH_VAR)" -test:: all torture timelimit +test:: all torture timelimit bin/smbtorture @LIB_PATH_VAR=$(LIB_PATH_VAR) $(S3_LD_LIBPATH_OVERRIDE) \ NSS_WRAPPER_WINBIND_SO_PATH="$(srcdir)/../nsswitch/libnss_winbind.so" \ SELFTESTDIR="$(selftestdir)" SELFTESTPREFIX="$(selftest_prefix)" \ diff --git a/source3/configure.in b/source3/configure.in index b8e76de..b97dba8 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -202,29 +202,21 @@ AC_ARG_WITH(profiling-data, AC_MSG_RESULT(no) ) -dnl Checks for programs. -AC_ARG_ENABLE(smbtorture, - [AS_HELP_STRING([--enable-smbtorture], [Enable building smbtorture (default=auto)])]) - -if test x$enable_smbtorture != xno; then - smbtorture_possible=yes -else - smbtorture_possible=no -fi - AC_PROG_INSTALL AC_PROG_AWK # Check for GNU make m4_include(../m4/check_make.m4) AC_SAMBA_GNU_MAKE([true], [true]) +selftest_possible="yes" + # Check for perl m4_include(../m4/check_perl.m4) -AC_SAMBA_PERL([true], [smbtorture_possible=no]) +AC_SAMBA_PERL([true], [selftest_possible=no]) # Check for python m4_include(../m4/check_python.m4) -AC_SAMBA_PYTHON_DEVEL([true], [smbtorture_possible=no]) +AC_SAMBA_PYTHON_DEVEL([true], [selftest_possible=no]) AC_CHECK_TOOL(AR, ar) @@ -6447,6 +6439,9 @@ AC_MSG_CHECKING(whether to enable features for selftest) if test x"$selftest" = x"yes"; then AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_SELFTEST, 1, [Support features needed for selftest]) + if test x"$selftest_possible" != xyes; then + AC_MSG_ERROR(selftest support only possible with python, including development headers, and perl installed) + fi else AC_MSG_RESULT(no) fi @@ -6525,11 +6520,6 @@ fi m4_include(../lib/zlib/zlib.m4) -if test x$smbtorture_possible = xyes; then - SMBTORTURE="bin/smbtorture" - AC_SUBST(SMBTORTURE) -fi - AC_SUBST(ZLIB_LIBS) AC_SUBST(ZLIB_OBJS) AC_ZLIB([ZLIB_OBJS=""], [ diff --git a/source3/m4/check_path.m4 b/source3/m4/check_path.m4 index 1932a33..94c36bc 100644 --- a/source3/m4/check_path.m4 +++ b/source3/m4/check_path.m4 @@ -42,6 +42,7 @@ AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on develope [if eval "test x$enable_developer = xyes"; then debug=yes developer=yes + selftest=yes fi]) AC_SUBST(selftest) -- 1.8.0 From bd1b408226803a4b8d925358f93f5e76a1f014dd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Nov 2012 19:52:50 +1100 Subject: [PATCH 6/7] packaging: Remove long-gone --disable-merged-build from RHEL-CTDB packaging Reviewed-by: Andreas Schneider --- packaging/RHEL-CTDB/configure.rpm | 1 - packaging/RHEL-CTDB/samba.spec.tmpl | 1 - 2 files changed, 2 deletions(-) diff --git a/packaging/RHEL-CTDB/configure.rpm b/packaging/RHEL-CTDB/configure.rpm index d6d7c5b..f16b352 100755 --- a/packaging/RHEL-CTDB/configure.rpm +++ b/packaging/RHEL-CTDB/configure.rpm @@ -65,7 +65,6 @@ CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE -O3" ./configure -C \ --without-ldb \ --without-dnsupdate \ --with-aio-support \ - --disable-merged-build \ --disable-external-libtalloc \ --disable-external-libtdb \ $* diff --git a/packaging/RHEL-CTDB/samba.spec.tmpl b/packaging/RHEL-CTDB/samba.spec.tmpl index 978f1a6..e79674f 100644 --- a/packaging/RHEL-CTDB/samba.spec.tmpl +++ b/packaging/RHEL-CTDB/samba.spec.tmpl @@ -183,7 +183,6 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \ --without-ldb \ --without-dnsupdate \ --with-aio-support \ - --disable-merged-build \ --disable-external-libtalloc \ --disable-external-libtdb -- 1.8.0 From 8bbfc19542da2d767f1cd72aa7cc22883c145470 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Nov 2012 20:20:46 +1100 Subject: [PATCH 7/7] build: Do not install testing binaries These binaries are for developer or selftest use, and are not supported for installation onto the system. The autoconf build does not install these binaries, and so neither should the waf build. Andrew Bartlett Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Nov 22 12:00:36 CET 2012 on sn-devel-104 --- nsswitch/wscript_build | 7 ++++--- source3/lib/asys/wscript_build | 3 ++- source3/lib/pthreadpool/wscript_build | 3 ++- source3/wscript_build | 16 ++++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build index a94c02c..1efee55 100644 --- a/nsswitch/wscript_build +++ b/nsswitch/wscript_build @@ -12,9 +12,10 @@ bld.SAMBA_LIBRARY('winbind-client', bld.SAMBA_BINARY('nsstest', - source='nsstest.c', - deps='replace dl' - ) + source='nsstest.c', + deps='replace dl', + install=False + ) # The nss_wrapper code relies strictly on the linux implementation and # name, so compile but do not install a copy under this name. diff --git a/source3/lib/asys/wscript_build b/source3/lib/asys/wscript_build index 7b6d236..15de977 100644 --- a/source3/lib/asys/wscript_build +++ b/source3/lib/asys/wscript_build @@ -6,4 +6,5 @@ bld.SAMBA3_SUBSYSTEM('LIBASYS', bld.SAMBA3_BINARY('asystest', source='tests.c', - deps='LIBASYS') + deps='LIBASYS', + install=False) diff --git a/source3/lib/pthreadpool/wscript_build b/source3/lib/pthreadpool/wscript_build index 2cdd2ab..bdd5f53 100644 --- a/source3/lib/pthreadpool/wscript_build +++ b/source3/lib/pthreadpool/wscript_build @@ -13,4 +13,5 @@ else: bld.SAMBA3_BINARY('pthreadpooltest', source='tests.c', deps='PTHREADPOOL', - enabled=bld.env.WITH_PTHREADPOOL) + enabled=bld.env.WITH_PTHREADPOOL, + install=False) diff --git a/source3/wscript_build b/source3/wscript_build index fc8496c..b87b4d1 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -1438,6 +1438,7 @@ bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3, NDR_OPEN_FILES idmap ''', + install=False, vars=locals()) bld.SAMBA3_BINARY('smbconftort', @@ -1446,6 +1447,7 @@ bld.SAMBA3_BINARY('smbconftort', talloc param popt_samba3''', + install=False, vars=locals()) bld.SAMBA3_BINARY('replacetort', @@ -1458,6 +1460,7 @@ bld.SAMBA3_BINARY('msgtest', deps=''' talloc param''', + install=False, vars=locals()) bld.SAMBA3_BINARY('smbcacls', @@ -1503,6 +1506,7 @@ bld.SAMBA3_BINARY('pdbtest', popt_samba3 AUTH_COMMON auth''', + install=False, vars=locals()) bld.SAMBA3_BINARY('vfstest', @@ -1511,11 +1515,13 @@ bld.SAMBA3_BINARY('vfstest', vfs popt_samba3 SMBREADLINE''', + install=False, vars=locals()) bld.SAMBA3_BINARY('log2pcap', source=LOG2PCAP_SRC, deps='''talloc popt''', + install=False, vars=locals()) bld.SAMBA3_BINARY('locktest2', @@ -1525,11 +1531,13 @@ bld.SAMBA3_BINARY('locktest2', param libsmb LOCKING''', + install=False, vars=locals()) bld.SAMBA3_BINARY('debug2html', source=DEBUG2HTML_SRC, deps='''talloc popt''', + install=False, vars=locals()) bld.SAMBA3_BINARY('smbfilter', @@ -1538,6 +1546,7 @@ bld.SAMBA3_BINARY('smbfilter', talloc param LIBNMB''', + install=False, vars=locals()) bld.SAMBA3_BINARY('versiontest', @@ -1545,6 +1554,7 @@ bld.SAMBA3_BINARY('versiontest', deps=''' SAMBA_VERSION param''', + install=False, vars=locals()) bld.SAMBA3_BINARY('ntlm_auth', @@ -1560,6 +1570,7 @@ bld.SAMBA3_BINARY('ntlm_auth', bld.SAMBA3_BINARY('timelimit', source='script/tests/timelimit.c', + install=False, vars=locals()) bld.SAMBA3_BINARY('rpc_open_tcp', @@ -1567,6 +1578,7 @@ bld.SAMBA3_BINARY('rpc_open_tcp', deps=''' talloc msrpc3''', + install=False, vars=locals()) bld.SAMBA3_BINARY('test_lp_load', @@ -1575,6 +1587,7 @@ bld.SAMBA3_BINARY('test_lp_load', talloc param popt_samba3''', + install=False, vars=locals()) bld.SAMBA3_BINARY('dbwrap_tool', @@ -1589,6 +1602,7 @@ bld.SAMBA3_BINARY('dbwrap_torture', deps=''' talloc popt_samba3''', + install=False, vars=locals()) bld.SAMBA3_BINARY('split_tokens', @@ -1596,6 +1610,7 @@ bld.SAMBA3_BINARY('split_tokens', deps=''' talloc popt_samba3''', + install=False, vars=locals()) bld.SAMBA3_BINARY('vlp', @@ -1603,6 +1618,7 @@ bld.SAMBA3_BINARY('vlp', deps=''' talloc param''', + install=False, vars=locals()) bld.SAMBA3_PYTHON('pysmbd', -- 1.8.0