bugmake - Bugs: bug #60281, Directory in directory in $PATH...

 
 

bug #60281: Directory in directory in $PATH shadows binaries in $PATH

Submitter:  None
Submitted:  Tue 23 Mar 2021 09:50:35 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.3 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 23 Mar 2021 10:23:28 PM UTC, comment #1: 
Dmitry Goncharov <dgoncharov>
Tue 23 Mar 2021 09:50:35 PM UTC, original submission:  

What's happening


If you have a directory in a directory specified in the PATH environment variable which shares a name with a command you want to run, that directory will shadow the actual binary and you will get a permission denied error.

Example setup:

# prepend /home/user/bin to path
export PATH=/home/user/bin:/usr/bin
# create directory /home/user/bin/cat
mkdir /home/user/bin/cat
# create our testfile for cat
touch ./temp.txt


In Makefile

.PHONY: myrule
myrule:
        cat temp.txt


Make now attempts to exec the directory /home/user/bin/cat instead of /usr/bin/cat:

user@host:~$ make
cat temp.txt
make: cat: Permission denied
make: *** [Makefile:2: myrule] Error 127



What should be happening


Make should exec /usr/bin/cat

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Updated the item)
  • -email is unavailable- added by dgoncharov (Posted a comment)
  • -email is unavailable- added by btkennedy
  •  

    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.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-09-07 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
    2021-03-23 btkennedy Carbon-Copy- Added btkennedy

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code