diff options
author | Roel van Meer <roel@1afa.com> | 2015-08-04 16:50:43 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2015-08-31 14:39:49 +0200 |
commit | 711131ea3df7ab7decc33d035c0b395caadbfe5c (patch) | |
tree | 07d8dfd8d1ddd431f11dea36f65293461a59f5e9 | |
parent | 0c640d097fe6f83f3585d76f875c5fb0cade26af (diff) | |
download | samba-711131ea3df7ab7decc33d035c0b395caadbfe5c.tar.gz |
s3-util: Compare the maximum allowed length of a NetBIOS name
This fixes a problem where is_myname() returns true if one of our names
is a substring of the specified name.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11427
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 4e178ed498c594ffcd5592d0b792d47b064b9586)
Autobuild-User(v4-1-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-1-test): Mon Aug 31 14:39:49 CEST 2015 on sn-devel-104
-rw-r--r-- | source3/lib/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 641a67eae25..0905ca2ad55 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1194,7 +1194,7 @@ bool is_myname(const char *s) for (n=0; my_netbios_names(n); n++) { const char *nbt_name = my_netbios_names(n); - if (strncasecmp_m(nbt_name, s, strlen(nbt_name)) == 0) { + if (strncasecmp_m(nbt_name, s, MAX_NETBIOSNAME_LEN-1) == 0) { ret=True; break; } |