Projects
Factory:RISC-V:Base
make
_service:extract_file:fix-57962.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:extract_file:fix-57962.patch of Package make
References: https://savannah.gnu.org/bugs/index.php?57962 Date: Fri Mar 25 07:33:36 PM CST 2022 --- diff --git a/lib/findprog-in.c b/lib/findprog-in.c index c254f2f..d89ec00 100644 --- a/lib/findprog-in.c +++ b/lib/findprog-in.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <sys/stat.h> #include "filename.h" #include "concat-filename.h" @@ -190,6 +191,7 @@ find_in_given_path (const char *progname, const char *path, dir = "."; /* Try all platform-dependent suffixes. */ + struct stat st; for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++) { const char *suffix = suffixes[i]; @@ -208,7 +210,8 @@ find_in_given_path (const char *progname, const char *path, use it. On other systems, let's hope that this program is not installed setuid or setgid, so that it is ok to call access() despite its design flaw. */ - if (eaccess (progpathname, X_OK) == 0) + if (eaccess (progpathname, X_OK) == 0 && + stat(progpathname, &st) == 0 && S_ISREG(st.st_mode)) { /* Found! */ if (strcmp (progpathname, progname) == 0)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2