Bug 64103

Summary: .bash_history and sudo
Product: [Retired] Red Hat Linux Reporter: Florin Andrei <florin>
Component: bashAssignee: wdovlrrw <brosenkr>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-01 11:31:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Florin Andrei 2002-04-25 17:44:41 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020326

Description of problem:
If i login as a regular user, the file .bash_history is created just fine, with
right ownership and permissions, etc.
But as soon as i "sudo bash", then .bash_history is created with root ownership.
If i exit back to the regular user, i don't have permissions to write to the
file anymore.
Bash should create .bash_history with the original user's ownership, no matter
if i sudo or not.

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

How reproducible:

Steps to Reproduce:
1. sudo bash
2. execute a few commands
3. exit back to regular user

Actual Results:  .bash_history has root:root ownership and is not readable as
regular user

Expected Results:  .bash_history should retain the ownership of the actual user
that's running the shell, no matter if bash is run via sudo or not

Additional info:

Comment 1 Bernhard Rosenkraenzer 2002-08-01 11:31:08 UTC
Not reproducable in the current release. 
[bero@zell bero]$ ls -l .bash_history 
-rw-------    1 bero     bero         6823 Aug  1 13:28 .bash_history 
[bero@zell bero]$ sudo bash 
[root@zell bero]# echo test 
[root@zell bero]# exit 
[bero@zell bero]$ ls -l .bash_history 
-rw-------    1 bero     bero         6838 Aug  1 13:30 .bash_history 
[bero@zell bero]$