[PATCH] s3: set native os according to Windows and NBT_ANNOUNCE_VERSION defines

Björn Jacke bj at sernet.de
Tue Jan 7 07:57:50 MST 2014


When the native os in sessionsetup is "Unix" then broken Konica Minolta
printers refuse to talk to those CIFS servers. Other CIFS servers also announce
themselves with native os Windows. Let's do the same to improve
interoperability with broken devices like those printers from Konica Minolta.
Thanks to Daniel Hoffmann for finding and reporting this Konika printer
brokenness.

This fixes Bug #10168.

Signed-off-by: Bjoern Jacke <bj at sernet.de>
---
 source3/smbd/sesssetup.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 4728759..02cb445 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -46,10 +46,14 @@ static int push_signature(uint8 **outbuf)
 {
 	char *lanman;
 	int result, tmp;
+	fstring native_os;
 
 	result = 0;
 
-	tmp = message_push_string(outbuf, "Unix", STR_TERMINATE);
+	fstr_sprintf(native_os, "Windows %d.%d", SAMBA_MAJOR_NBT_ANNOUNCE_VERSION,
+		SAMBA_MINOR_NBT_ANNOUNCE_VERSION);
+
+	tmp = message_push_string(outbuf, native_os, STR_TERMINATE);
 
 	if (tmp == -1) return -1;
 	result += tmp;
-- 
1.8.3.4



More information about the samba-technical mailing list