Bug 57302

Summary: A serious FreeBSD-local patch lacks in ports/japanese/perl5
Product: Ports & Packages Reporter: IIJIMA Hiromitsu <delmonta>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description IIJIMA Hiromitsu 2003-09-28 10:20:23 UTC
When perl looks for the modules requested from the script, ports/japanese/perl5
looks standard modules and then site_perl folders, while other perl packages
such as the base system's one (4.7 or later), ports/lang/perl5 (perl 5.6),
ports/lang/perl5.8 looks site_perl first and then standard modules.

This causes a problem on a 4.x system with ports/japanese/perl5 installed.
If you have installed an update of a standard module from either CPAN or
Ports, then /usr/bin/perl [see NOTE] uses the updated module, whereas
/usr/local/bin/perl [see NOTE] still uses an old one from Ports.

[NOTE]
/usr/bin/perl derives from the FreeBSD base system and its version is 5.005_03.

/usr/local/bin/perl is a symlink to a 5.005_03 with Japanese patch, but when
invoked as 'perl' (not 'jperl') it behaves like no-patch standard perl
as far as possible.

Although ports/japanese/perl5's behaviour is the standard implementation of
original perl (and on other systems, such as Linux or MS Windows, perl behaves
just the same), all other three of the above has FreeBSD-local patches to make
them look for site_perl first.

The patch is at, for example, ports/lang/perl5/files/patch-perl.c.

More information (in Japanese) and the patch for perl 5.005_03
(used for the base system's one) is also avalable at:
http://home.jp.FreeBSD.ORG/cgi-bin/showmail/FreeBSD-users-jp/73502

Fix: 

Apply the same patch as used to base system's one:
http://home.jp.FreeBSD.ORG/cgi-bin/showmail/FreeBSD-users-jp/73502

[NOTE] I will send another PR for CGI.pm security problems affecting all
       perl distributions.
How-To-Repeat: First of all, we can check the difference by the following commands:

*** INVOKING STANDARD PERL ***
% /usr/bin/perl -MNoSuchModule
Can't locate NoSuchModule.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 . /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503).
BEGIN failed--compilation aborted.

*** INVOKING ports/japanese/perl5 ONE ***
% /usr/local/bin/perl -MNoSuchModule
Can't locate NoSuchModule.pm in @INC (@INC contains: /usr/local/lib/perl5/5.00503/i386-freebsd /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 .).
BEGIN failed--compilation aborted.

Then, install an update of a standard module, such as CGI.pm, from CPAN
or Ports, then try to use it.
/usr/bin/perl successfully uses the updated module, but /usr/local/bin/perl
will use the old one in perl distribution.
Comment 1 IIJIMA Hiromitsu 2003-09-28 13:21:27 UTC
> /usr/local/bin/perl [see NOTE] still uses an old one from Ports.
  /usr/local/bin/perl [see NOTE] still uses an old one from the perl port.
Comment 2 shige freebsd_committer freebsd_triage 2003-10-01 14:44:13 UTC
State Changed
From-To: open->closed

Committed. Thanks!