From 1e6e5b299c235b513095a76a4cd9fffc41e8fc9c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 17 Jun 2002 18:36:36 +0000 Subject: beginning to sync up for 2.2.5 release.... --- source/libsmb/nmblib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/libsmb/nmblib.c') diff --git a/source/libsmb/nmblib.c b/source/libsmb/nmblib.c index 54f34cc233a..95d124c0208 100644 --- a/source/libsmb/nmblib.c +++ b/source/libsmb/nmblib.c @@ -1119,7 +1119,11 @@ char *dns_to_netbios_name(char *dns_name) netbios name up to and including the '.' this even applies, by mistake, to workgroup (domain) names, which is _really_ daft. */ - for (i = 15; i >= 0; i--) + /* + * We need to go up, not down, to avoid netbios names like + * fred.xyz being produced from fred.xyz.someco.com. + */ + for (i = 0; i < 15; i++) { if (netbios_name[i] == '.') { -- cgit