New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Net::Domain->hostfqdn result is based on unecessarily flaky assumptions #10542
Comments
From torge@husfeldt.infoCreated by torge@husfeldt.infoOn *nix systems, the result of: Net::Domain->hostfqnd() is always based on the assumption that the domain of localhost is `hostname -f` which correctly takes into account the value for "domain", if present To reproduce: Perl Info
|
From torge@husfeldt.infoActually, on taking a deeper look into this, I found that the situation The domain used in hostfqdn is the first "word" after the last To make the default a bit more sensible it would be good to prefer the Proposed Patch attached |
From torge@husfeldt.infohostfqdn.patch*** Domain.pm.bak 2010-08-10 16:06:02.000000000 +0200
--- Domain.pm 2010-08-10 16:15:09.000000000 +0200
***************
*** 127,139 ****
local *RES;
local ($_);
if (open(RES, "/etc/resolv.conf")) {
while (<RES>) {
! $domain = $1
! if (/\A\s*(?:domain|search)\s+(\S+)/);
}
close(RES);
return $domain
if (defined $domain);
}
--- 127,147 ----
local *RES;
local ($_);
+ my $res_first_search_domain;
+
if (open(RES, "/etc/resolv.conf")) {
while (<RES>) {
! if (/\A\s*domain\s+(\S+)/) {
! $domain = $1;
! last;
! }
! $res_first_search_domain = $1
! if (/\A\s*search\s+(\S+)/);
}
close(RES);
+ $domain ||= $res_first_search_domain;
+
return $domain
if (defined $domain);
}
|
torge@husfeldt.info - Status changed from 'new' to 'open' |
From @iabynNote that Net::Domain is part of the libnet CPAN distribution, and any https://rt.cpan.org/Public/Dist/Display.html?Name=libnet I'm closing this ticket now in the perl queue. |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#77136 (status was 'rejected')
Searchable as RT77136$
The text was updated successfully, but these errors were encountered: