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

Submitter:  Michael Schuett <michaeljs1990>
Submitted:  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>

 

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

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
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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 -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code