summaryrefslogtreecommitdiff
path: root/source4/auth/ntlmssp
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth/ntlmssp')
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c56
1 files changed, 56 insertions, 0 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
*