diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-15 01:08:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:12 -0500 |
commit | 6be47e9bc2484340f40264eb0852b2c1619ee900 (patch) | |
tree | e0c9ab1b17a25d244087be25068e8327d435f18e /source4 | |
parent | 3e92471d4cfa169b97da73752b6eb6d1ea8cb466 (diff) | |
download | samba-6be47e9bc2484340f40264eb0852b2c1619ee900.tar.gz samba-6be47e9bc2484340f40264eb0852b2c1619ee900.tar.bz2 samba-6be47e9bc2484340f40264eb0852b2c1619ee900.zip |
r7597: 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
(This used to be commit 35ec292f86bf663618b4bd03133d9bbd6e2faf10)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/ntlmssp/ntlmssp_server.c | 56 | ||||
-rw-r--r-- | source4/lib/util.c | 56 |
2 files changed, 56 insertions, 56 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c index bbe9b213f9..ab214578dd 100644 --- a/source4/auth/ntlmssp/ntlmssp_server.c +++ b/source4/auth/ntlmssp/ntlmssp_server.c @@ -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 @@ static const char *ntlmssp_target_name(struct gensec_ntlmssp_state *gensec_ntlms } } +/* + 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 * diff --git a/source4/lib/util.c b/source4/lib/util.c index 93559d9518..59d83a966a 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -281,62 +281,6 @@ char* get_myname(void) } /**************************************************************************** - 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. ****************************************************************************/ |