[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Mon Feb 27 01:08:02 MST 2012
The branch, master has been updated
via b6fcac6 s3-selftest: avoid running LOCAL- tests twice
via c318c94 s3-param: Align lp_{max,min}protocol with lib/param names
via d21f778 torture: don't check the NOINDEXED bit in attribute comparison
via 3b3066f selftest: plugin_s4_dc can now handle kerberos properly
via e7397ee s4-netlogond: Fix use of uninitialised value dns_name
from 90c03cc lib/tdb2: rename tdb2.pc to tdb.pc
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b6fcac65fbf5024a04f970e5c60c379055ef477d
Author: Andrew Bartlett <abartlet at samba.org>
Date: Mon Feb 27 16:29:14 2012 +1100
s3-selftest: avoid running LOCAL- tests twice
Autobuild-User: Andrew Bartlett <abartlet at samba.org>
Autobuild-Date: Mon Feb 27 09:07:59 CET 2012 on sn-devel-104
commit c318c94170d58aeaa34f00e06fbf960816f7d0d9
Author: Andrew Bartlett <abartlet at samba.org>
Date: Mon Feb 27 14:24:30 2012 +1100
s3-param: Align lp_{max,min}protocol with lib/param names
This adds an alisas to ensure that both our loadparm systems know all
the names.
I would like to move to the 'server ..' name as canonical, and this
will be raised on the list.
Andrew Bartlett
commit d21f7783f6062118edf2c7b8dab79ebc5459317a
Author: Andrew Tridgell <tridge at samba.org>
Date: Thu Feb 9 15:14:10 2012 +1100
torture: don't check the NOINDEXED bit in attribute comparison
this bit is dependent on user settings on the filesystem
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
commit 3b3066fcaf9efa28aeea7e32a894a4dc3693275c
Author: Andrew Bartlett <abartlet at samba.org>
Date: Mon Feb 27 15:36:45 2012 +1100
selftest: plugin_s4_dc can now handle kerberos properly
commit e7397eeaa2631cde263ff324fda8fafa290bff8c
Author: Andrew Bartlett <abartlet at samba.org>
Date: Mon Feb 27 16:46:22 2012 +1100
s4-netlogond: Fix use of uninitialised value dns_name
The GET_CHECK_STR macro (now unrolled) did not initialise the trusts->array[n].dns_name
when the value was not set. New tests for our trusted domains code create
domain trusts without a DNS domain name. Found by the autobuild flakey build detector.
Andrew Bartlett
-----------------------------------------------------------------------
Summary of changes:
lib/param/loadparm.c | 24 +++++++++++++++
source3/include/proto.h | 4 +-
source3/param/loadparm.c | 38 ++++++++++++++++++------
source3/param/loadparm_ctx.c | 3 ++
source3/selftest/tests.py | 4 +-
source3/smbd/negprot.c | 4 +-
source3/smbd/process.c | 2 +-
source3/smbd/smb2_negprot.c | 18 ++++++------
source4/rpc_server/netlogon/dcerpc_netlogon.c | 27 +++++------------
source4/selftest/tests.py | 2 +-
source4/torture/smb2/create.c | 1 +
source4/torture/smb2/util.c | 2 +-
12 files changed, 82 insertions(+), 47 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 44a3329..bb59a79 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -606,6 +606,22 @@ static struct parm_struct parm_table[] = {
.enum_list = enum_protocol
},
{
+ .label = "max protocol",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(srv_maxprotocol),
+ .special = NULL,
+ .enum_list = enum_protocol
+ },
+ {
+ .label = "protocol",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(srv_maxprotocol),
+ .special = NULL,
+ .enum_list = enum_protocol
+ },
+ {
.label = "server min protocol",
.type = P_ENUM,
.p_class = P_GLOBAL,
@@ -614,6 +630,14 @@ static struct parm_struct parm_table[] = {
.enum_list = enum_protocol
},
{
+ .label = "min protocol",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(srv_minprotocol),
+ .special = NULL,
+ .enum_list = enum_protocol
+ },
+ {
.label = "client max protocol",
.type = P_ENUM,
.p_class = P_GLOBAL,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index f973800..e0d9f31 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1280,8 +1280,8 @@ int lp_passwordlevel(void);
int lp_usernamelevel(void);
int lp_deadtime(void);
bool lp_getwd_cache(void);
-int lp_maxprotocol(void);
-int lp_minprotocol(void);
+int lp_srv_maxprotocol(void);
+int lp_srv_minprotocol(void);
int lp_security(void);
const char **lp_auth_methods(void);
bool lp_paranoid_server_security(void);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 20a072d..382a273 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1549,7 +1549,16 @@ static struct parm_struct parm_table[] = {
.label = "max protocol",
.type = P_ENUM,
.p_class = P_GLOBAL,
- .offset = GLOBAL_VAR(maxprotocol),
+ .offset = GLOBAL_VAR(srv_maxprotocol),
+ .special = NULL,
+ .enum_list = enum_protocol,
+ .flags = FLAG_ADVANCED,
+ },
+ {
+ .label = "server max protocol",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(srv_maxprotocol),
.special = NULL,
.enum_list = enum_protocol,
.flags = FLAG_ADVANCED,
@@ -1558,7 +1567,7 @@ static struct parm_struct parm_table[] = {
.label = "protocol",
.type = P_ENUM,
.p_class = P_GLOBAL,
- .offset = GLOBAL_VAR(maxprotocol),
+ .offset = GLOBAL_VAR(srv_maxprotocol),
.special = NULL,
.enum_list = enum_protocol,
.flags = FLAG_ADVANCED,
@@ -1567,7 +1576,16 @@ static struct parm_struct parm_table[] = {
.label = "min protocol",
.type = P_ENUM,
.p_class = P_GLOBAL,
- .offset = GLOBAL_VAR(minprotocol),
+ .offset = GLOBAL_VAR(srv_minprotocol),
+ .special = NULL,
+ .enum_list = enum_protocol,
+ .flags = FLAG_ADVANCED,
+ },
+ {
+ .label = "server min protocol",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(srv_minprotocol),
.special = NULL,
.enum_list = enum_protocol,
.flags = FLAG_ADVANCED,
@@ -4748,8 +4766,8 @@ static void init_globals(bool reinit_globals)
Globals.max_log_size = 5000;
Globals.max_open_files = max_open_files();
Globals.open_files_db_hash_size = SMB_OPEN_DATABASE_TDB_HASH_SIZE;
- Globals.maxprotocol = PROTOCOL_NT1;
- Globals.minprotocol = PROTOCOL_CORE;
+ Globals.srv_maxprotocol = PROTOCOL_NT1;
+ Globals.srv_minprotocol = PROTOCOL_CORE;
Globals.security = SEC_USER;
Globals.paranoid_server_security = true;
Globals.bEncryptPasswords = true;
@@ -5268,19 +5286,19 @@ FN_GLOBAL_INTEGER(lp_passwordlevel, pwordlevel)
FN_GLOBAL_INTEGER(lp_usernamelevel, unamelevel)
FN_GLOBAL_INTEGER(lp_deadtime, deadtime)
FN_GLOBAL_BOOL(lp_getwd_cache, getwd_cache)
-static FN_GLOBAL_INTEGER(_lp_maxprotocol, maxprotocol)
-int lp_maxprotocol(void)
+static FN_GLOBAL_INTEGER(_lp_srv_maxprotocol, srv_maxprotocol)
+int lp_srv_maxprotocol(void)
{
- int ret = _lp_maxprotocol();
+ int ret = _lp_srv_maxprotocol();
if ((ret >= PROTOCOL_SMB2_02) && (lp_security() == SEC_SHARE)) {
DEBUG(2,("WARNING!!: \"security = share\" is incompatible "
"with the SMB2 protocol. Resetting to SMB1.\n" ));
- lp_do_parameter(-1, "max protocol", "NT1");
+ lp_do_parameter(-1, "server max protocol", "NT1");
return PROTOCOL_NT1;
}
return ret;
}
-FN_GLOBAL_INTEGER(lp_minprotocol, minprotocol)
+FN_GLOBAL_INTEGER(lp_srv_minprotocol, srv_minprotocol)
FN_GLOBAL_INTEGER(lp_security, security)
FN_GLOBAL_LIST(lp_auth_methods, AuthMethods)
FN_GLOBAL_BOOL(lp_paranoid_server_security, paranoid_server_security)
diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c
index e1bbda3..57ffb87 100644
--- a/source3/param/loadparm_ctx.c
+++ b/source3/param/loadparm_ctx.c
@@ -110,6 +110,9 @@ static const struct loadparm_s3_context s3_fns =
.unix_extensions = lp_unix_extensions,
.use_spnego = lp_use_spnego,
.use_mmap = lp_use_mmap,
+
+ .srv_minprotocol = lp_srv_minprotocol,
+ .srv_maxprotocol = lp_srv_maxprotocol,
};
const struct loadparm_s3_context *loadparm_s3_context(void)
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 3af4ab3..163cfb4 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -68,9 +68,9 @@ tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7",
"OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
"DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "RW-SIGNING",
"OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
- "TCON2", "IOCTL", "CHKPATH", "FDSESS", "LOCAL-SUBSTITUTE", "CHAIN1", "CHAIN2",
+ "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2",
"GETADDRINFO", "POSIX", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
- "LOCAL-BASE64", "LOCAL-GENCACHE", "POSIX-APPEND",
+ "POSIX-APPEND",
"CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
"CLEANUP1",
"CLEANUP2",
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 717000a..2f3fd45 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -695,8 +695,8 @@ void reply_negprot(struct smb_request *req)
/* Check for protocols, most desirable first */
for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) {
i = 0;
- if ((supported_protocols[protocol].protocol_level <= lp_maxprotocol()) &&
- (supported_protocols[protocol].protocol_level >= lp_minprotocol()))
+ if ((supported_protocols[protocol].protocol_level <= lp_srv_maxprotocol()) &&
+ (supported_protocols[protocol].protocol_level >= lp_srv_minprotocol()))
while (i < num_cliprotos) {
if (strequal(cliprotos[i],supported_protocols[protocol].proto_name))
choice = i;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 391ddc7..ba6314c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3013,7 +3013,7 @@ void smbd_process(struct tevent_context *ev_ctx,
char *rhost;
int ret;
- if (lp_maxprotocol() >= PROTOCOL_SMB2_02) {
+ if (lp_srv_maxprotocol() >= PROTOCOL_SMB2_02) {
/*
* We're not making the decision here,
* we're just allowing the client
diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c
index 4cae143..d971fba 100644
--- a/source3/smbd/smb2_negprot.c
+++ b/source3/smbd/smb2_negprot.c
@@ -119,10 +119,10 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
indyn = (const uint8_t *)req->in.vector[i+2].iov_base;
for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
- if (lp_maxprotocol() < PROTOCOL_SMB2_24) {
+ if (lp_srv_maxprotocol() < PROTOCOL_SMB2_24) {
break;
}
- if (lp_minprotocol() > PROTOCOL_SMB2_24) {
+ if (lp_srv_minprotocol() > PROTOCOL_SMB2_24) {
break;
}
@@ -134,10 +134,10 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
}
for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
- if (lp_maxprotocol() < PROTOCOL_SMB2_22) {
+ if (lp_srv_maxprotocol() < PROTOCOL_SMB2_22) {
break;
}
- if (lp_minprotocol() > PROTOCOL_SMB2_22) {
+ if (lp_srv_minprotocol() > PROTOCOL_SMB2_22) {
break;
}
@@ -149,10 +149,10 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
}
for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
- if (lp_maxprotocol() < PROTOCOL_SMB2_10) {
+ if (lp_srv_maxprotocol() < PROTOCOL_SMB2_10) {
break;
}
- if (lp_minprotocol() > PROTOCOL_SMB2_10) {
+ if (lp_srv_minprotocol() > PROTOCOL_SMB2_10) {
break;
}
@@ -164,10 +164,10 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
}
for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
- if (lp_maxprotocol() < PROTOCOL_SMB2_02) {
+ if (lp_srv_maxprotocol() < PROTOCOL_SMB2_02) {
break;
}
- if (lp_minprotocol() > PROTOCOL_SMB2_02) {
+ if (lp_srv_minprotocol() > PROTOCOL_SMB2_02) {
break;
}
@@ -179,7 +179,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
}
for (c=0; protocol == PROTOCOL_NONE && c < dialect_count; c++) {
- if (lp_maxprotocol() < PROTOCOL_SMB2_10) {
+ if (lp_srv_maxprotocol() < PROTOCOL_SMB2_10) {
break;
}
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 6d6cfe0..1cbd958 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -2088,21 +2088,6 @@ static WERROR dcesrv_netr_DsrGetDcSiteCoverageW(struct dcesrv_call_state *dce_ca
}
-#define GET_CHECK_STR(dest, mem, msg, attr) \
-do {\
- const char *s; \
- s = ldb_msg_find_attr_as_string(msg, attr, NULL); \
- if (!s) { \
- DEBUG(0, ("DB Error, TustedDomain entry (%s) " \
- "without flatname\n", \
- ldb_dn_get_linearized(msg->dn))); \
- continue; \
- } \
- dest = talloc_strdup(mem, s); \
- W_ERROR_HAVE_NO_MEMORY(dest); \
-} while(0)
-
-
static WERROR fill_trusted_domains_array(TALLOC_CTX *mem_ctx,
struct ldb_context *sam_ctx,
struct netr_DomainTrustList *trusts,
@@ -2158,10 +2143,14 @@ static WERROR fill_trusted_domains_array(TALLOC_CTX *mem_ctx,
n + 1);
W_ERROR_HAVE_NO_MEMORY(trusts->array);
- GET_CHECK_STR(trusts->array[n].netbios_name, trusts,
- dom_res[i], "flatname");
- GET_CHECK_STR(trusts->array[n].dns_name, trusts,
- dom_res[i], "trustPartner");
+ trusts->array[n].netbios_name = talloc_steal(trusts->array, ldb_msg_find_attr_as_string(dom_res[i], "flatname", NULL));
+ if (!trusts->array[n].netbios_name) {
+ DEBUG(0, ("DB Error, TrustedDomain entry (%s) "
+ "without flatname\n",
+ ldb_dn_get_linearized(dom_res[i]->dn)));
+ }
+
+ trusts->array[n].dns_name = talloc_steal(trusts->array, ldb_msg_find_attr_as_string(dom_res[i], "trustPartner", NULL));
trusts->array[n].trust_flags = flags;
if ((trust_flags & NETR_TRUST_FLAG_IN_FOREST) &&
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 39c0f4b..d00c6d2 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -136,7 +136,7 @@ for bindoptions in ["seal,padcheck"] + validate_list + ["bigendian"]:
for t in ncacn_np_tests:
env = "plugin_s4_dc"
transport = "ncacn_np"
- plansmbtorturetestsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '-k', 'no'], "samba4.%s with %s" % (t, bindoptions))
+ plansmbtorturetestsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s with %s" % (t, bindoptions))
for bindoptions in [""] + validate_list + ["bigendian"]:
for t in auto_rpc_tests:
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index 47d6115..4668e12 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/torture/smb2/create.c
@@ -275,6 +275,7 @@ static bool test_create_gentest(struct torture_context *tctx, struct smb2_tree *
ok_mask |= 1<<i;
expected = (io.in.file_attributes | FILE_ATTRIBUTE_ARCHIVE) & 0x00005127;
+ io.out.file_attr &= ~FILE_ATTRIBUTE_NONINDEXED;
CHECK_EQUAL(io.out.file_attr, expected);
file_attributes_set |= io.out.file_attr;
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index 5dca5c3..5da4c19 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -557,7 +557,7 @@ bool smb2_util_verify_attrib(TALLOC_CTX *tctx, struct smb2_tree *tree,
status = smb2_getinfo_file(tree, tctx, &q);
CHECK_STATUS(status, NT_STATUS_OK);
- q.all_info2.out.attrib &= ~FILE_ATTRIBUTE_ARCHIVE;
+ q.all_info2.out.attrib &= ~(FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_NONINDEXED);
if (q.all_info2.out.attrib != attrib) {
torture_warning(tctx, "%s: attributes don't match! "
--
Samba Shared Repository
More information about the samba-cvs
mailing list