[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Dec 15 22:43:02 MST 2010


The branch, master has been updated
       via  2516338 s4-dsdb Don't talloc_free() ares on failure, as LDB might free it later
       via  eda1972 s4-dsdb Use sid_blob_parse()
       via  4a4d8e4 libcli/security Add sid_blob_parse() to directly parse a binary SID blob
       via  94b149f Typos in wintest
      from  a06519a Fix old bug in openX code, exposed when "strict allocate" is set to true.

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


- Log -----------------------------------------------------------------
commit 25163380239abbad28f1656c42e6fab1b92473d9
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Dec 16 15:51:55 2010 +1100

    s4-dsdb Don't talloc_free() ares on failure, as LDB might free it later
    
    We need to make LDB consistent here (indexed vs unindexed behaviour
    differs here!), but for the moment this is the easiest way out of a
    segfault.
    
    Andrew Bartlett
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Thu Dec 16 06:42:56 CET 2010 on sn-devel-104

commit eda1972b68819b66bd11d6286753f03d083694ec
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Dec 15 15:48:00 2010 +1100

    s4-dsdb Use sid_blob_parse()

commit 4a4d8e4b0fae1288cbdf6c8a95a2863c84676106
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Dec 15 15:47:01 2010 +1100

    libcli/security Add sid_blob_parse() to directly parse a binary SID blob

commit 94b149f3cb6c82834f83b73928f5b40e388eb6e5
Author: Zahari Zahariev <zahari.zahariev at postpath.com>
Date:   Mon Dec 13 18:14:51 2010 +0200

    Typos in wintest

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

Summary of changes:
 libcli/security/dom_sid.h                   |    1 +
 libcli/security/util_sid.c                  |   16 +++++++++++++---
 source4/dsdb/common/util.c                  |    6 +++---
 source4/dsdb/samdb/ldb_modules/descriptor.c |    1 -
 wintest/test-s4-howto.py                    |    2 +-
 wintest/wintest.py                          |    4 ++--
 6 files changed, 20 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/security/dom_sid.h b/libcli/security/dom_sid.h
index 3d1161f..8d59b18 100644
--- a/libcli/security/dom_sid.h
+++ b/libcli/security/dom_sid.h
@@ -81,6 +81,7 @@ bool sid_split_rid(struct dom_sid *sid, uint32_t *rid);
 bool sid_peek_rid(const struct dom_sid *sid, uint32_t *rid);
 bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32_t *rid);
 void sid_copy(struct dom_sid *dst, const struct dom_sid *src);
+bool sid_blob_parse(DATA_BLOB in, struct dom_sid *sid);
 bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid);
 int sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid2);
 bool sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2);
diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c
index 9ba28eb..18b9951 100644
--- a/libcli/security/util_sid.c
+++ b/libcli/security/util_sid.c
@@ -233,13 +233,12 @@ void sid_copy(struct dom_sid *dst, const struct dom_sid *src)
 }
 
 /*****************************************************************
- Parse a on-the-wire SID to a struct dom_sid.
+ Parse a on-the-wire SID (in a DATA_BLOB) to a struct dom_sid.
 *****************************************************************/
 
-bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid)
+bool sid_blob_parse(DATA_BLOB in, struct dom_sid *sid)
 {
 	enum ndr_err_code ndr_err;
-	DATA_BLOB in = data_blob_const(inbuf, len);
 	ndr_err = ndr_pull_struct_blob_all(&in, NULL, sid,
 					   (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
 	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
@@ -249,6 +248,17 @@ bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid)
 }
 
 /*****************************************************************
+ Parse a on-the-wire SID to a struct dom_sid.
+*****************************************************************/
+
+bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid)
+{
+	enum ndr_err_code ndr_err;
+	DATA_BLOB in = data_blob_const(inbuf, len);
+	return sid_blob_parse(in, sid);
+}
+
+/*****************************************************************
  See if 2 SIDs are in the same domain
  this just compares the leading sub-auths
 *****************************************************************/
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index e1aa898..b157ba9 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -348,6 +348,7 @@ uint32_t samdb_result_rid_from_sid(TALLOC_CTX *mem_ctx, const struct ldb_message
 struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_message *msg, 
 				     const char *attr)
 {
+	bool ok;
 	const struct ldb_val *v;
 	struct dom_sid *sid;
 	enum ndr_err_code ndr_err;
@@ -359,9 +360,8 @@ struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_messa
 	if (sid == NULL) {
 		return NULL;
 	}
-	ndr_err = ndr_pull_struct_blob(v, sid, sid,
-				       (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
-	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+	ok = sid_blob_parse(*v, sid);
+	if (!ok) {
 		talloc_free(sid);
 		return NULL;
 	}
diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c
index 0ea91ba..b96e5b5 100644
--- a/source4/dsdb/samdb/ldb_modules/descriptor.c
+++ b/source4/dsdb/samdb/ldb_modules/descriptor.c
@@ -545,7 +545,6 @@ static int descriptor_search_callback(struct ldb_request *req, struct ldb_reply
 	}
 
 fail:
-	talloc_free(ares);
 	return ldb_module_done(ac->req, NULL, NULL, ret);
 }
 
diff --git a/wintest/test-s4-howto.py b/wintest/test-s4-howto.py
index c4a430c..cb9862b 100755
--- a/wintest/test-s4-howto.py
+++ b/wintest/test-s4-howto.py
@@ -610,7 +610,7 @@ def test_howto(t):
         create_shares(t)
         start_s4(t)
         test_smbclient(t)
-        t.restart_bind(kerberos_support=True, include='{PREFIX}/private/named.conf')
+        t.restart_bind(kerberos_support=True, include='${PREFIX}/private/named.conf')
         test_dns(t)
         test_kerberos(t)
         test_dyndns(t)
diff --git a/wintest/wintest.py b/wintest/wintest.py
index 10bc562..2939b0f 100644
--- a/wintest/wintest.py
+++ b/wintest/wintest.py
@@ -445,7 +445,7 @@ options {
         self.rndc_cmd("flush")
 
     def restart_bind(self, kerberos_support=False, include=None):
-        self.configure_bind(keberos_support=kerberos_support, include=include)
+        self.configure_bind(kerberos_support=kerberos_support, include=include)
         self.stop_bind()
         self.start_bind()
 
@@ -582,7 +582,7 @@ options {
             if i != 0:
                 self.info("Firewall disable failed - ignoring")
             child.expect("C:")
- 
+
     def set_dns(self, child):
         child.sendline('netsh interface ip set dns "${WIN_NIC}" static ${INTERFACE_IP} primary')
         i = child.expect(['C:', pexpect.EOF, pexpect.TIMEOUT], timeout=5)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list