From ef1e81d1f5ab0d9a1d674661258f4f6492990da9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 14 Dec 1998 20:23:56 +0000 Subject: Fixed debug statements so the name type being looked up is printed. Fixed lmhosts lookup so that -1 means wildcard nametype match. Jeremy. --- source/libsmb/namequery.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c index 490ae9d66c0..e5afc9d07d9 100644 --- a/source/libsmb/namequery.c +++ b/source/libsmb/namequery.c @@ -434,8 +434,6 @@ void endlmhosts(FILE *fp) fclose(fp); } - - /******************************************************** resolve via "bcast" method *********************************************************/ @@ -447,7 +445,7 @@ static BOOL resolve_bcast(const char *name, struct in_addr *return_ip, int name_ * "bcast" means do a broadcast lookup on all the local interfaces. */ - DEBUG(3,("resolve_name: Attempting broadcast lookup for name %s<0x20>\n", name)); + DEBUG(3,("resolve_name: Attempting broadcast lookup for name %s<0x%x>\n", name, name_type)); sock = open_socket_in( SOCK_DGRAM, 0, 3, interpret_addr(lp_socket_address()) ); @@ -499,7 +497,7 @@ static BOOL resolve_wins(const char *name, struct in_addr *return_ip, int name_t * would then block). */ - DEBUG(3,("resolve_name: Attempting wins lookup for name %s<0x20>\n", name)); + DEBUG(3,("resolve_name: Attempting wins lookup for name %s<0x%x>\n", name, name_type)); if(!*lp_wins_server()) { DEBUG(3,("resolve_name: WINS server resolution selected and no WINS server present.\n")); @@ -545,13 +543,14 @@ static BOOL resolve_lmhosts(const char *name, struct in_addr *return_ip, int nam pstring lmhost_name; int name_type2; - DEBUG(3,("resolve_name: Attempting lmhosts lookup for name %s\n", name)); + DEBUG(3,("resolve_name: Attempting lmhosts lookup for name %s<0x%x>\n", name, name_type)); fp = startlmhosts( LMHOSTSFILE ); if(fp) { while (getlmhostsent(fp, lmhost_name, &name_type2, return_ip)) { if (strequal(name, lmhost_name) && - name_type == name_type2) { + ((name_type2 == -1) || (name_type == name_type2)) + ) { endlmhosts(fp); return True; } @@ -572,7 +571,7 @@ static BOOL resolve_hosts(const char *name, struct in_addr *return_ip) */ struct hostent *hp; - DEBUG(3,("resolve_name: Attempting host lookup for name %s\n", name)); + DEBUG(3,("resolve_name: Attempting host lookup for name %s<0x20>\n", name)); if (((hp = Get_Hostbyname(name)) != NULL) && (hp->h_addr != NULL)) { putip((char *)return_ip,(char *)hp->h_addr); -- cgit