[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-2-36-g4daf89d

Karolin Seeger kseeger at samba.org
Wed Aug 27 08:38:59 GMT 2008


The branch, v3-2-stable has been updated
       via  4daf89d1fd5388a1bdd2c41cd69c6f04675eaa0d (commit)
       via  42f7808a92c3b73ffc7f967e9157a970c2316e9b (commit)
       via  0682464774e2bdc838e08bdf77b22e6df16980bc (commit)
       via  6ee615d191c6ffa97bb27c52ae3cdb2e87a15a9a (commit)
       via  51828872b5b90cdbb800db0462a0d75b68e104a4 (commit)
       via  41b0106bf0633d1b68aee3e22056aef0aa855c4a (commit)
       via  7ba0050ab29a67db5823e792a2811394f38d5487 (commit)
       via  d211b19e12f0a6b124f4921fe12ca707c7a5e709 (commit)
       via  b2c551c1e6465a18cba9ab5ffc2ed4facb9b2458 (commit)
       via  ad6b5ae2b315238647a0e968cddbd1fa83c2eef4 (commit)
       via  1a6d3ceab272f556398fd1759d45d7efbac005c4 (commit)
       via  2382ef310073e9c9a3a15bff987d7baf8f158ff4 (commit)
       via  ad7687ff02465e5ca5e0f8c1f49d572eaea1b31a (commit)
       via  5d0b8788dcecbe1565b3ef0200386308c63588db (commit)
       via  a76f0528ebae537166177409279c0f438c059b40 (commit)
       via  17695ffca57c93b828719310c26b0a41b609b101 (commit)
       via  52428c8ba8f4f73e648696cae3136884e94575d7 (commit)
      from  a90648e905aebc98c78897adf76729bea269cedf (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit 4daf89d1fd5388a1bdd2c41cd69c6f04675eaa0d
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:38:42 2008 +0200

    Revert "build: fix linking cifs.upcall when nscd_flush_cache() is found."
    
    This reverts commit a7058ed1ef2622abdb75fe997ce4a5c570898929.

commit 42f7808a92c3b73ffc7f967e9157a970c2316e9b
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:38:35 2008 +0200

    Revert "Fix bug 5697 nmbd spins in reload_interfaces when only loopback has an IPv4 address"
    
    This reverts commit 435c10268bb6987ab7e8206cd6c45bd9961c5632.

commit 0682464774e2bdc838e08bdf77b22e6df16980bc
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:38:25 2008 +0200

    Revert "cifs.upcall: handle MSKRB5 OID properly"
    
    This reverts commit 64ebfe4b2e5b7e3e07a0af424b35000693148e48.

commit 6ee615d191c6ffa97bb27c52ae3cdb2e87a15a9a
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:38:18 2008 +0200

    Revert "smbd: fix the handling of create_options to pass RAW-OPEN"
    
    This reverts commit ebd1f8f9297b31353d094ddccc320a83f02877ce.

commit 51828872b5b90cdbb800db0462a0d75b68e104a4
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:38:08 2008 +0200

    Revert "nss_winbind: When returning NSS_UNAVAIL, squash errno to ENOENT"
    
    This reverts commit 15e8e23466ae959bd0efc540c287338dbcd0b7a6.

commit 41b0106bf0633d1b68aee3e22056aef0aa855c4a
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:38:00 2008 +0200

    Revert "fix another build warning."
    
    This reverts commit e3ff1cb7709d93fb91602d3d25deca3f4ecce2ce.

commit 7ba0050ab29a67db5823e792a2811394f38d5487
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:37:49 2008 +0200

    Revert "fix build warning."
    
    This reverts commit c48f247d76569bfdc844499cc64f504bce7085cd.

commit d211b19e12f0a6b124f4921fe12ca707c7a5e709
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:37:41 2008 +0200

    Revert "build: rename LIBNETAPI_OBJ1 to LIBNETAPI_OBJ0 for consistency."
    
    This reverts commit eb892f90c9be0ebc2217fc459d4249190986c003.

commit b2c551c1e6465a18cba9ab5ffc2ed4facb9b2458
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:37:30 2008 +0200

    Revert "build: fall down to the same place when using an internal lib statically."
    
    This reverts commit 8145b0a7d7bacb818b8dadadae65ecd0877b5ce2.

commit ad6b5ae2b315238647a0e968cddbd1fa83c2eef4
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:37:22 2008 +0200

    Revert "build: fix bug #5590 by not linking in the static libs but the objects."
    
    This reverts commit ef801d12a309c4c9f6429739b835fb32f5c309b8.

commit 1a6d3ceab272f556398fd1759d45d7efbac005c4
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:36:58 2008 +0200

    Revert "Fix bug 5698 - mixup of TALLOC/malloc. Spotted by Douglas Wegscheid <Douglas_E_Wegscheid at whirlpool.com>."
    
    This reverts commit 3c205320cd1eb19ed275572f975487e92c611f13.

commit 2382ef310073e9c9a3a15bff987d7baf8f158ff4
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:36:51 2008 +0200

    Revert "IDL: fix IDL for netr_ServerPasswordSet2()."
    
    This reverts commit 7a53e1e83a070394f77da4a0f7b2ed480165c376.

commit ad7687ff02465e5ca5e0f8c1f49d572eaea1b31a
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:36:31 2008 +0200

    Revert "re-run make idl."
    
    This reverts commit 94dd61a4e8e070e175339defce4da08eaf87429d.

commit 5d0b8788dcecbe1565b3ef0200386308c63588db
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:36:20 2008 +0200

    Revert "Fix Bug #5710 and make machine account password changing work again."
    
    This reverts commit 6d42b1e372b67eba83dbd5200bfb131b74cac180.

commit a76f0528ebae537166177409279c0f438c059b40
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:36:10 2008 +0200

    Revert "cifs.upcall: fix build warning"
    
    This reverts commit b3a8b823361d6144f14c2d800e956f26ff9ad6d6.

commit 17695ffca57c93b828719310c26b0a41b609b101
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:36:00 2008 +0200

    Revert "winbindd: Fix crash in cm_connect_sam()"
    
    This reverts commit 9bbd6ee5db03747499bd263bb1365c8cd352076d.

commit 52428c8ba8f4f73e648696cae3136884e94575d7
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Aug 27 10:35:51 2008 +0200

    Revert "Don't re-initialize a token when we already have one. This fixes the build farm failures when winbindd connects as guest."
    
    This reverts commit a90648e905aebc98c78897adf76729bea269cedf.

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

Summary of changes:
 source/Makefile.in                   |   10 ++--
 source/client/cifs.upcall.c          |   17 ++------
 source/include/smb.h                 |   15 ++-----
 source/lib/interface.c               |    7 +--
 source/lib/util_str.c                |    5 +-
 source/librpc/gen_ndr/cli_netlogon.c |    6 +-
 source/librpc/gen_ndr/cli_netlogon.h |    6 +-
 source/librpc/gen_ndr/ndr_netlogon.c |   38 +++--------------
 source/librpc/gen_ndr/netlogon.h     |    4 +-
 source/librpc/idl/netlogon.idl       |    6 +-
 source/libsmb/trusts_util.c          |   75 ++++++++++-----------------------
 source/m4/aclocal.m4                 |    4 +-
 source/nmbd/nmbd.c                   |    4 +-
 source/nmbd/nmbd_processlogon.c      |    2 +-
 source/nmbd/nmbd_subnetdb.c          |   11 ++---
 source/nsswitch/wb_common.c          |   20 +--------
 source/rpc_client/cli_pipe.c         |    4 +-
 source/smbd/nttrans.c                |   12 -----
 source/smbd/open.c                   |    5 --
 source/smbd/sesssetup.c              |   23 +++++------
 source/winbindd/winbindd_cm.c        |   12 +-----
 21 files changed, 83 insertions(+), 203 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 2a8bec0..57d5114 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -1324,7 +1324,7 @@ bin/cifs.upcall at EXEEXT@: $(BINARY_PREREQS) $(CIFS_UPCALL_OBJ) $(LIBSMBCLIENT_OBJ
 	@$(CC) $(FLAGS) -o $@ $(CIFS_UPCALL_OBJ) $(DYNEXP) $(LDFLAGS) \
 		-lkeyutils $(LIBS) $(LIBSMBCLIENT_OBJ1) $(KRB5LIBS) \
 		$(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(WINBIND_LIBS) \
-		$(LIBTDB_LIBS) $(NSCD_LIBS)
+		$(LIBTDB_LIBS)
 
 bin/testparm at EXEEXT@: $(BINARY_PREREQS) $(TESTPARM_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
 	@echo Linking $@
@@ -1798,7 +1798,7 @@ shlibs test_shlibs: @LIBADDNS_SHARED@
 #
 #-------------------------------------------------------------------
 
-LIBNETAPI_OBJ0 = lib/netapi/netapi.o \
+LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
 		 lib/netapi/cm.o \
 		 librpc/gen_ndr/ndr_libnetapi.o \
 		 lib/netapi/libnetapi.o \
@@ -1807,7 +1807,7 @@ LIBNETAPI_OBJ0 = lib/netapi/netapi.o \
 		 lib/netapi/getdc.o \
 		 lib/netapi/user.o
 
-LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ0) $(LIBNET_OBJ) \
+LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
 		 $(LIBSMBCONF_OBJ) \
 		 $(REG_SMBCONF_OBJ) \
 		 $(PARAM_WITHOUT_REG_OBJ) $(LIB_NONSMBD_OBJ) \
@@ -1838,9 +1838,9 @@ $(LIBNETAPI_SHARED_TARGET): $(LIBNETAPI_SHARED_TARGET_SONAME)
 	@rm -f $@
 	@ln -s -f `basename $(LIBNETAPI_SHARED_TARGET_SONAME)` $@
 
-$(LIBNETAPI_STATIC_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ0)
+$(LIBNETAPI_STATIC_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ1)
 	@echo Linking non-shared library $@
-	@-$(AR) -rc $@ $(LIBNETAPI_OBJ0)
+	@-$(AR) -rc $@ $(LIBNETAPI_OBJ1)
 
 libnetapi: $(LIBNETAPI)
 
diff --git a/source/client/cifs.upcall.c b/source/client/cifs.upcall.c
index cf5f1c3..aa5eb57 100644
--- a/source/client/cifs.upcall.c
+++ b/source/client/cifs.upcall.c
@@ -29,7 +29,7 @@ create dns_resolver * * /usr/local/sbin/cifs.upcall %k
 
 #include "cifs_spnego.h"
 
-const char *CIFSSPNEGO_VERSION = "1.2";
+const char *CIFSSPNEGO_VERSION = "1.1";
 static const char *prog = "cifs.upcall";
 typedef enum _secType {
 	KRB5,
@@ -73,7 +73,7 @@ int handle_krb5_mech(const char *oid, const char *principal,
 	tkt_wrapped = spnego_gen_krb5_wrap(tkt, TOK_ID_KRB_AP_REQ);
 
 	/* and wrap that in a shiny SPNEGO wrapper */
-	*secblob = gen_negTokenInit(oid, tkt_wrapped);
+	*secblob = gen_negTokenInit(OID_KERBEROS5, tkt_wrapped);
 
 	data_blob_free(&tkt_wrapped);
 	data_blob_free(&tkt);
@@ -118,9 +118,6 @@ int decode_key_description(const char *desc, int *ver, secType_t * sec,
 			if (strncmp(tkn + 4, "krb5", 4) == 0) {
 				retval |= DKD_HAVE_SEC;
 				*sec = KRB5;
-			} else if (strncmp(tkn + 4, "mskrb5", 6) == 0) {
-				retval |= DKD_HAVE_SEC;
-				*sec = MS_KRB5;
 			}
 		} else if (strncmp(tkn, "uid=", 4) == 0) {
 			errno = 0;
@@ -223,7 +220,6 @@ int main(const int argc, char *const argv[])
 	int kernel_upcall_version;
 	int c, use_cifs_service_prefix = 0;
 	char *buf, *hostname = NULL;
-	const char *oid;
 
 	openlog(prog, 0, LOG_DAEMON);
 
@@ -305,7 +301,6 @@ int main(const int argc, char *const argv[])
 
 	// do mech specific authorization
 	switch (sectype) {
-	case MS_KRB5:
 	case KRB5:{
 			char *princ;
 			size_t len;
@@ -324,12 +319,8 @@ int main(const int argc, char *const argv[])
 			}
 			strlcpy(princ + 5, hostname, len - 5);
 
-			if (sectype == MS_KRB5)
-				oid = OID_KERBEROS5_OLD;
-			else
-				oid = OID_KERBEROS5;
-
-			rc = handle_krb5_mech(oid, princ, &secblob, &sess_key);
+			rc = handle_krb5_mech(OID_KERBEROS5, princ,
+					      &secblob, &sess_key);
 			SAFE_FREE(princ);
 			break;
 		}
diff --git a/source/include/smb.h b/source/include/smb.h
index 3c7058f..cef6819 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -1377,19 +1377,12 @@ struct bitmap {
 #define FILE_DELETE_ON_CLOSE      0x1000
 #define FILE_OPEN_BY_FILE_ID	  0x2000
 
-#define NTCREATEX_OPTIONS_MUST_IGNORE_MASK      (0x008F0480)
-
-#define NTCREATEX_OPTIONS_INVALID_PARAM_MASK    (0xFF100030)
-
-/*
- * Private create options used by the ntcreatex processing code. From Samba4.
- * We reuse some ignored flags for private use.
- */
-#define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS     0x00010000
-#define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB     0x00020000
+/* Private create options used by the ntcreatex processing code. From Samba4. */
+#define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS     0x01000000
+#define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB     0x02000000
 
 /* Private options for streams support */
-#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x00040000
+#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x04000000
 
 /* Responses when opening a file. */
 #define FILE_WAS_SUPERSEDED 0
diff --git a/source/lib/interface.c b/source/lib/interface.c
index 2e7c270..eb0af9e 100644
--- a/source/lib/interface.c
+++ b/source/lib/interface.c
@@ -131,18 +131,15 @@ int iface_count(void)
 }
 
 /****************************************************************************
- How many non-loopback IPv4 interfaces do we have ?
+ How many interfaces do we have (v4 only) ?
 **************************************************************************/
 
-int iface_count_v4_nl(void)
+int iface_count_v4(void)
 {
 	int ret = 0;
 	struct interface *i;
 
 	for (i=local_interfaces;i;i=i->next) {
-		if (is_loopback_addr(&i->ip)) {
-			continue;
-		}
 		if (i->ip.ss_family == AF_INET) {
 			ret++;
 		}
diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index a2458c8..c36d512 100644
--- a/source/lib/util_str.c
+++ b/source/lib/util_str.c
@@ -2006,7 +2006,6 @@ bool str_list_sub_basic( char **list, const char *smb_name,
 
 bool str_list_substitute(char **list, const char *pattern, const char *insert)
 {
-	TALLOC_CTX *ctx = list;
 	char *p, *s, *t;
 	ssize_t ls, lp, li, ld, i, d;
 
@@ -2029,7 +2028,7 @@ bool str_list_substitute(char **list, const char *pattern, const char *insert)
 			t = *list;
 			d = p -t;
 			if (ld) {
-				t = TALLOC_ARRAY(ctx, char, ls +ld +1);
+				t = (char *) SMB_MALLOC(ls +ld +1);
 				if (!t) {
 					DEBUG(0,("str_list_substitute: "
 						"Unable to allocate memory"));
@@ -2037,7 +2036,7 @@ bool str_list_substitute(char **list, const char *pattern, const char *insert)
 				}
 				memcpy(t, *list, d);
 				memcpy(t +d +li, p +lp, ls -d -lp +1);
-				TALLOC_FREE(*list);
+				SAFE_FREE(*list);
 				*list = t;
 				ls += ld;
 				s = t +d +li;
diff --git a/source/librpc/gen_ndr/cli_netlogon.c b/source/librpc/gen_ndr/cli_netlogon.c
index f5b4715..61f4103 100644
--- a/source/librpc/gen_ndr/cli_netlogon.c
+++ b/source/librpc/gen_ndr/cli_netlogon.c
@@ -1534,9 +1534,9 @@ NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
 					const char *account_name /* [in] [charset(UTF16)] */,
 					enum netr_SchannelType secure_channel_type /* [in]  */,
 					const char *computer_name /* [in] [charset(UTF16)] */,
-					struct netr_Authenticator *credential /* [in] [ref] */,
-					struct netr_Authenticator *return_authenticator /* [out] [ref] */,
-					struct netr_CryptPassword *new_password /* [in] [ref] */)
+					struct netr_Authenticator credential /* [in]  */,
+					struct netr_CryptPassword new_password /* [in]  */,
+					struct netr_Authenticator *return_authenticator /* [out] [ref] */)
 {
 	struct netr_ServerPasswordSet2 r;
 	NTSTATUS status;
diff --git a/source/librpc/gen_ndr/cli_netlogon.h b/source/librpc/gen_ndr/cli_netlogon.h
index 2033315..2968732 100644
--- a/source/librpc/gen_ndr/cli_netlogon.h
+++ b/source/librpc/gen_ndr/cli_netlogon.h
@@ -239,9 +239,9 @@ NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
 					const char *account_name /* [in] [charset(UTF16)] */,
 					enum netr_SchannelType secure_channel_type /* [in]  */,
 					const char *computer_name /* [in] [charset(UTF16)] */,
-					struct netr_Authenticator *credential /* [in] [ref] */,
-					struct netr_Authenticator *return_authenticator /* [out] [ref] */,
-					struct netr_CryptPassword *new_password /* [in] [ref] */);
+					struct netr_Authenticator credential /* [in]  */,
+					struct netr_CryptPassword new_password /* [in]  */,
+					struct netr_Authenticator *return_authenticator /* [out] [ref] */);
 NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli,
 				       TALLOC_CTX *mem_ctx,
 				       const char *server_name /* [in] [unique,charset(UTF16)] */,
diff --git a/source/librpc/gen_ndr/ndr_netlogon.c b/source/librpc/gen_ndr/ndr_netlogon.c
index eff816c..ce61f8d 100644
--- a/source/librpc/gen_ndr/ndr_netlogon.c
+++ b/source/librpc/gen_ndr/ndr_netlogon.c
@@ -12310,14 +12310,8 @@ static enum ndr_err_code ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr,
 		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
 		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
 		NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
-		if (r->in.credential == NULL) {
-			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-		}
-		NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
-		if (r->in.new_password == NULL) {
-			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-		}
-		NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password));
+		NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
+		NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, &r->in.new_password));
 	}
 	if (flags & NDR_OUT) {
 		if (r->out.return_authenticator == NULL) {
@@ -12333,9 +12327,7 @@ static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr,
 {
 	uint32_t _ptr_server_name;
 	TALLOC_CTX *_mem_save_server_name_0;
-	TALLOC_CTX *_mem_save_credential_0;
 	TALLOC_CTX *_mem_save_return_authenticator_0;
-	TALLOC_CTX *_mem_save_new_password_0;
 	if (flags & NDR_IN) {
 		ZERO_STRUCT(r->out);
 
@@ -12372,20 +12364,8 @@ static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr,
 		}
 		NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
 		NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
-		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-			NDR_PULL_ALLOC(ndr, r->in.credential);
-		}
-		_mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
-		NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
-		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
-		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-			NDR_PULL_ALLOC(ndr, r->in.new_password);
-		}
-		_mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
-		NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password));
-		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC);
+		NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential));
+		NDR_CHECK(ndr_pull_netr_CryptPassword(ndr, NDR_SCALARS, &r->in.new_password));
 		NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
 		ZERO_STRUCTP(r->out.return_authenticator);
 	}
@@ -12421,14 +12401,8 @@ _PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const cha
 		ndr_print_string(ndr, "account_name", r->in.account_name);
 		ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
 		ndr_print_string(ndr, "computer_name", r->in.computer_name);
-		ndr_print_ptr(ndr, "credential", r->in.credential);
-		ndr->depth++;
-		ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
-		ndr->depth--;
-		ndr_print_ptr(ndr, "new_password", r->in.new_password);
-		ndr->depth++;
-		ndr_print_netr_CryptPassword(ndr, "new_password", r->in.new_password);
-		ndr->depth--;
+		ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential);
+		ndr_print_netr_CryptPassword(ndr, "new_password", &r->in.new_password);
 		ndr->depth--;
 	}
 	if (flags & NDR_OUT) {
diff --git a/source/librpc/gen_ndr/netlogon.h b/source/librpc/gen_ndr/netlogon.h
index 1cea1f0..9e86051 100644
--- a/source/librpc/gen_ndr/netlogon.h
+++ b/source/librpc/gen_ndr/netlogon.h
@@ -1355,8 +1355,8 @@ struct netr_ServerPasswordSet2 {
 		const char *account_name;/* [charset(UTF16)] */
 		enum netr_SchannelType secure_channel_type;
 		const char *computer_name;/* [charset(UTF16)] */
-		struct netr_Authenticator *credential;/* [ref] */
-		struct netr_CryptPassword *new_password;/* [ref] */
+		struct netr_Authenticator credential;
+		struct netr_CryptPassword new_password;
 	} in;
 
 	struct {
diff --git a/source/librpc/idl/netlogon.idl b/source/librpc/idl/netlogon.idl
index 74535fc..98cf1e7 100644
--- a/source/librpc/idl/netlogon.idl
+++ b/source/librpc/idl/netlogon.idl
@@ -1182,9 +1182,9 @@ interface netlogon
 		[in]  [string,charset(UTF16)] uint16 account_name[],
 		[in]  netr_SchannelType secure_channel_type,
 		[in]  [string,charset(UTF16)] uint16 computer_name[],
-		[in,ref] netr_Authenticator *credential,
-		[out,ref] netr_Authenticator *return_authenticator,
-		[in,ref] netr_CryptPassword *new_password
+		[in]  netr_Authenticator credential,
+		[in]  netr_CryptPassword new_password,
+		[out,ref] netr_Authenticator *return_authenticator
 		);
 
 	/****************/
diff --git a/source/libsmb/trusts_util.c b/source/libsmb/trusts_util.c
index 0535d1b..c3f5f25 100644
--- a/source/libsmb/trusts_util.c
+++ b/source/libsmb/trusts_util.c
@@ -31,60 +31,34 @@
 
 static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, 
 					 const unsigned char orig_trust_passwd_hash[16],
-					 const char *new_trust_pwd_cleartext,
 					 const unsigned char new_trust_passwd_hash[16],
 					 uint32 sec_channel_type)
 {
 	NTSTATUS result;
-	uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
 
-	result = rpccli_netlogon_setup_creds(cli,
-					     cli->cli->desthost, /* server name */
-					     lp_workgroup(), /* domain */
-					     global_myname(), /* client name */
-					     global_myname(), /* machine account name */
-					     orig_trust_passwd_hash,
-					     sec_channel_type,
-					     &neg_flags);
-
-	if (!NT_STATUS_IS_OK(result)) {
-		DEBUG(3,("just_change_the_password: unable to setup creds (%s)!\n",
-			 nt_errstr(result)));
-		return result;
-	}
-
-	if (neg_flags & NETLOGON_NEG_PASSWORD_SET2) {
-
-		struct netr_Authenticator clnt_creds, srv_cred;
-		struct netr_CryptPassword new_password;
-		struct samr_CryptPassword password_buf;
-
-		netlogon_creds_client_step(cli->dc, &clnt_creds);
-
-		encode_pw_buffer(password_buf.data, new_trust_pwd_cleartext, STR_UNICODE);
-
-		SamOEMhash(password_buf.data, cli->dc->sess_key, 516);
-		memcpy(new_password.data, password_buf.data, 512);
-		new_password.length = IVAL(password_buf.data, 512);
-
-		result = rpccli_netr_ServerPasswordSet2(cli, mem_ctx,
-						       cli->dc->remote_machine,
-						       cli->dc->mach_acct,
-						       sec_channel_type,
-						       global_myname(),
-						       &clnt_creds,
-						       &srv_cred,
-						       &new_password);
-
-		/* Always check returned credentials. */
-		if (!netlogon_creds_client_check(cli->dc, &srv_cred.cred)) {
-			DEBUG(0,("rpccli_netr_ServerPasswordSet2: "
-				"credentials chain check failed\n"));
-			return NT_STATUS_ACCESS_DENIED;
+	/* Check if the netlogon pipe is open using schannel. If so we
+	   already have valid creds. If not we must set them up. */
+
+	if (cli->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
+		uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
+
+		result = rpccli_netlogon_setup_creds(cli, 
+					cli->cli->desthost, /* server name */
+					lp_workgroup(), /* domain */
+					global_myname(), /* client name */
+					global_myname(), /* machine account name */
+					orig_trust_passwd_hash,
+					sec_channel_type,
+					&neg_flags);
+
+		if (!NT_STATUS_IS_OK(result)) {
+			DEBUG(3,("just_change_the_password: unable to setup creds (%s)!\n",
+				 nt_errstr(result)));
+			return result;
 		}
+	}
 
-	} else {
-
+	{
 		struct netr_Authenticator clnt_creds, srv_cred;
 		struct samr_Password new_password;
 
@@ -144,11 +118,8 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
 	
 	E_md4hash(new_trust_passwd, new_trust_passwd_hash);
 
-	nt_status = just_change_the_password(cli, mem_ctx,
-					     orig_trust_passwd_hash,
-					     new_trust_passwd,
-					     new_trust_passwd_hash,
-					     sec_channel_type);
+	nt_status = just_change_the_password(cli, mem_ctx, orig_trust_passwd_hash,
+					     new_trust_passwd_hash, sec_channel_type);
 	
 	if (NT_STATUS_IS_OK(nt_status)) {
 		DEBUG(3,("%s : trust_pw_change_and_store_it: Changed password.\n", 
diff --git a/source/m4/aclocal.m4 b/source/m4/aclocal.m4
index 9a4213d..53ad46c 100644
--- a/source/m4/aclocal.m4
+++ b/source/m4/aclocal.m4
@@ -139,7 +139,7 @@ if eval test x"$build_lib" = "xyes" ; then
 		LIBUC[_SHARED]=$LIBUC[_SHARED_TARGET]
 		AC_MSG_RESULT(yes)
 		if test x"$USESHARED" != x"true" -o x"$[LINK_]LIBUC" = "xSTATIC" ; then
-			enable_static=yes
+			LIBUC[_STATIC]=$LIBUC[_STATIC_TARGET]
 		else
 			LIBUC[_LIBS]=LIBLIBS
 		fi
@@ -152,7 +152,7 @@ else
 	AC_MSG_RESULT(shared library not selected, but will supply static library)
 fi
 if test $enable_static = yes; then
-	LIBUC[_STATIC]=[\$\(]LIBUC[_OBJ0\)]
+	LIBUC[_STATIC]=$LIBUC[_STATIC_TARGET]
 fi
 
 m4_popdef([LIBNAME])
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index b72be2b..af4acc8 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -293,8 +293,8 @@ static void reload_interfaces(time_t t)
 
 		BlockSignals(false, SIGTERM);
 
-		/* We only count IPv4, non-loopback interfaces here. */
-		while (iface_count_v4_nl() == 0 && !got_sig_term) {
+		/* We only count IPv4 interfaces here. */
+		while (iface_count_v4() == 0 && !got_sig_term) {
 			sleep(5);
 			load_interfaces();
 		}
diff --git a/source/nmbd/nmbd_processlogon.c b/source/nmbd/nmbd_processlogon.c
index d99b535..6e110dd 100644
--- a/source/nmbd/nmbd_processlogon.c
+++ b/source/nmbd/nmbd_processlogon.c
@@ -399,7 +399,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
 					char *component, *dc, *q1;
 					char *q_orig = q;
 					int str_offset;
-					char *saveptr = NULL;
+					char *saveptr;
 
 					domain = get_mydnsdomname(talloc_tos());
 					if (!domain) {
diff --git a/source/nmbd/nmbd_subnetdb.c b/source/nmbd/nmbd_subnetdb.c
index 225def5..a4422d2 100644
--- a/source/nmbd/nmbd_subnetdb.c
+++ b/source/nmbd/nmbd_subnetdb.c
@@ -195,20 +195,19 @@ struct subnet_record *make_normal_subnet(const struct interface *iface)
 bool create_subnets(void)
 {
 	/* We only count IPv4 interfaces whilst we're waiting. */
-	int num_interfaces;
+	int num_interfaces = iface_count_v4();
 	int i;
 	struct in_addr unicast_ip, ipzero;
 
   try_interfaces_again:
 
-	/* Only count IPv4, non-loopback interfaces. */
-	if (iface_count_v4_nl() == 0) {
-		DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n"));
+	if (iface_count_v4() == 0) {
+		DEBUG(0,("create_subnets: No local interfaces !\n"));
 		DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n"));
 	}
 
-	/* We only count IPv4, non-loopback interfaces here. */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list