Today, while trying to get Mail::SPF::Query to build cleanly, I ran into a wonderful error that caused the test harness to bomb out. Google got me nowhere, the phrasing (This account is currently not available) was way too generic to get any useful hits on.
The build environment is a CentOS 4.2 installation, updated via yum. Nothing special. The only caveat is that I was doing the build of Mail::SPF::Query via rpmbuild as root. Yes, I know, bad move – but it did show up an interesting glitch:
# make test
PERL_DL_NONLAZY=1 /usr/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
t/00_all….NOK 9# Test 9 got: “This account is currently not available.: 192.0.2.1 is neither permitted nor denied by domain of 06.spf1-test.mailzone.com” (t/00_all.t at line 109 fail #8)
# Expected: “192.0.2.1 is neither permitted nor denied by domain of 06.spf1-test.mailzone.com”
The ‘account is currently not available’ message is the one that’s too generic, and it throws the test right off. The result did contain the correct string that the test wanted, but the test is a hard match, not a soft match. The source code for the SPF module didn’t have the ‘not available’ message, nor did the DNS query results (tethereal capture to make sure). This meant it had to be coming from deeper down the stack of modules – the only question was where?
The source code for Query.pm states on line 1082:
$newval = $query->{myhostname} if (lc $field eq 'r');
So now I knew it was myhostname that was messing up.
Grep resulted in:
284: $query->{myhostname} = Sys::Hostname::Long::hostname_long();
So, off to Sys::Hostname::Long to see how it gets the hostname. A quick debug flag later, and I had
Sys::Hostname::Long - Last Dispatch method = exec_hostname_fqdn
Ah hah. Checking that routine:
if ($< == 0) {
$tmp = `su nobody -c "hostname --fqdn"`;
} else {
$tmp = `hostname --fqdn`;
}
And therein lies the source of the error message. The 'nobody' account is disabled by default in CentOS 4.2, and my building the SPF module as root triggered the logic. Solution? Fix my build environment to build as a non-root user.
Comments
Leave a comment Trackback