diff options
author | Jeremy Allison <jra@samba.org> | 1998-12-14 20:23:56 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-12-14 20:23:56 +0000 |
commit | ef1e81d1f5ab0d9a1d674661258f4f6492990da9 (patch) | |
tree | b86e5ade3c1665a1339a8bcfb36eae00d1fc5543 | |
parent | 0a868d1ec30998257d57d71f5eacceb4a0086ca3 (diff) | |
download | samba-ef1e81d1f5ab0d9a1d674661258f4f6492990da9.tar.gz samba-ef1e81d1f5ab0d9a1d674661258f4f6492990da9.tar.xz samba-ef1e81d1f5ab0d9a1d674661258f4f6492990da9.zip |
Fixed debug statements so the name type being looked up is printed.
Fixed lmhosts lookup so that -1 means wildcard nametype match.
Jeremy.
-rw-r--r-- | source/libsmb/namequery.c | 13 |
1 files 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); |