167d4b
From 128ab365f7ee075d87640d96c4b6c2170ce9bca7 Mon Sep 17 00:00:00 2001
167d4b
From: Andreas Schneider <asn@samba.org>
167d4b
Date: Mon, 12 Jan 2015 18:12:13 +0100
167d4b
Subject: [PATCH] s3-util: Fix authentication with long hostnames.
167d4b
167d4b
If the hostname is longer than MAX_NETBIOSNAME_LEN we fail to correctly
167d4b
check the hostname.
167d4b
167d4b
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11008
167d4b
167d4b
Signed-off-by: Andreas Schneider <asn@samba.org>
167d4b
Reviewed-by: Jeremy Allison <jra@samba.org>
167d4b
167d4b
(cherry picked from commit da2611adef32107f5a0eec97501c01232ab72efc)
167d4b
Signed-off-by: Andreas Schneider <asn@samba.org>
167d4b
---
167d4b
 source3/lib/util.c | 4 +++-
167d4b
 1 file changed, 3 insertions(+), 1 deletion(-)
167d4b
167d4b
diff --git a/source3/lib/util.c b/source3/lib/util.c
167d4b
index f64e2a3..9e6ac9c 100644
167d4b
--- a/source3/lib/util.c
167d4b
+++ b/source3/lib/util.c
167d4b
@@ -1192,7 +1192,9 @@ bool is_myname(const char *s)
167d4b
 	bool ret = False;
167d4b
 
167d4b
 	for (n=0; my_netbios_names(n); n++) {
167d4b
-		if (strequal(my_netbios_names(n), s)) {
167d4b
+		const char *nbt_name = my_netbios_names(n);
167d4b
+
167d4b
+		if (strncasecmp_m(nbt_name, s, strlen(nbt_name)) == 0) {
167d4b
 			ret=True;
167d4b
 			break;
167d4b
 		}
167d4b
-- 
167d4b
2.2.1
167d4b