[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sat Aug 28 06:06:30 MDT 2010


The branch, master has been updated
       via  755ef5c s3: Remove smbd_server_fd() from set_local_machine_name()
      from  5e58156 s3: Fix a typo

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


- Log -----------------------------------------------------------------
commit 755ef5cf1159f4af40e763ab797be8fcaa0c6d37
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 28 14:05:20 2010 +0200

    s3: Remove smbd_server_fd() from set_local_machine_name()

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

Summary of changes:
 source3/lib/substitute.c |   15 ---------------
 source3/smbd/reply.c     |    9 +++++++++
 2 files changed, 9 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index e5f1b2d..e655128 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -45,7 +45,6 @@ bool set_local_machine_name(const char *local_name, bool perm)
 {
 	static bool already_perm = false;
 	char *tmp_local_machine = NULL;
-	char addr[INET6_ADDRSTRLEN];
 	size_t len;
 
 	tmp_local_machine = SMB_STRDUP(local_name);
@@ -54,20 +53,6 @@ bool set_local_machine_name(const char *local_name, bool perm)
 	}
 	trim_char(tmp_local_machine,' ',' ');
 
-	/*
-	 * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV"
-	 * arrggg!!!
-	 */
-
-	if (strequal(tmp_local_machine, "*SMBSERVER") ||
-			strequal(tmp_local_machine, "*SMBSERV") )  {
-		SAFE_FREE(local_machine);
-		local_machine = SMB_STRDUP(client_socket_addr(smbd_server_fd(),
-					addr, sizeof(addr)) );
-		SAFE_FREE(tmp_local_machine);
-		return local_machine ? true : false;
-	}
-
 	if (already_perm) {
 		return true;
 	}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5533ee0..df7dac7 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -528,6 +528,15 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf)
 			exit_server_cleanly("retargeted client");
 		}
 
+		/*
+		 * Windows NT/2k uses "*SMBSERVER" and XP uses
+		 * "*SMBSERV" arrggg!!!
+		 */
+		if (strequal(name1, "*SMBSERVER     ")
+		    || strequal(name1, "*SMBSERV       "))  {
+			fstrcpy(name1, sconn->client_id.addr);
+		}
+
 		set_local_machine_name(name1, True);
 		set_remote_machine_name(name2, True);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list