Bug 151116 - unset PWD causes bash to exit
Summary: unset PWD causes bash to exit
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: bash   
(Show other bugs)
Version: 3
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-14 23:20 UTC by P Fudd
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 3.0-30
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-15 14:26:46 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description P Fudd 2005-03-14 23:20:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
I was trying to recreate an error in a crontab entry, and to do that I
had to unset a lot of environment variables.

When I unset PWD, bash quit.

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

How reproducible:
Always

Steps to Reproduce:
1. su - root
2. unset PWD
3. there is no step 3
    

Actual Results:  You're back at the prompt you had before you called su.

Expected Results:  It should have just ignored my request to unset
that variable, or it should have unset that variable and kept on working.

Additional info:

Fedora Core 3, beefy computer.

Comment 1 P Fudd 2005-03-14 23:33:47 UTC
Not reproducible on FC2, bash-2.05b-38

You can unset everything with this:

   unset `env | gawk -F= '{print $1}'`

If bash doesn't quit, then the bug is not present.

"The Great Hyperbolic Omni-Cognate Neutron Wrangler,' said Deep
Thought, thoroughly rolling the r's, 'could talk all four legs off an
Arcturan Mega-Donkey -- but only I could persuade it to go for a walk
afterward."
  -- HHGTTG

Comment 2 Tim Waugh 2005-03-15 13:03:55 UTC
This was fixed in rawhide since bash-3.0-27, and will be in Fedora Core 4.


Comment 3 Tim Waugh 2005-03-15 14:26:31 UTC
Oh, hang on, I do see this on one machine with 3.0-29, but not on another.

It turned out to be due to a bug in the PS1 handling when PWD is not set.  As a
work-around, don't use \W in PS1.

Fixed package is 3.0-30.


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