NetBIOS names with dots in them!

Michael H. Warfield mhw at wittsend.com
Fri Nov 6 15:41:37 GMT 1998


I just hate it when I reply to my own replies...  Oh well...

Michael H. Warfield enscribed thusly:
	:
	:
	:

	Obviously the code below does not work if the full name with an
embedded dot is less than 16 characters long...  Duh...

	For those that didn't spot my oversight, think the process
through if we were looking for the name plover.alcove and nothing more.
What is the first name it tries...

	It also tries the final segment (plover) twice.

	So it was an off the cuff example that would need some "refining".  :-)

> 	That would amount to something similar to this psuedo code...
                             ^^^^^^^^^^^^^^^^^
	Key words (to try and reduce my embarrasement).

> =======================
> 	char name[16];
> 
> 	Done = False;
> 	strncpy( name, netbiosname, 15 );
> 	name[16] = '\0';
> 
> 	while( !Done && NULL != ( str_ptr = strrchr( name, '.' ) ) ) {
> 		*str_ptr = '\0';
> 		Done = do_lookup( name );
> 	}
> 	if( !Done ) {
> 		Done = do_lookup( name );
> 	}
> =======================

	Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw at WittsEnd.com
  (The Mad Wizard)      |  (770) 925-8248   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!


More information about the samba-technical mailing list