-
Bug
-
Resolution: Done-Errata
-
Normal
-
rhel-9.3.0
-
None
-
make-4.3-8.el9
-
Yes
-
Moderate
-
Regression
-
rhel-sst-pt-libraries
-
ssg_platform_tools
-
23
-
24
-
1
-
False
-
-
Yes
-
Red Hat Enterprise Linux
-
None
-
Bug Fix
-
-
Done
-
-
All
-
None
What were you trying to do that didn't work?
When PATH is set in make to execute local binaries (PATH=.:/usr/bin:...) and a install directory exists in current directory, make tries to execute the directory instead of install, which usually resides in /usr/bin:
$ cat Makefile export PATH := .:$(PATH) .PHONY: all all: echo $(PATH) install --help $ make all echo .:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin .:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin install --help make: install: Permission denied make: *** [Makefile:5: all] Error 127
The root cause for this is child_execute_job() function, which was very simplistic on RHEL8, is now calling find_in_given_path() (guile project) to resolve the binary, but find_in_given_path() itself is buggy, since it considers every inode having eXecution access, not only files or symlinks resolving as files (line 211):
74 const char * 75 find_in_given_path (const char *progname, const char *path, 76 bool optimize_for_exec) 77 { : 207 /* On systems which have the eaccess() system call, let's 208 use it. On other systems, let's hope that this program 209 is not installed setuid or setgid, so that it is ok to 210 call access() despite its design flaw. */ 211 if (eaccess (progpathname, X_OK) == 0) 212 { 213 /* Found! */ 214 if (strcmp (progpathname, progname) == 0) 215 { : 228 } : 230 free (path_copy); 231 return progpathname; 232 } :
This breaks customers projects, since customers then have to modify all occurrences of install into /usr/bin/install to avoid the issue.
Please provide the package NVR for which bug is seen:
make-4.3-7.el9
How reproducible:
Always
Steps to reproduce
- Create a dummy Makefile
$ cat Makefile export PATH := .:$(PATH) .PHONY: all all: echo $(PATH) install --help
- Create a install directory in current directory
$ mkdir install
- Execute make all
Expected results
/usr/bin/install usage displayed
Actual results
Permission denied message
- links to
-
RHBA-2024:127395 make update
- mentioned on