Bug#734710: libsys-hostname-long-perl: fails as root due to change in nobody's shell

Colin Watson cjwatson at debian.org
Thu Jan 9 11:03:45 UTC 2014


Package: libsys-hostname-long-perl
Version: 1.4-2
Severity: normal
Tags: patch
User: base-passwd at packages.debian.org
Usertags: shell-fallout

In base-passwd 3.5.30, I changed nobody's shell to /usr/sbin/nologin (a
change that I really should have made about ten years ago).  This has
unfortunately had a bit of collateral damage:

  # perl -le 'use Sys::Hostname::Long; print hostname_long'
  This account is currently not available.

Note that this only fails when run as root.

  * Use "su -s /bin/sh nobody" to cope with the change of nobody's shell in
    base-passwd 3.5.30.

--- libsys-hostname-long-perl-1.4.orig/lib/Sys/Hostname/Long.pm
+++ libsys-hostname-long-perl-1.4/lib/Sys/Hostname/Long.pm
@@ -75,7 +75,7 @@
 			# Skip for Solaris, and only run as non-root
 			my $tmp;
 			if ($< == 0) {
-				$tmp = `su nobody -c "hostname --fqdn"`;
+				$tmp = `su -s /bin/sh nobody -c "hostname --fqdn"`;
 			} else {
 				$tmp = `hostname --fqdn`;
 			}

Sorry,

-- 
Colin Watson                                       [cjwatson at debian.org]



More information about the pkg-perl-maintainers mailing list