|
From: | anonymous |
Subject: | [bug #60281] Directory in directory in $PATH shadows binaries in $PATH |
Date: | Tue, 23 Mar 2021 17:50:37 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 |
URL: <https://savannah.gnu.org/bugs/?60281> Summary: Directory in directory in $PATH shadows binaries in $PATH Project: make Submitted by: None Submitted on: Tue 23 Mar 2021 09:50:35 PM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 4.3 Operating System: POSIX-Based Fixed Release: None Triage Status: None _______________________________________________________ Details: = 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 _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?60281> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |