[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Jul 9 13:37:03 UTC 2015


The branch, master has been updated
       via  540899a dosmode: Change message of result to informational
       via  a7fba97 vfs: Change final message in check_reduce_name to "info"
       via  df561a9 vfs: Make entry message for check_reduced_name a debug message
       via  ed2ed1a net: fix the order of DC lookup methods when joining a domain
      from  f9cc2de util.c: fix order of inclusion to correctly consume config.h

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


- Log -----------------------------------------------------------------
commit 540899a2d9b276f0b5ee5d474c1d6ce876411c14
Author: Christof Schmitt <cs at samba.org>
Date:   Wed Jul 8 14:40:25 2015 -0700

    dosmode: Change message of result to informational
    
    Logging the returned mode bits should be only "informational" (level 5).
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jul  9 15:36:30 CEST 2015 on sn-devel-104

commit a7fba97f98e7786c1c276b63e4b9e940d932447a
Author: Christof Schmitt <cs at samba.org>
Date:   Wed Jul 8 14:12:20 2015 -0700

    vfs: Change final message in check_reduce_name to "info"
    
    "Informational" is a better description for this message; change the log
    level accordingly (level 5).
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit df561a9b66bffae5fa706f13d63754ceea46b32b
Author: Christof Schmitt <cs at samba.org>
Date:   Wed Jul 8 14:07:18 2015 -0700

    vfs: Make entry message for check_reduced_name a debug message
    
    The interesting information is already logged later; having an
    additional message when entering the function should be only done as
    debug message (level 10).
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ed2ed1ad694ad1cc9e618baf1398ee26a4cdbde8
Author: Uri Simchoni <urisimchoni at gmail.com>
Date:   Sun Jun 28 14:36:22 2015 +0300

    net: fix the order of DC lookup methods when joining a domain
    
    The dsgetdcname() function is able to try just DNS lookup, just NetBIOS,
    or start with DNS and fall back to NetBIOS. For "net ads join", we know
    most of the time whether the name of the domain we're joining is a DNS
    name or a NetBIOS name. In that case, it makes no sense to try both lookup
    methods, especially that DNS may fail and we want to fall back from site-aware
    DNS lookup to site-less DNS lookup, with no NetBIOS lookup in between.
    
    This change lets "net ads join" tell libnet what is the type of the domain
    name, if it is known.
    
    Signed-off-by: Uri Simchoni <urisimchoni at gmail.com>
    Reviewed-by: Volker Lendecke <Volker.Lendecke at SerNet.DE>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 source3/libnet/libnet_join.c       | 9 ++++++++-
 source3/librpc/idl/libnet_join.idl | 7 +++++++
 source3/smbd/dosmode.c             | 5 +++--
 source3/smbd/vfs.c                 | 5 ++---
 source3/utils/net_ads.c            | 8 ++++++++
 5 files changed, 28 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 66f302a..3e58b18 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -2226,6 +2226,12 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
 	if (!r->in.dc_name) {
 		struct netr_DsRGetDCNameInfo *info;
 		const char *dc;
+		uint32_t name_type_flags = 0;
+		if (r->in.domain_name_type == JoinDomNameTypeDNS) {
+			name_type_flags = DS_IS_DNS_NAME;
+		} else if (r->in.domain_name_type == JoinDomNameTypeNBT) {
+			name_type_flags = DS_IS_FLAT_NAME;
+		}
 		status = dsgetdcname(mem_ctx,
 				     r->in.msg_ctx,
 				     r->in.domain_name,
@@ -2234,7 +2240,8 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
 				     DS_FORCE_REDISCOVERY |
 				     DS_DIRECTORY_SERVICE_REQUIRED |
 				     DS_WRITABLE_REQUIRED |
-				     DS_RETURN_DNS_NAME,
+				     DS_RETURN_DNS_NAME |
+				     name_type_flags,
 				     &info);
 		if (!NT_STATUS_IS_OK(status)) {
 			libnet_join_set_error_string(mem_ctx, r,
diff --git a/source3/librpc/idl/libnet_join.idl b/source3/librpc/idl/libnet_join.idl
index cb2d9e4..61c117e 100644
--- a/source3/librpc/idl/libnet_join.idl
+++ b/source3/librpc/idl/libnet_join.idl
@@ -15,10 +15,17 @@ interface libnetjoin
 	typedef bitmap wkssvc_joinflags wkssvc_joinflags;
 	typedef enum netr_SchannelType netr_SchannelType;
 
+	typedef [public] enum {
+		JoinDomNameTypeUnknown = 0,
+		JoinDomNameTypeDNS = 1,
+		JoinDomNameTypeNBT = 2
+	} libnetjoin_JoinDomNameType;
+
 	[nopush,nopull,noopnum] WERROR libnet_JoinCtx(
 		[in] string dc_name,
 		[in] string machine_name,
 		[in,ref] string *domain_name,
+		[in] libnetjoin_JoinDomNameType domain_name_type,
 		[in] string account_ou,
 		[in] string admin_account,
 		[in] string admin_domain,
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 714a7f8..72acd4e 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -192,8 +192,9 @@ mode_t unix_mode(connection_struct *conn, int dosmode,
 		}
 	}
 
-	DEBUG(3,("unix_mode(%s) returning 0%o\n", smb_fname_str_dbg(smb_fname),
-		 (int)result));
+	DBG_INFO("unix_mode(%s) returning 0%o\n",
+		 smb_fname_str_dbg(smb_fname), (int)result);
+
 	return(result);
 }
 
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 7f60b06..9f3ba6d 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1140,7 +1140,7 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 	bool allow_symlinks = true;
 	bool allow_widelinks = false;
 
-	DEBUG(3,("check_reduced_name [%s] [%s]\n", fname, conn->connectpath));
+	DBG_DEBUG("check_reduced_name [%s] [%s]\n", fname, conn->connectpath);
 
 	resolved_name = SMB_VFS_REALPATH(conn,fname);
 
@@ -1269,8 +1269,7 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 
   out:
 
-	DEBUG(3,("check_reduced_name: %s reduced to %s\n", fname,
-		 resolved_name));
+	DBG_INFO("%s reduced to %s\n", fname, resolved_name);
 	SAFE_FREE(resolved_name);
 	return NT_STATUS_OK;
 }
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index a8f3892..28553fc 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1439,6 +1439,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
 	const char *os_version = NULL;
 	const char *os_servicepack = NULL;
 	bool modify_config = lp_config_backend_is_registry();
+	enum libnetjoin_JoinDomNameType domain_name_type = JoinDomNameTypeDNS;
 
 	if (c->display_usage)
 		return net_ads_join_usage(c, argc, argv);
@@ -1511,6 +1512,11 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
 		}
 		else {
 			domain = argv[i];
+			if (strchr(domain, '.') == NULL) {
+				domain_name_type = JoinDomNameTypeUnknown;
+			} else {
+				domain_name_type = JoinDomNameTypeDNS;
+			}
 		}
 	}
 
@@ -1530,6 +1536,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
 	/* Do the domain join here */
 
 	r->in.domain_name	= domain;
+	r->in.domain_name_type	= domain_name_type;
 	r->in.create_upn	= createupn;
 	r->in.upn		= machineupn;
 	r->in.account_ou	= create_in_ou;
@@ -1552,6 +1559,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
 	if (W_ERROR_EQUAL(werr, WERR_DCNOTFOUND) &&
 	    strequal(domain, lp_realm())) {
 		r->in.domain_name = lp_workgroup();
+		r->in.domain_name_type = JoinDomNameTypeNBT;
 		werr = libnet_Join(ctx, r);
 	}
 	if (!W_ERROR_IS_OK(werr)) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list