Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1122993 - perl-homedir.csh causes login error with CSH if PERL_HOMEDIR=0 is set
perl-homedir.csh causes login error with CSH if PERL_HOMEDIR=0 is set
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: perl-local-lib (Show other bugs)
7.0
All Linux
medium Severity medium
: rc
: 7.1
Assigned To: perl-maint-list
Martin Kyral
Lenka Špačková
: FastFix, Patch, Triaged
Depends On:
Blocks: 1018952 1298243 1289025 1305230 1380363
  Show dependency treegraph
 
Reported: 2014-07-24 10:32 EDT by Thomas Buchner
Modified: 2017-08-01 14:14 EDT (History)
13 users (show)

See Also:
Fixed In Version: perl-local-lib-1.008010-4.el7
Doc Type: Release Note
Doc Text:
The *perl-homedir* profile scripts now support *csh* Previously, the *perl-homedir* profile scripts were unable to handle the *C shell* (csh) syntax. Consequently, when the the _perl-homedir_ package was installed and the `/etc/sysconfig/perl-homedir` file contained the `PERL_HOMEDIR=0` line, executing the profile scripts resulted in the following error: PERL_HOMEDIR=0: Command not found. This update adds support for the *csh* syntax, and the described problem no longer occurs.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 14:14:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Potential patch for /etc/profile.d/perl-homedir.csh (656 bytes, text/plain)
2014-07-24 10:32 EDT, Thomas Buchner
no flags Details
Fix (2.09 KB, patch)
2014-07-25 03:25 EDT, Petr Pisar
no flags Details | Diff
Fix (2.09 KB, patch)
2014-07-28 04:31 EDT, Petr Pisar
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1921 normal SHIPPED_LIVE perl-local-lib bug fix update 2017-08-01 14:06:28 EDT

  None (edit)
Description Thomas Buchner 2014-07-24 10:32:11 EDT
Created attachment 920563 [details]
Potential patch for /etc/profile.d/perl-homedir.csh

Description of problem: 
If the file /etc/sysconfig/perl-homedir contains the line PERL_HOMEDIR=0, users with CSH as login shell will an error during login: "PERL_HOMEDIR=0: Command not found." and the directory gets created anyways.


Version-Release number of selected component (if applicable):
perl-homedir-1.008010-3.el7.noarch


How reproducible:
always


Steps to Reproduce:
1. Put the line PERL_HOMEDIR=0 into /etc/sysconfig/perl-homedir
2. useradd -s /bin/csh test
3. su - test


Actual results:
PERL_HOMEDIR=0: Command not found.
Attempting to create directory /home/emroot/perl5
[test@host]$

Expected results:
No error message and the directory ~/perl5 will not get created.


Additional info:
The file /etc/sysconfig/perl-homedir is in BASH syntax and works perfectly for users with BASH as login shell. The CSH script /etc/profile.d/perl-homedir.csh simply sources the file and thus runs into an error due to syntax mismatch. An eval line is needed instead of a simple source (patch for working solution attached).
Comment 2 Petr Pisar 2014-07-25 03:08:49 EDT
Indeed. The configuration files have to be parsed to be useful for csh profile script. Thank you for the report and the patch.
Comment 3 Petr Pisar 2014-07-25 03:25:58 EDT
Created attachment 920863 [details]
Fix
Comment 4 Petr Pisar 2014-07-25 03:34:49 EDT
How to test:

(1) Install perl-homedir and tcsh packages.
(2) Create /etc/sysconfig/perl-homedir with "PERL_HOMEDIR=0" content and run a tcsh as log-in shell:
Before:
  "PERL_HOMEDIR=0: Command not found." error message is printed and the
  PERL_HOMEDIR variable is set to 1 in the shell.
After:
  No error message is printed and the PERL_HOMEDIR variable is set to 0.
(3) Remove the /etc/sysconfig/perl-homedir, create ~/.perl-homedir with "PERL_HOMEDIR=0" content and run a tcsh as log-in shell. The results should be the same as in (2).
Comment 5 Petr Pisar 2014-07-25 03:51:35 EDT
Thomas, could you please report this issue to the Red Hat support. Doing so increases chance that this fix will be approved as it will be recognized as a customer-facing problem.
Comment 6 Petr Pisar 2014-07-28 04:31:08 EDT
Created attachment 921723 [details]
Fix

This sed(1) resides in /bin/sed, not in /usr/bin/sed. The wrong path would break dependency solver.
Comment 20 errata-xmlrpc 2017-08-01 14:14:01 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1921

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