Samba4 build help.

Jeremy Allison jra at samba.org
Fri May 21 23:17:01 MDT 2010


I want to commit my ntlmssp patch to source4.
Unfortunately when I add it the build fails.
(Patch is attached).

I'm adding a call to the ndr_push_VERSION()
in source4/auth/ntlmssp/ntlmssp_server.c,
but I get the build failure :

$ make
WAF_MAKE=1 ../buildtools/bin/waf build
Waf: Entering directory `/home/jeremy/src/samba/git/master/source4/bin'
[1912/1941] Linking default/source4/lib/ldb/ldbadd
default/source4/auth/gensec/libgensec-samba4.so: undefined reference to `ndr_push_VERSION'
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/jeremy/src/samba/git/master/source4/bin'
Build failed:  -> task failed (err #1): 
	{task: cc_link ldbutil_15.o,cmdline_15.o,ldbadd_16.o -> ldbadd}
make: *** [all] Error 1

This is the first time I need to add a dependency
to the WAF build - can someone explain how this
needs to be done ?

Thanks,

Jeremy.
-------------- next part --------------
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index 8a8c579..e7e9269 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -25,6 +25,7 @@
 #include "system/network.h"
 #include "lib/tsocket/tsocket.h"
 #include "auth/ntlmssp/ntlmssp.h"
+#include "../librpc/gen_ndr/ndr_ntlmssp.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "../lib/crypto/crypto.h"
 #include "auth/gensec/gensec.h"
@@ -199,10 +200,33 @@ NTSTATUS ntlmssp_server_negotiate(struct gensec_security *gensec_security,
 	{
 		/* Marshal the packet in the right format, be it unicode or ASCII */
 		const char *gen_string;
+		DATA_BLOB version_blob = data_blob_null;
+
+		if (chal_flags & NTLMSSP_NEGOTIATE_VERSION) {
+			enum ndr_err_code err;
+			struct VERSION vers;
+
+			/* "What Windows returns" as a version number. */
+			ZERO_STRUCT(vers);
+			vers.ProductMajorVersion = NTLMSSP_WINDOWS_MAJOR_VERSION_6;
+			vers.ProductMinorVersion = NTLMSSP_WINDOWS_MINOR_VERSION_1;
+			vers.ProductBuild = 0;
+			vers.NTLMRevisionCurrent = NTLMSSP_REVISION_W2K3;
+
+			err = ndr_push_struct_blob(&version_blob,
+						out_mem_ctx,
+						&vers,
+						(ndr_push_flags_fn_t)ndr_push_VERSION);
+
+			if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
+				return NT_STATUS_NO_MEMORY;
+			}
+		}
+
 		if (ntlmssp_state->unicode) {
-			gen_string = "CdUdbddB";
+			gen_string = "CdUdbddBb";
 		} else {
-			gen_string = "CdAdbddB";
+			gen_string = "CdAdbddBb";
 		}
 		
 		msrpc_gen(out_mem_ctx, 
@@ -213,7 +237,10 @@ NTSTATUS ntlmssp_server_negotiate(struct gensec_security *gensec_security,
 			  chal_flags,
 			  cryptkey, 8,
 			  0, 0,
-			  struct_blob.data, struct_blob.length);
+			  struct_blob.data, struct_blob.length,
+			  version_blob.data, version_blob.length);
+
+		data_blob_free(&version_blob);
 	}
 		
 	ntlmssp_state->expected_state = NTLMSSP_AUTH;


More information about the samba-technical mailing list