Bug 1033018 - syntax error in /etc/profile.d/perl-homedir.csh (perl-local-lib/perl-homedir)
syntax error in /etc/profile.d/perl-homedir.csh (perl-local-lib/perl-homedir)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: perl-local-lib (Show other bugs)
rawhide
All All
high Severity low
: ---
: ---
Assigned To: Petr Pisar
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-21 07:29 EST by Petr Pisar
Modified: 2014-07-02 09:45 EDT (History)
7 users (show)

See Also:
Fixed In Version: perl-local-lib-1.008010-4.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1032195
Environment:
Last Closed: 2014-07-02 09:45:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix (1.52 KB, patch)
2013-11-21 08:05 EST, Petr Pisar
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
CPAN 85667 None None None Never

  None (edit)
Description Petr Pisar 2013-11-21 07:29:51 EST
+++ This bug was initially created as a clone of Bug #1032195 +++

Syntax error in /etc/profile.d/perl-homedir.csh
  
---Steps to Reproduce---
* Install perl-homedir
* Create a user with csh as login shell
* login with that user
 

The file /etc/profile.d/perl-homedir.csh, contained in perl-homedir,
contains a syntax error.
The command "eval `perl -Mlocal::lib`" fails with "Bad : modifier in $ (/).".
The processing of any login scripts stops at that error, resulting in an incomplete environment for the user.

Fyi ...
.... looks like this is caused by missing {}:

 ls3814:db2lin 8> perl -Mlocal::lib
setenv PERL_LOCAL_LIB_ROOT "$PERL_LOCAL_LIB_ROOT:/db2/db2lin/perl5";
setenv PERL_MB_OPT "--install_base /db2/db2lin/perl5";
setenv PERL_MM_OPT "INSTALL_BASE=/db2/db2lin/perl5";
setenv PERL5LIB "/db2/db2lin/perl5/lib/perl5:$PERL5LIB";
setenv PATH "/db2/db2lin/perl5/bin:$PATH";

 ls3814:db2lin 9> setenv PERL_LOCAL_LIB_ROOT "$PERL_LOCAL_LIB_ROOT:/db2/db2lin/perl5";
Bad : modifier in $ (/).

 ls3814:db2lin 10> setenv PERL_LOCAL_LIB_ROOT "${PERL_LOCAL_LIB_ROOT}:/db2/db2lin/perl5" ; 
# no error

[...]
--- Additional comment from Petr Pisar on 2013-11-20 14:22:15 GMT ---

Thank your for this bug report and a suggestion how to fix. Unfortunately, this is not enough.

If PERL_LOCAL_LIB_ROOT is not set, then tcsh will bail out with undefined variable and the variable will not get set:


[test@rhel-7-0 ~]$ echo ${?PERL_LOCAL_LIB_ROOT}
0
[test@rhel-7-0 ~]$ setenv PERL_LOCAL_LIB_ROOT "${PERL_LOCAL_LIB_ROOT}:/home/test/perl5" ;
PERL_LOCAL_LIB_ROOT: Undefined variable.
[test@rhel-7-0 ~]$ echo $?
1
[test@rhel-7-0 ~]$ echo ${?PERL_LOCAL_LIB_ROOT}                                 0

This is a know issue to the upstream <https://rt.cpan.org/Public/Bug/Display.html?id=85667> with no ratified solution yet.

--- Additional comment from Petr Pisar on 2013-11-21 10:50:37 GMT ---

Due to CSH limits on subcommand substitution and parsing if-then-else statemens, appending to a variable FOO can be achieved this way:

test 1 == ${?FOO} && setenv FOO "a:${FOO}" || setenv FOO "a";

----

All Fedoras are affected.
Comment 1 Petr Pisar 2013-11-21 08:05:44 EST
Created attachment 827174 [details]
Fix

This patch with these changes:

--- a/perl-homedir.csh
+++ b/perl-homedir.csh
@@ -11,10 +11,10 @@ if (-f "$HOME/.perl-homedir") then
        source "$HOME/.perl-homedir"
 endif
 
-alias perlll 'eval `perl -Mlocal::lib`'
+alias perlll 'eval "`perl -Mlocal::lib`"'
 
 # if system default
 if ("x$PERL_HOMEDIR" == "x1") then
-       eval `perl -Mlocal::lib`
+       eval "`perl -Mlocal::lib`"
 endif
 

fix this issue. However the patch is not suitable for upstream, as upstream is going to rewrite the code.
Comment 2 Fedora Update System 2013-11-21 08:38:37 EST
perl-local-lib-1.008010-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/perl-local-lib-1.008010-4.fc20
Comment 3 Fedora Update System 2013-11-21 08:40:26 EST
perl-local-lib-1.008010-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/perl-local-lib-1.008010-2.fc19
Comment 4 Fedora Update System 2013-11-21 08:40:50 EST
perl-local-lib-1.008010-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/perl-local-lib-1.008010-2.fc18
Comment 5 lnie 2013-11-22 02:28:27 EST
perl-local-lib-1.008010-4.fc20 works fine
Comment 6 Fedora Update System 2013-12-03 05:34:54 EST
perl-local-lib-1.008010-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Fedora Update System 2013-12-03 05:35:55 EST
perl-local-lib-1.008010-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2013-12-13 21:58:55 EST
perl-local-lib-1.008010-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.