svn commit: samba r7597 - in branches/SAMBA_4_0/source: auth/ntlmssp lib

tridge at samba.org tridge at samba.org
Wed Jun 15 01:08:54 GMT 2005


Author: tridge
Date: 2005-06-15 01:08:54 +0000 (Wed, 15 Jun 2005)
New Revision: 7597

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7597

Log:
removed the bogus get_myfullname() and get_mydomname() calls, and put
them in the ntlmssp code, which is the only place they are
used. Andrew, please remove them completely once you have some more
reliable way to get this info

they are bogus as gethostname() may give us a short hostname (and does
on lot of systems), so the calls often give totally the wrong result
anyway

Modified:
   branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c
   branches/SAMBA_4_0/source/lib/util.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c
===================================================================
--- branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c	2005-06-15 01:02:53 UTC (rev 7596)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c	2005-06-15 01:08:54 UTC (rev 7597)
@@ -27,6 +27,7 @@
 #include "auth/ntlmssp/ntlmssp.h"
 #include "lib/crypto/crypto.h"
 #include "pstring.h"
+#include "system/filesys.h"
 
 /** 
  * Set a username on an NTLMSSP context - ensures it is talloc()ed 
@@ -101,6 +102,61 @@
 	}
 }
 
+/*
+  Andrew, please remove these totally bogus calls when you get time
+*/
+static BOOL get_myfullname(char *my_name)
+{
+	pstring hostname;
+
+	*hostname = 0;
+
+	/* get my host name */
+	if (gethostname(hostname, sizeof(hostname)) == -1) {
+		DEBUG(0,("gethostname failed\n"));
+		return False;
+	} 
+
+	/* Ensure null termination. */
+	hostname[sizeof(hostname)-1] = '\0';
+
+	if (my_name)
+		fstrcpy(my_name, hostname);
+	return True;
+}
+
+static BOOL get_mydomname(char *my_domname)
+{
+	pstring hostname;
+	char *p;
+
+	/* arrgh! relies on full name in system */
+
+	*hostname = 0;
+	/* get my host name */
+	if (gethostname(hostname, sizeof(hostname)) == -1) {
+		DEBUG(0,("gethostname failed\n"));
+		return False;
+	} 
+
+	/* Ensure null termination. */
+	hostname[sizeof(hostname)-1] = '\0';
+
+	p = strchr_m(hostname, '.');
+
+	if (!p)
+		return False;
+
+	p++;
+	
+	if (my_domname)
+		fstrcpy(my_domname, p);
+
+	return True;
+}
+
+
+
 /**
  * Next state function for the Negotiate packet
  * 

Modified: branches/SAMBA_4_0/source/lib/util.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util.c	2005-06-15 01:02:53 UTC (rev 7596)
+++ branches/SAMBA_4_0/source/lib/util.c	2005-06-15 01:08:54 UTC (rev 7597)
@@ -281,62 +281,6 @@
 }
 
 /****************************************************************************
- Get my own name, including domain.
-****************************************************************************/
-
-BOOL get_myfullname(char *my_name)
-{
-	pstring hostname;
-
-	*hostname = 0;
-
-	/* get my host name */
-	if (gethostname(hostname, sizeof(hostname)) == -1) {
-		DEBUG(0,("gethostname failed\n"));
-		return False;
-	} 
-
-	/* Ensure null termination. */
-	hostname[sizeof(hostname)-1] = '\0';
-
-	if (my_name)
-		fstrcpy(my_name, hostname);
-	return True;
-}
-
-/****************************************************************************
- Get my own domain name.
-****************************************************************************/
-
-BOOL get_mydomname(char *my_domname)
-{
-	pstring hostname;
-	char *p;
-
-	*hostname = 0;
-	/* get my host name */
-	if (gethostname(hostname, sizeof(hostname)) == -1) {
-		DEBUG(0,("gethostname failed\n"));
-		return False;
-	} 
-
-	/* Ensure null termination. */
-	hostname[sizeof(hostname)-1] = '\0';
-
-	p = strchr_m(hostname, '.');
-
-	if (!p)
-		return False;
-
-	p++;
-	
-	if (my_domname)
-		fstrcpy(my_domname, p);
-
-	return True;
-}
-
-/****************************************************************************
  Interpret a protocol description string, with a default.
 ****************************************************************************/
 



More information about the samba-cvs mailing list