summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-01-12 18:12:13 +0100
committerJeremy Allison <jra@samba.org>2015-01-12 23:10:30 +0100
commitda2611adef32107f5a0eec97501c01232ab72efc (patch)
tree97efb4c98527c49ad1ae512bd73ac84cb906ae68
parent8365318b6d5df5db3f47ee496b3cf5ce83252572 (diff)
downloadsamba-da2611adef32107f5a0eec97501c01232ab72efc.tar.gz
samba-da2611adef32107f5a0eec97501c01232ab72efc.tar.xz
samba-da2611adef32107f5a0eec97501c01232ab72efc.zip
s3-util: Fix authentication with long hostnames.
If the hostname is longer than MAX_NETBIOSNAME_LEN we fail to correctly check the hostname. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11008 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jan 12 23:10:30 CET 2015 on sn-devel-104
-rw-r--r--source3/lib/util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index b64b32b9a7..e53953b085 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1197,7 +1197,9 @@ bool is_myname(const char *s)
bool ret = False;
for (n=0; my_netbios_names(n); n++) {
- if (strequal(my_netbios_names(n), s)) {
+ const char *nbt_name = my_netbios_names(n);
+
+ if (strncasecmp_m(nbt_name, s, strlen(nbt_name)) == 0) {
ret=True;
break;
}