Bug 151116 - unset PWD causes bash to exit
unset PWD causes bash to exit
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-14 18:20 EST by P Fudd
Modified: 2007-11-30 17:11 EST (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description P Fudd 2005-03-14 18:20:14 EST
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 18:33:47 EST
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 08:03:55 EST
This was fixed in rawhide since bash-3.0-27, and will be in Fedora Core 4.
Comment 3 Tim Waugh 2005-03-15 09:26:31 EST
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.