patchThe GNU Bourne-Again SHell - Patches: patch #9789, Don't add non-executable files to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9789: Don't add non-executable files to hash table

Submitted by:  Michael Schuett <michaeljs1990>
Submitted on:  Sun 07 Apr 2019 05:12:59 AM UTC  
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Open

Mon 08 Apr 2019 02:28:56 PM UTC, comment #1: 

Awesome, Thanks for getting a variation of this added in the 5.1 release. I wasn't sure when we talked about this on the mailing list if you wanted the check for all entries in the has table or just ones when in posixly_correct mode. Thanks for the fix!

Michael Schuett <michaeljs1990>
Sun 07 Apr 2019 05:12:59 AM UTC, original submission:  

This patch fixes non-deterministic behavior for type and command in POSIX mode. I originally came across it when issuing the following set of commands.

user@gentoo ~/code/bash $ ./bash --posix
bash-5.0$ command -V useradd2
bash: command: useradd2: not found
bash-5.0$ type useradd2
bash: type: useradd2: not found
bash-5.0$ useradd2
bash: /usr/sbin/useradd2: Permission denied
bash-5.0$ command -V useradd2
useradd2 is hashed (/usr/sbin/useradd2)
bash-5.0$ type useradd2
useradd2 is hashed (/usr/sbin/useradd2)

Due to useradd2 being added into the hash table command and type would skip the checks to ensure the file was executable by the user. In stead of just fixing this when in POSIX mode we now always verify that the user can execute the command before adding it to the hash table.

Michael Schuett <michaeljs1990>

 

Attached Files
file #46731:  patch added by michaeljs1990 (842B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Updated the item)
  • -email is unavailable- added by michaeljs1990
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-07 chet StatusNone => Done
    2019-04-07 michaeljs1990 Attached File- => Added patch, #46731
        Carbon-Copy- => Added chet.ramey@case.edu

    Back to the top


    Powered by Savane 3.6