| Summary: | [PATCH] perl5 Sys::Hostname fails if no PATH set | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Phil Homewood <philh> | ||||
| Component: | bin | Assignee: | Mark Murray <markm> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 3.3-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->markm Mark's the perl5 maintainer. On Fri, 24 Dec 1999 12:44:02 +1000, Phil Homewood wrote:
> perl5's Sys::Hostname.pm fails to get local host name if called
> with undefined $ENV{'PATH'}. This bug was introduced in r1.2 of
> src/contrib/perl5/lib/Hostname.pm with the taint fixes for
> backticked commands.
I can't help thinking that the real fix for the problem is to get
SYS_gethostname into syscall.ph .
However, given what r1.2 of the file looks like, your fix is an obvious
must-do unless we're going to try to make method 2 (syscall) work.
Ciao,
Sheldon.
Reports on -stable indicate this problem has broken the SpamAssassin port, and the patch herein fixes it. Three years is a long time. Could someone please commit this to -STABLE? -- Phil Homewood, Systems Janitor, www.SnapGear.com pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630 SnapGear - Custom Embedded Solutions and Security Appliances I can confirm that this bug still exists in 4.8-STABLE as of 21 April 2003, and the above patch still fixes it. The bug prevents one from running spamassassin from /etc/aliases. It sure would be nice if somebody would commit this.. M. Dickerson State Changed From-To: open->closed Base-perl is deprecated. This works in the port version. |
perl5's Sys::Hostname.pm fails to get local host name if called with undefined $ENV{'PATH'}. This bug was introduced in r1.2 of src/contrib/perl5/lib/Hostname.pm with the taint fixes for backticked commands. The value returned by each eval{} block is in fact $ENV{'PATH'} instead of the (defined or undefined nature of) $host. Thus, the block that calls `hostname` will return true IFF the path is set. If it isn't, the `uname` block fails in the same way and the function croaks. How-To-Repeat: Run a script that calls Sys::Hostname::hostname() with an undefined PATH. Watch it croak.