[SCM] Samba Shared Repository - branch master updated - c5a70cab25de3b0acd89ba12150b9077bb59cbb5

Jelmer Vernooij jelmer at samba.org
Sun Nov 2 23:16:11 GMT 2008


The branch, master has been updated
       via  c5a70cab25de3b0acd89ba12150b9077bb59cbb5 (commit)
       via  1575cae7e53a5738d7e2530e855aef68ca971706 (commit)
       via  b45caa44e1a563a3af42e39bd61ee4a2b74db14f (commit)
       via  4147ad1e98f04627f9072784e69c72cd72ea206c (commit)
       via  a9dbd73b2f1400347bf9db7b6da2020fb5c11494 (commit)
       via  1e053df95c478dd5ca5fceab822700af49cc6510 (commit)
       via  3fda6c5c2a4199217a0ee4078125fe3178639009 (commit)
       via  ee7c2170a79f1ca9e2ad1a209d342d8fd287ec8d (commit)
       via  e7810b1bc2c920d828d694817f88ea3ae9e74750 (commit)
       via  15c0aad880dceb6235e6b16e3276f73c85a152fc (commit)
       via  b327c0a2da6e48256fc64ee96bcec5da81843ec6 (commit)
       via  41e44d695872f96be77640c847181742e5a1ec5f (commit)
       via  28d374ec159b9af405a9ef128e8439ac42245a82 (commit)
       via  62c57cb4006ca8678ac5a94cdd1d31af3f9f0a21 (commit)
       via  a1cc27814240bf50bd546dcfc8b80d3838a6a38d (commit)
       via  cb77fca1cd4cb340ca619410195aa6895f848b92 (commit)
       via  e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6 (commit)
       via  ef915eff1690bfded651bf6fcef02a977d3d676b (commit)
       via  8f763308bc191855356cfec758e939270843468d (commit)
       via  29a20af75f150a1774b187ce64199e5f0bcc2361 (commit)
       via  ff36c52d8c7f146eca9c6c678456708a8e2efbab (commit)
      from  7808a2594c22ff452d54d2e9e272aa60e4b7e482 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c5a70cab25de3b0acd89ba12150b9077bb59cbb5
Merge: 1575cae7e53a5738d7e2530e855aef68ca971706 7808a2594c22ff452d54d2e9e272aa60e4b7e482
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Nov 3 00:15:27 2008 +0100

    Merge branch 'master' of ssh://git.samba.org/data/git/samba

commit 1575cae7e53a5738d7e2530e855aef68ca971706
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Nov 3 00:14:26 2008 +0100

    Fix memory leak.

commit b45caa44e1a563a3af42e39bd61ee4a2b74db14f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 23:58:49 2008 +0100

    Fix the build.

commit 4147ad1e98f04627f9072784e69c72cd72ea206c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 19:33:34 2008 +0100

    Remove global_loadparm.

commit a9dbd73b2f1400347bf9db7b6da2020fb5c11494
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 19:32:50 2008 +0100

    Remove last instance of global_loadparm.

commit 1e053df95c478dd5ca5fceab822700af49cc6510
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 19:28:17 2008 +0100

    Remove use of global_loadparm for disabled gensec backends.

commit 3fda6c5c2a4199217a0ee4078125fe3178639009
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 18:28:06 2008 +0100

    Remove global_loadparm stub in Samba 3 as it's no longer used.

commit ee7c2170a79f1ca9e2ad1a209d342d8fd287ec8d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 18:27:24 2008 +0100

    Remove another use of global_loadparm.

commit e7810b1bc2c920d828d694817f88ea3ae9e74750
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 18:14:53 2008 +0100

    Use standard heimdal function for finding interfaces - libreplace provides support for the underlying functions now.

commit 15c0aad880dceb6235e6b16e3276f73c85a152fc
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 18:13:19 2008 +0100

    Remove unused include of param/param.h.

commit b327c0a2da6e48256fc64ee96bcec5da81843ec6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 17:39:41 2008 +0100

    Samba3: Remove more configure tests already done by libreplace.

commit 41e44d695872f96be77640c847181742e5a1ec5f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 17:29:39 2008 +0100

    Remove MIN, MAX, slprintf, vslprintf defines already provided by libreplace.

commit 28d374ec159b9af405a9ef128e8439ac42245a82
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 17:21:46 2008 +0100

    Use environment variable rather than loadparm parameter when testing
    nonblocking sockets.

commit 62c57cb4006ca8678ac5a94cdd1d31af3f9f0a21
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 17:11:20 2008 +0100

    Remove use of global_loadparm when comparing nt status error - use
    global variable instead.

commit a1cc27814240bf50bd546dcfc8b80d3838a6a38d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 17:04:22 2008 +0100

    Remove use of global_loadparm during initialization of gensec.

commit cb77fca1cd4cb340ca619410195aa6895f848b92
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 16:50:11 2008 +0100

    Remove use of global loadparm in python modules.

commit e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 16:48:48 2008 +0100

    Add utility function for getting the default loadparm context from a python module.

commit ef915eff1690bfded651bf6fcef02a977d3d676b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 16:46:32 2008 +0100

    Move check of SMB_CONF_PATH to loadparm code.

commit 8f763308bc191855356cfec758e939270843468d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 16:38:27 2008 +0100

    Add *test4 rules to merged build Makefile, to allow running the Samba 4 tests against Samba 4. (doesn't work yet).

commit 29a20af75f150a1774b187ce64199e5f0bcc2361
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 16:20:00 2008 +0100

    Remove use of global_loadparm for SMB2 client connections.

commit ff36c52d8c7f146eca9c6c678456708a8e2efbab
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 16:07:28 2008 +0100

    Remove another use of global_loadparm.
    
    Eventually, we should move some of these parameters into a separate
    struct (perhaps into smb_transport_options?), to avoid the long lists of
    parameters.

-----------------------------------------------------------------------

Summary of changes:
 lib/replace/replace.h                        |   10 +-
 libcli/nbt/libnbt.h                          |    2 +
 libcli/nbt/nbtsocket.c                       |    3 +-
 libcli/nbt/pynbt.c                           |    3 +-
 libcli/util/ntstatus.h                       |    3 +
 librpc/ndr/ndr.c                             |    4 +-
 pidl/lib/Parse/Pidl/Samba4/Python.pm         |   16 +-
 source3/Makefile.in                          |    3 +-
 source3/configure.in                         |   40 +---
 source3/include/includes.h                   |   25 +--
 source3/librpc/ndr/util.c                    |    2 +-
 source3/samba4.mk                            |   79 +++++++
 source4/auth/gensec/gensec.c                 |   61 +++++-
 source4/auth/gensec/gensec.h                 |    5 +-
 source4/auth/gensec/spnego.c                 |    9 +-
 source4/auth/ntlm/auth_server.c              |    1 +
 source4/client/cifsdd.c                      |   15 +-
 source4/client/cifsdd.h                      |    3 +-
 source4/client/cifsddio.c                    |   18 +-
 source4/client/client.c                      |    9 +-
 source4/heimdal/lib/krb5/get_addrs.c         |  292 ++++++++++++++++++++++++++
 source4/heimdal_build/internal.mk            |    1 +
 source4/heimdal_build/krb5-glue.c            |   33 ---
 source4/ldap_server/ldap_backend.c           |    3 +
 source4/lib/cmdline/popt_common.c            |   12 +-
 source4/lib/cmdline/popt_credentials.c       |    2 +-
 source4/lib/messaging/pymessaging.c          |    9 +-
 source4/lib/registry/rpc.c                   |    2 +-
 source4/lib/socket/socket.c                  |    2 +-
 source4/lib/wmi/wmicore.c                    |    5 +-
 source4/libcli/cliconnect.c                  |    6 +-
 source4/libcli/raw/clitree.c                 |    4 +-
 source4/libcli/raw/libcliraw.h               |    1 +
 source4/libcli/smb2/connect.c                |   14 +-
 source4/libcli/smb_composite/connect.c       |    3 +-
 source4/libcli/smb_composite/fetchfile.c     |    1 +
 source4/libcli/smb_composite/fsinfo.c        |    1 +
 source4/libcli/smb_composite/sesssetup.c     |   10 +-
 source4/libcli/smb_composite/smb_composite.h |    3 +
 source4/libcli/util/errormap.c               |    7 +-
 source4/libnet/py_net.c                      |    5 +-
 source4/librpc/rpc/dcerpc.c                  |    4 +-
 source4/librpc/rpc/dcerpc.h                  |    2 +-
 source4/librpc/rpc/dcerpc_auth.c             |    2 +-
 source4/librpc/rpc/dcerpc_connect.c          |    5 +-
 source4/ntvfs/cifs/vfs_cifs.c                |    1 +
 source4/ntvfs/smb2/vfs_smb2.c                |    3 +-
 source4/ntvfs/sysdep/inotify.c               |    4 -
 source4/ntvfs/sysdep/sys_notify.c            |   11 +
 source4/param/loadparm.c                     |   18 ++-
 source4/param/param.h                        |    2 -
 source4/param/param.i                        |    9 +
 source4/param/param_wrap.c                   |    9 +
 source4/smb_server/smb/sesssetup.c           |    2 +-
 source4/torture/basic/base.c                 |   18 +-
 source4/torture/basic/misc.c                 |    1 +
 source4/torture/gentest.c                    |    6 +-
 source4/torture/locktest.c                   |    3 +-
 source4/torture/locktest2.c                  |   16 +-
 source4/torture/masktest.c                   |    9 +-
 source4/torture/raw/composite.c              |    2 +
 source4/torture/raw/lockbench.c              |    1 +
 source4/torture/raw/openbench.c              |    1 +
 source4/torture/raw/oplock.c                 |    3 +-
 source4/torture/raw/tconrate.c               |    3 +-
 source4/torture/rpc/join.c                   |    6 +-
 source4/torture/rpc/mgmt.c                   |    2 +-
 source4/torture/rpc/rpc.c                    |    4 +-
 source4/torture/rpc/samba3rpc.c              |   18 +-
 source4/torture/smb2/scan.c                  |    6 +-
 source4/torture/smb2/util.c                  |    3 +-
 source4/torture/smbtorture.c                 |    3 +
 source4/torture/unix/unix_info2.c            |    3 +-
 source4/torture/unix/whoami.c                |    3 +-
 source4/torture/util_smb.c                   |    3 +-
 source4/utils/net/net.c                      |    2 +-
 76 files changed, 690 insertions(+), 225 deletions(-)
 create mode 100644 source4/heimdal/lib/krb5/get_addrs.c


Changeset truncated at 500 lines:

diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index c1444cd..c3b0604 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -4,7 +4,7 @@
    macros to go along with the lib/replace/ portability layer code
 
    Copyright (C) Andrew Tridgell 2005
-   Copyright (C) Jelmer Vernooij 2006
+   Copyright (C) Jelmer Vernooij 2006-2008
    Copyright (C) Jeremy Allison 2007.
 
      ** NOTE! The following LGPL license applies to the replace
@@ -215,6 +215,14 @@ int rep_seteuid(uid_t);
 int rep_setegid(gid_t);
 #endif
 
+#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
+/* stupid glibc */
+int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+#endif
+#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESGID_DECL))
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
+#endif
+
 #ifndef HAVE_CHOWN
 #define chown rep_chown
 int rep_chown(const char *path, uid_t uid, gid_t gid);
diff --git a/libcli/nbt/libnbt.h b/libcli/nbt/libnbt.h
index 4ef4e9d..e03352d 100644
--- a/libcli/nbt/libnbt.h
+++ b/libcli/nbt/libnbt.h
@@ -122,6 +122,8 @@ struct nbt_name_socket {
 				struct socket_address *);
 		void *private_data;
 	} unexpected;
+
+	uint32_t wack_timeout;
 };
 
 
diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c
index dbbdc1b..65ed872 100644
--- a/libcli/nbt/nbtsocket.c
+++ b/libcli/nbt/nbtsocket.c
@@ -247,7 +247,7 @@ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock)
 		req->received_wack = true;
 		/* although there can be a timeout in the packet, w2k3 screws it up,
 		   so better to set it ourselves */
-		req->timeout = lp_parm_int(global_loadparm, NULL, "nbt", "wack_timeout", 30);
+		req->timeout = nbtsock->wack_timeout;
 		req->te = event_add_timed(req->nbtsock->event_ctx, req,
 					  timeval_current_ofs(req->timeout, 0),
 					  nbt_name_socket_timeout, req);
@@ -334,6 +334,7 @@ _PUBLIC_ struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx,
 
 	nbtsock->send_queue = NULL;
 	nbtsock->num_pending = 0;
+	nbtsock->wack_timeout = 30;
 	nbtsock->incoming.handler = NULL;
 	nbtsock->unexpected.handler = NULL;
 	nbtsock->iconv_convenience = iconv_convenience;
diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c
index 9179245..6750ad7 100644
--- a/libcli/nbt/pynbt.c
+++ b/libcli/nbt/pynbt.c
@@ -48,7 +48,8 @@ static PyObject *py_nbt_node_init(PyTypeObject *self, PyObject *args, PyObject *
 		return NULL;
 
 	ev = s4_event_context_init(ret->mem_ctx);
-	ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, py_iconv_convenience(ret->mem_ctx));
+	ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, 
+									   py_iconv_convenience(ret->mem_ctx));
 	return (PyObject *)ret;
 }
 
diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h
index bf03d51..fa4553d 100644
--- a/libcli/util/ntstatus.h
+++ b/libcli/util/ntstatus.h
@@ -628,6 +628,9 @@ const char *get_nt_error_c_code(NTSTATUS nt_code);
  *****************************************************************************/
 NTSTATUS nt_status_string_to_code(const char *nt_status_str);
 
+/** Used by ntstatus_dos_equal: */
+extern bool ntstatus_check_dos_mapping;
+
 #define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0)
 #define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000)
 /* checking for DOS error mapping here is ugly, but unfortunately the
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c
index 2f1daea..12f95a9 100644
--- a/librpc/ndr/ndr.c
+++ b/librpc/ndr/ndr.c
@@ -933,7 +933,7 @@ _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t pu
 	/* avoid recursion */
 	if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
 
-	ndr = ndr_push_init_ctx(NULL, lp_iconv_convenience(global_loadparm));
+	ndr = ndr_push_init_ctx(NULL, global_iconv_convenience);
 	if (!ndr) return 0;
 	ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
 	status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
@@ -958,7 +958,7 @@ _PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_pus
 	/* avoid recursion */
 	if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
 
-	ndr = ndr_push_init_ctx(NULL, lp_iconv_convenience(global_loadparm));
+	ndr = ndr_push_init_ctx(NULL, global_iconv_convenience);
 	if (!ndr) return 0;
 	ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
 
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 58e6910..38aee2c 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -698,6 +698,14 @@ sub Interface($$$)
 		$self->pidl("}");
 		$self->pidl("");
 
+		$self->pidl("status = dcerpc_init(lp_ctx);");
+		$self->pidl("if (!NT_STATUS_IS_OK(status)) {");
+		$self->indent;
+		$self->pidl("PyErr_SetNTSTATUS(status);");
+		$self->pidl("return;");
+		$self->deindent;
+		$self->pidl("}");
+
 		$self->pidl("credentials = cli_credentials_from_py_object(py_credentials);");
 		$self->pidl("if (credentials == NULL) {");
 		$self->indent;
@@ -1210,14 +1218,6 @@ sub Parse($$$$$)
 	}
 
 	$self->pidl("");
-	$self->pidl("status = dcerpc_init();");
-	$self->pidl("if (!NT_STATUS_IS_OK(status)) {");
-	$self->indent;
-	$self->pidl("PyErr_SetNTSTATUS(status);");
-	$self->pidl("return;");
-	$self->deindent;
-	$self->pidl("}");
-
 	$self->deindent;
 	$self->pidl("}");
     return ($self->{res_hdr}, $self->{res});
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 94146eb..ce24001 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -2847,9 +2847,10 @@ valgrindtest:: all torture timelimit
 	 PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix} all "${smbtorture4_path}"
 
 SELFTEST_FORMAT = plain
+selftestdir = ../selftest
 
 selftest:: all torture timelimit
-	@../selftest/selftest.pl --prefix=st --target=samba3 \
+	@$(selftestdir)/selftest.pl --prefix=st --target=samba3 \
 		--testlist="$(srcdir)/selftest/tests.sh|" \
 		--expected-failures=$(srcdir)/selftest/knownfail \
 		--exclude=$(srcdir)/selftest/skip \
diff --git a/source3/configure.in b/source3/configure.in
index c2a5d1a..0aeefe4 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -857,19 +857,6 @@ if test x"$ac_cv_func_dirfd" = x"yes"; then
 	default_shared_modules="$default_shared_modules vfs_syncops"
 fi
 
-AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
-    AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <signal.h>],[sig_atomic_t i = 0],
-	samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
-if test x"$samba_cv_sig_atomic_t" = x"yes"; then
-   AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
-fi
-
 AC_CACHE_CHECK([for struct sigevent type],samba_cv_struct_sigevent, [
     AC_TRY_COMPILE([
 #include <sys/types.h>
@@ -908,11 +895,6 @@ if test x"$samba_cv_struct_timespec" = x"yes"; then
    AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
 fi
 
-# stupid headers have the functions but no declaration. grrrr.
-AC_HAVE_DECL(errno, [#include <errno.h>])
-AC_HAVE_DECL(setresuid, [#include <unistd.h>])
-AC_HAVE_DECL(setresgid, [#include <unistd.h>])
-
 # and glibc has setresuid under linux but the function does
 # nothing until kernel 2.1.44! very dumb.
 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
@@ -1025,20 +1007,20 @@ if test x"$ac_cv_func_execl" = x"no"; then
     EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
 fi
 
-AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror fchown chmod fchmod mknod mknod64)
-AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull)
+AC_CHECK_FUNCS(getcwd fchown chmod fchmod mknod mknod64)
+AC_CHECK_FUNCS(strtol)
 AC_CHECK_FUNCS(fstat strchr chflags)
-AC_CHECK_FUNCS(getrlimit fsync fdatasync memset strlcpy strlcat setpgid)
-AC_CHECK_FUNCS(memmove setsid glob strpbrk pipe crypt16 getauthuid)
-AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
+AC_CHECK_FUNCS(getrlimit fsync fdatasync setpgid)
+AC_CHECK_FUNCS(setsid glob strpbrk crypt16 getauthuid)
+AC_CHECK_FUNCS(sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
-AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate chsize stat64 fstat64)
-AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64)
-AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
+AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
+AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64)
+AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
 AC_CHECK_FUNCS(getpwent_r)
-AC_CHECK_FUNCS(getdents getdents64)
-AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl)
+AC_CHECK_FUNCS(getdents64)
+AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
 AC_CHECK_FUNCS(syslog vsyslog timegm)
 AC_CHECK_FUNCS(setlocale nl_langinfo)
 AC_CHECK_FUNCS(nanosleep)
@@ -1046,7 +1028,7 @@ AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
 AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
 AC_CHECK_HEADERS(sys/mman.h)
 # setbuffer, shmget, shm_open are needed for smbtorture
-AC_CHECK_FUNCS(setbuffer shmget shm_open)
+AC_CHECK_FUNCS(shmget shm_open)
 
 # Find a method of generating a stack trace
 AC_CHECK_HEADERS(execinfo.h libexc.h libunwind.h)
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 73600e3..4399c73 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -524,14 +524,6 @@ struct timespec {
 };
 #endif
 
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
-#ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
 #ifdef HAVE_BROKEN_GETGROUPS
 #define GID_T int
 #else
@@ -567,7 +559,7 @@ typedef char fstring[FSTRING_LEN];
 #endif
 
 /* Samba 3 doesn't use iconv_convenience: */
-extern void *global_loadparm;
+extern void *global_iconv_convenience;
 extern void *cmdline_lp_ctx;
 struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 
@@ -719,7 +711,7 @@ enum flush_reason_enum {
 #include "modules/nfs4_acls.h"
 #include "nsswitch/libwbclient/wbclient.h"
 
-/***** automatically generated prototypes *****/
+/***** prototypes *****/
 #ifndef NO_PROTO_H
 #include "proto.h"
 #endif
@@ -812,14 +804,6 @@ enum flush_reason_enum {
 #define ULTRIX_AUTH 1
 #endif
 
-#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
-/* stupid glibc */
-int setresuid(uid_t ruid, uid_t euid, uid_t suid);
-#endif
-#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESGID_DECL))
-int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
-#endif
-
 /* yuck, I'd like a better way of doing this */
 #define DIRP_SIZE (256 + 32)
 
@@ -892,11 +876,6 @@ int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(
 int asprintf_strupper_m(char **strp, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 
-/* we used to use these fns, but now we have good replacements
-   for snprintf and vsnprintf */
-#define slprintf snprintf
-#define vslprintf vsnprintf
-
 /*
  * Veritas File System.  Often in addition to native.
  * Quotas different.
diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c
index 457615c..b822183 100644
--- a/source3/librpc/ndr/util.c
+++ b/source3/librpc/ndr/util.c
@@ -166,7 +166,7 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name
 	ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
 }
 
-void *global_loadparm;
+void *global_iconv_convenience;
 void *cmdline_lp_ctx;
 struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx)
 {
diff --git a/source3/samba4.mk b/source3/samba4.mk
index c3b6af1..1743431 100644
--- a/source3/samba4.mk
+++ b/source3/samba4.mk
@@ -164,3 +164,82 @@ pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
 all:: bin/samba4 bin/regpatch4 bin/regdiff4 bin/regshell4 bin/regtree4 bin/smbclient4
 torture:: bin/smbtorture4
 everything:: $(patsubst %,%4,$(BINARIES))
+
+SELFTEST4 = $(LD_LIBPATH_OVERRIDE) $(PERL) $(selftestdir)/selftest.pl --prefix=st4 \
+    --builddir=$(builddir) --srcdir=$(samba4srcdir) \
+    --expected-failures=$(samba4srcdir)/selftest/knownfail \
+	--format=$(SELFTEST_FORMAT) \
+    --exclude=$(samba4srcdir)/selftest/skip --testlist="$(samba4srcdir)/selftest/tests.sh|" \
+    $(TEST4_OPTIONS) 
+
+SELFTEST4_NOSLOW_OPTS = --exclude=$(samba4srcdir)/selftest/slow
+SELFTEST4_QUICK_OPTS = $(SELFTEST4_NOSLOW_OPTS) --quick --include=$(samba4srcdir)/selftest/quick
+
+slowtest4:: everything
+	$(SELFTEST4) $(DEFAULT_TEST_OPTIONS) --immediate $(TESTS)
+
+test4:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --immediate \
+		$(TESTS)
+
+testone4:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --one $(TESTS)
+
+test4-swrap:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --immediate $(TESTS)
+
+test4-swrap-pcap:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper-pcap --immediate $(TESTS)
+
+test4-swrap-keep-pcap:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper-keep-pcap --immediate $(TESTS)
+
+test4-noswrap:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate $(TESTS)
+
+quicktest4:: all
+	$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --socket-wrapper --immediate $(TESTS)
+
+quicktestone4:: all
+	$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --socket-wrapper --one $(TESTS)
+
+testenv4:: everything
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
+
+testenv4-%:: everything
+	SELFTEST_TESTENV=$* $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
+
+test4-%:: 
+	$(MAKE) test TESTS=$*
+
+valgrindtest4:: valgrindtest-all
+
+valgrindtest4-quick:: all
+	SMBD_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
+	VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+	$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
+
+valgrindtest4-all:: everything
+	SMBD_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
+	VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
+
+valgrindtest4-env:: everything
+	SMBD_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
+	VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
+
+gdbtest4:: gdbtest4-all
+
+gdbtest4-quick:: all
+	SMBD_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
+	$(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
+
+gdbtest4-all:: everything
+	SMBD_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
+
+gdbtest4-env:: everything
+	SMBD_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
+	$(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
+
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index 20c88f8..7a8da71 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -40,6 +40,12 @@ _PUBLIC_ struct gensec_security_ops **gensec_security_all(void)
 	return generic_security_ops;
 }
 
+bool gensec_security_ops_enabled(struct gensec_security_ops *ops, 
+				 struct loadparm_context *lp_ctx)
+{
+	return lp_parm_bool(lp_ctx, NULL, "gensec", ops->name, ops->enabled);
+}
+
 /* Sometimes we want to force only kerberos, sometimes we want to
  * force it's avoidance.  The old list could be either
  * gensec_security_all(), or from cli_credentials_gensec_list() (ie,
@@ -76,6 +82,7 @@ _PUBLIC_ struct gensec_security_ops **gensec_use_kerberos_mechs(TALLOC_CTX *mem_
 	j = 0;
 	for (i=0; old_gensec_list && old_gensec_list[i]; i++) {
 		int oid_idx;
+
 		for (oid_idx = 0; old_gensec_list[i]->oid && old_gensec_list[i]->oid[oid_idx]; oid_idx++) {
 			if (strcmp(old_gensec_list[i]->oid[oid_idx], GENSEC_OID_SPNEGO) == 0) {
 				new_gensec_list[j] = old_gensec_list[i];
@@ -140,6 +147,9 @@ static const struct gensec_security_ops *gensec_security_by_authtype(struct gens
 	}
 	backends = gensec_security_mechs(gensec_security, mem_ctx);
 	for (i=0; backends && backends[i]; i++) {
+	    	if (!gensec_security_ops_enabled(backends[i], 
+											 gensec_security->settings->lp_ctx))
+		    continue;
 		if (backends[i]->auth_type == auth_type) {
 			backend = backends[i];
 			talloc_free(mem_ctx);
@@ -163,6 +173,10 @@ const struct gensec_security_ops *gensec_security_by_oid(struct gensec_security
 	}
 	backends = gensec_security_mechs(gensec_security, mem_ctx);
 	for (i=0; backends && backends[i]; i++) {
+	    	if (gensec_security != NULL && 
+				!gensec_security_ops_enabled(backends[i], 
+											 gensec_security->settings->lp_ctx))
+		    continue;
 		if (backends[i]->oid) {
 			for (j=0; backends[i]->oid[j]; j++) { 
 				if (backends[i]->oid[j] &&
@@ -191,6 +205,8 @@ const struct gensec_security_ops *gensec_security_by_sasl_name(struct gensec_sec
 	}
 	backends = gensec_security_mechs(gensec_security, mem_ctx);
 	for (i=0; backends && backends[i]; i++) {
+	    	if (!gensec_security_ops_enabled(backends[i], gensec_security->settings->lp_ctx))
+		    continue;
 		if (backends[i]->sasl_name 
 		    && (strcmp(backends[i]->sasl_name, sasl_name) == 0)) {
 			backend = backends[i];
@@ -215,6 +231,9 @@ static const struct gensec_security_ops *gensec_security_by_name(struct gensec_s
 	}
 	backends = gensec_security_mechs(gensec_security, mem_ctx);
 	for (i=0; backends && backends[i]; i++) {
+	    	if (gensec_security != NULL && 
+				!gensec_security_ops_enabled(backends[i], gensec_security->settings->lp_ctx))
+		    continue;
 		if (backends[i]->name 
 		    && (strcmp(backends[i]->name, name) == 0)) {
 			backend = backends[i];
@@ -258,6 +277,9 @@ const struct gensec_security_ops **gensec_security_by_sasl_list(struct gensec_se
 	/* Find backends in our preferred order, by walking our list,
 	 * then looking in the supplied list */
 	for (i=0; backends && backends[i]; i++) {
+	    	if (gensec_security != NULL &&
+				!gensec_security_ops_enabled(backends[i], gensec_security->settings->lp_ctx))
+		    continue;
 		for (sasl_idx = 0; sasl_names[sasl_idx]; sasl_idx++) {
 			if (!backends[i]->sasl_name ||
 			    !(strcmp(backends[i]->sasl_name, 
@@ -326,6 +348,9 @@ const struct gensec_security_ops_wrapper *gensec_security_by_oid_list(struct gen
 	/* Find backends in our preferred order, by walking our list,
 	 * then looking in the supplied list */
 	for (i=0; backends && backends[i]; i++) {
+	    	if (gensec_security != NULL && 
+				!gensec_security_ops_enabled(backends[i], gensec_security->settings->lp_ctx))
+		    continue;
 		if (!backends[i]->oid) {
 			continue;
 		}
@@ -374,7 +399,8 @@ const struct gensec_security_ops_wrapper *gensec_security_by_oid_list(struct gen
  * Return OIDS from the security subsystems listed
  */
 
-const char **gensec_security_oids_from_ops(TALLOC_CTX *mem_ctx, 
+const char **gensec_security_oids_from_ops(struct gensec_security *gensec_security,
+										   TALLOC_CTX *mem_ctx, 
 					   struct gensec_security_ops **ops,				   
 					   const char *skip) 
 {
@@ -391,6 +417,10 @@ const char **gensec_security_oids_from_ops(TALLOC_CTX *mem_ctx,
 	}
 	


-- 
Samba Shared Repository


More information about the samba-cvs mailing list