in reply to Re^2: Problem using Net::Netrc and Tie::File
in thread Problem using Net::Netrc and Tie::File

I believe .netrc should be 0600 (read and write by owner), not 0400 (read only). At least it is so in my docs.

Since the script hangs at the point it is accessing the netrc file I can do no further error checking.
.. this might not be a correct assumption..

Is that a far-reaching enough sample of your actual script -- the host lookup method by itself doesn't really "do" anything. However if you do (attempt) an actual ftp login you would get the hang/lockup if for any reason the ftp data connection cannot be built, for firewall rules or whatever reason.. just a thought. The default timeout is probably like 60 seconds.. a veritable eternity..



Replies are listed 'Best First'.
Re^4: Problem using Net::Netrc and Tie::File
by sweetblood (Prior) on Jun 13, 2004 at 04:18 UTC
    The script in the OP repoduces the problem. I believe the lookup method does access and read the ~/.netrc. Regarding the file mode for the .netrc file; the manpage for netrc on my HPUX 11 has the following:
    If the .netrc file contains password or account information for use other than for anonymous ftp, its owner must match the effective + user ID of the current process. Its read, write, and execute mode bi +ts for group and other must all be zero, and it must be readable by its owner. Otherwise, the file is ignored.
    The Net::Netrc page says read/write for owner or 0600. Either way (400||600), the script hangs if both Tie::File and Net::Netrc are both in the script. If I remove Tie::File from the above script it does not hang.

    Thanks

    Sweetblood