Discussion:
[BackupPC-devel] Bug Report: Perl gethostbyname return wrong value
brian schwartz
2008-09-11 16:51:36 UTC
Permalink
I think i may have found a small bug. I just started using BackupPc, and found that every time i used a host name; it did not work, but the with an IP it did work. After a few test i found the problem is with perl trying to lookup the host by gethostbuname, and that it returns true all the time. On the other hand nmblookup works fine, but is nevcer used since the program thinks gethostbyname worked.Bellow i triued to prove it ***@n00b-Server:~$ smbtree -bPassword: THE_BRUCESTER_N \\N00B-SERVER n00b-Server server (Samba, Ubuntu) \\N00B-SERVER\PDF PDF \\N00B-SERVER\print$ Printer Drivers \\N00B-SERVER\share \\N00B-SERVER\IPC$ IPC Service (n00b-Server server (Samba, Ubuntu)) \\LAPTOP Dell 5150 Laptoptimeout connecting to 208.69.32.132:445timeout connecting to 208.69.32.132:139Error connecting to 208.69.32.132 (Operation already in progress)cli_start_connection: failed to connect to LAPTOP<20> (208.69.32.132). Error NT_STATUS_ACCESS_DENIED \\DREAM-MACHINE Computer Roomtimeout connecting to 208.69.32.132:445timeout connecting to 208.69.32.132:139Error connecting to 208.69.32.132 (Operation already in progress)cli_start_connection: failed to connect to DREAM-MACHINE<20> (208.69.32.132). Error NT_STATUS_ACCESS_DENIED \\DAD-LINUX-BOX Dad-Linux-Box server (Samba, Ubuntu)timeout connecting to 208.69.32.132:445timeout connecting to 208.69.32.132:139Error connecting to 208.69.32.132 (Operation already in progress)cli_start_connection: failed to connect to DAD-LINUX-BOX<20> (208.69.32.132). Error ***@n00b-Server:~$ perl -e 'print(gethostbyname("DREAM-MACHINE") ? "ok\n" : "not found\n");'***@n00b-Server:~$ nmblookup DREAM-MACHINEquerying DREAM-MACHINE on 172.28.65.255172.28.64.176 DREAM-MACHINE<00>***@n00b-Server:~$ nmblookup -A 172.28.64.176Looking up status of 172.28.64.176 DREAM-MACHINE <00> - B <ACTIVE> THE_BRUCESTER_N <00> - <GROUP> B <ACTIVE> DREAM-MACHINE <20> - B <ACTIVE> THE_BRUCESTER_N <1e> - <GROUP> B <ACTIVE> MAC Address = 00-E0-4C-77-98-***@n00b-Server:~$ perl -e 'print(gethostbyname("NotRealCompOnNetwork") ? "ok\n" : "not found\n");'***@n00b-Server:~$ nmblookup NotRealCompOnNetworkquerying NotRealCompOnNetwork on 172.28.65.255querying NotRealCompOnNetwork on 172.28.65.255name_query failed to find name ***@n00b-Server:~$
_________________________________________________________________
See how Windows connects the people, information, and fun that are part of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
Craig Barratt
2008-10-02 06:04:57 UTC
Permalink
Post by brian schwartz
I think i may have found a small bug. I just started using BackupPc,
and found that every time i used a host name; it did not work, but
the with an IP it did work. After a few test i found the problem is
with perl trying to lookup the host by gethostbuname, and that it
returns true all the time. On the other hand nmblookup works fine,
but is nevcer used since the program thinks gethostbyname worked.
Bellow i triued to prove it best.
If gethostbyname() returns successfully then BackupPC believes it.
Something must be wrong with your DNS setup or perl configuration.

Craig

Loading...