helpThe GNU Bourne-Again SHell - Support: sr #107770, No clear indication of error if...

 
 

sr #107770: No clear indication of error if .bash_history exists but not accessible

Submitted by:  Michael V. Antosha <mivael>
Submitted on:  Tue 09 Aug 2011 03:27:30 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 2 - MinorStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 09 Aug 2011 03:27:30 PM UTC, original submission:

If .bash_history exists but not accessible, bash behaves exactly the same way as if there were no .bash_history (beeps when trying to call the previous command from history). Moreover, after bash exits, no history will be saved with no indication of error.

Steps to reproduce (start as root, user1 exists in the system):
1. cd /home/user1/
echo 'ls -la' >> .bash_history # if not exists
chown root:root .bash_history
chmod a=,u+rw .bash_history
2. sudo -u user1 bash
3. Try to call previous command from history (press UP-ARROW). No previous command available (beep), no error messages.
4. echo test1234 # for history
5. exit # return from sudo
6. tail .bash_history # 'echo test1234' not saved in history
7. chown user1 .bash_history
8. Repeat steps 2-6, note the difference in steps 3 and 6.

Use case example:
I encountered this error after fresh install of a GNU/Linux (Trisquel Slaine) because the first command I run from terminal was 'sudo bash'. This way .bash_history with root as owner was created in my home directory.

Michael V. Antosha <mivael>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mivael (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup