Bug 1186698 - /etc/profile.d/perl-homedir.csh contains bourne shell "if" code. Makes tcsh prompt "if: Expression Syntax."
Summary: /etc/profile.d/perl-homedir.csh contains bourne shell "if" code. Makes tcsh p...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: perl-local-lib
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jitka Plesnikova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-28 10:37 UTC by Eskil Brun
Modified: 2020-11-30 15:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-30 15:55:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Rawhide perl-homedir.csh (571 bytes, text/plain)
2015-02-04 16:15 UTC, Petr Šabata
no flags Details

Description Eskil Brun 2015-01-28 10:37:16 UTC
Description of problem:

/etc/profile.d/perl-homedir.csh contains bourne shell "if" code. Makes tcsh prompt "if: Expression Syntax."

/etc/profile.d/perl-homedir.csh is in the perl-homedir RPM package.

Version-Release number of selected component (if applicable):

perl-homedir-1.006007-3.el6.noarch

How reproducible:

Every time.

Steps to Reproduce:
1. install tcsh and perl-local-lib and perl-homedir.
2. invoke tcsh

Actual results:

$ tcsh
if: Expression Syntax.


Expected results:

$ tcsh
$

Additional info:

Offending bourne shell (bash) code in /etc/profile.d/perl-homedir.csh :
----
# if system default
if [ "x$PERL_HOMEDIR" = "x1" ] ; then

    eval `perl -Mlocal::lib`
fi
----

Suggested solution: 

Either remove the /etc/profile.d/perl-homedir.csh or put proper csh code in the file.

Comment 1 Petr Šabata 2015-02-04 16:15:09 UTC
Created attachment 988167 [details]
Rawhide perl-homedir.csh

Comment 2 Petr Šabata 2015-02-04 16:15:43 UTC
Does the attached version, taken from the rawhide branch, of perl-homedir.csh work for you?

Comment 3 Petr Šabata 2015-05-14 10:48:18 UTC
Ping.

Comment 4 Eskil Brun 2015-06-01 12:24:27 UTC
(In reply to Petr Šabata from comment #2)
> Does the attached version, taken from the rawhide branch, of
> perl-homedir.csh work for you?

No. The script has obviously never been tested with csh. It now gives off this error message:

  setenv: Too many arguments.

And the script fails to perform its tasks.

The trouble lies in the assumption that newlines will be preserved when the backquoted command is enclosed in double quotes. in bourne shell variants this works. Not so with csh. I do not know how to preserve newlines from a backquoted command in csh.

However, one can use tr to replace newlines with semicolons. Below is a modified version of the script that does this:

#################################################################

# invoke local::lib

# default -- invoke local::lib for all users
setenv PERL_HOMEDIR 1

# load our configs, aka opportunities to set PERL_HOMEDIR=0
if (-f /etc/sysconfig/perl-homedir) then
	eval `sed -ne 's|^[[:blank:]]*\([^#=]\{1,\}\)=\([^=]*\)|setenv \1 \2;|p' /etc/sysconfig/perl-homedir`
endif
if (-f "$HOME/.perl-homedir") then
	eval `sed -ne 's|^[[:blank:]]*\([^#=]\{1,\}\)=\([^=]*\)|setenv \1 \2;|p' "$HOME/.perl-homedir"`
endif

alias perlll 'eval "`perl -Mlocal::lib|tr \\n \;`"'

# if system default
if ("x$PERL_HOMEDIR" == "x1") then
	eval "`perl -Mlocal::libtr \\n \;`"
endif

##################################################################

Really, I think the perl-homedir maintainers should just stop pretending to support csh and remove the /etc/profile.d/perl-homedir.csh from the package if they can not be bothered to test their script. Obviously they know diddly squat about csh and are not able to support csh properly. As of now, all they have done is provide extra error messages for all csh users on systems that use the perl-homedir package.

Comment 5 Ben Cotton 2020-11-05 16:51:50 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is our policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged  change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.

Comment 6 Ben Cotton 2020-11-05 16:54:31 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version, you are encouraged to change the 'version' to a later version prior this bug is closed as described in the policy above.

Comment 7 Ben Cotton 2020-11-30 15:55:30 UTC
EPEL el6 changed to end-of-life (EOL) status on 2020-11-30. EPEL el6 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
EPEL please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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