svn commit: samba r10663 - in branches/SAMBA_4_0/source/auth/ntlmssp: .

jelmer at samba.org jelmer at samba.org
Fri Sep 30 22:08:06 GMT 2005


Author: jelmer
Date: 2005-09-30 22:08:06 +0000 (Fri, 30 Sep 2005)
New Revision: 10663

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

Log:
Eliminate use of pstring

Modified:
   branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_parse.c
   branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_parse.c
===================================================================
--- branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_parse.c	2005-09-30 21:48:25 UTC (rev 10662)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_parse.c	2005-09-30 22:08:06 UTC (rev 10663)
@@ -21,7 +21,6 @@
 */
 
 #include "includes.h"
-#include "pstring.h"
 
 /*
   this is a tiny msrpc packet generator. I am only using this to
@@ -210,7 +209,7 @@
 	uint16_t len1, len2;
 	uint32_t ptr;
 	uint32_t *v;
-	pstring p;
+	char *p;
 
 	va_start(ap, format);
 	for (i=0; format[i]; i++) {
@@ -237,13 +236,10 @@
 					return False;
 
 				if (0 < len1) {
-					pull_string(p, blob->data + ptr, sizeof(p), 
-						    len1, 
-						    STR_UNICODE|STR_NOALIGN);
-					(*ps) = talloc_strdup(mem_ctx, p);
-					if (!(*ps)) {
+					if (convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, blob->data + ptr, len1, (void **)&p) < 0) {
 						return False;
 					}
+					(*ps) = p;
 				} else {
 					(*ps) = "";
 				}

Modified: branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c
===================================================================
--- branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c	2005-09-30 21:48:25 UTC (rev 10662)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c	2005-09-30 22:08:06 UTC (rev 10663)
@@ -26,7 +26,6 @@
 #include "auth/auth.h"
 #include "auth/ntlmssp/ntlmssp.h"
 #include "lib/crypto/crypto.h"
-#include "pstring.h"
 #include "system/filesys.h"
 
 /** 
@@ -107,7 +106,7 @@
 */
 static BOOL get_myfullname(char *my_name)
 {
-	pstring hostname;
+	char hostname[HOST_NAME_MAX];
 
 	*hostname = 0;
 
@@ -121,13 +120,13 @@
 	hostname[sizeof(hostname)-1] = '\0';
 
 	if (my_name)
-		fstrcpy(my_name, hostname);
+		strncpy(my_name, hostname, sizeof(hostname));
 	return True;
 }
 
 static BOOL get_mydomname(char *my_domname)
 {
-	pstring hostname;
+	char hostname[HOST_NAME_MAX];
 	char *p;
 
 	/* arrgh! relies on full name in system */
@@ -150,7 +149,7 @@
 	p++;
 	
 	if (my_domname)
-		fstrcpy(my_domname, p);
+		strncpy(my_domname, p, sizeof(hostname));
 
 	return True;
 }
@@ -173,7 +172,7 @@
 {
 	struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
 	DATA_BLOB struct_blob;
-	fstring dnsname, dnsdomname;
+	char dnsname[HOST_NAME_MAX], dnsdomname[HOST_NAME_MAX];
 	uint32_t neg_flags = 0;
 	uint32_t ntlmssp_command, chal_flags;
 	char *cliname=NULL, *domname=NULL;



More information about the samba-cvs mailing list