Bug 2088845

Summary: ksh scripts result in segmentation faults when PATH contains "." and a sub-process runs in a directory containing .paths sub-directory
Product: Red Hat Enterprise Linux 7 Reporter: Shawn <sbrockme>
Component: kshAssignee: Vincent Mihalkovič <vmihalko>
Status: CLOSED MIGRATED QA Contact: Karel Volný <kvolny>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: lzaoral
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-06 16:58:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shawn 2022-05-21 00:32:34 UTC
1. Description of problem:

      Using ksh across multiple versions of RHEL, customer reports that ksh scripts result in a segmentation fault when "." is in the PATH variable and a sub-process (pwd, ls, etc.) runs in a directory with a .paths sub-directory.

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

      Multiple versions of ksh (I used 20120801-143.el7_9)

3. How reproducible:

      Always

4. Steps to Reproduce:

      4.1. $ export PATH=${PATH}:.

      4.2. $ vi crash.ksh

           #!/bin/ksh

           mkdir -p OK CRASH/.paths

           echo "OK case: " 1>&2
           ok=$(cd OK; pwd)
           echo "OK case: pwd=${ok}" 1>&2

           echo "crash case: " 1>&2
           crash=$(cd CRASH; pwd)
           echo "crash case: pwd=${crash}" 1>&2

      4.3. $ chmod u+x crash.ksh

      4.4. $ ./crash.ksh

5. Actual results:

      OK case: 
      OK case: pwd=/../OK
      crash case: 
      Segmentation fault

6. Expected results:

      OK case: 
      OK case: pwd=/../OK
      crash case: 
      crash case: pwd=/../CRASH

7. Additional info:

Customer reports that this occurs in multiple versions of RHEL, and therefore multiple versions of ksh. I performed a similar test in Fedora but did not encounter the reported problem.

Comment 4 RHEL Program Management 2023-10-06 16:48:05 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 5 RHEL Program Management 2023-10-06 16:58:07 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.