From: Todd C. Miller Date: Tue, 16 Feb 1993 03:27:57 +0000 (+0000) Subject: now only execs files with (an) executable bit set. X-Git-Tag: SUDO_1_3_0~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96a16b6264d956bae4e2c5292e5906a48850f17c;p=sudo now only execs files with (an) executable bit set. --- diff --git a/find_path.c b/find_path.c index e1656c0c4..af00a5f64 100644 --- a/find_path.c +++ b/find_path.c @@ -171,8 +171,8 @@ return ( do_stat ( s, buf ) ); * do_stat() * * This function takes a path and a file and stat()s the file - * If the file exists, the full path to that file is returned - * otherwise NULL is returned + * If the file exists and is executable, the full path to that + * file is returned otherwise NULL is returned. */ static char *do_stat( path, file ) @@ -230,7 +230,7 @@ bzero ( buf, MAXPATHLEN+1 ); if ( path ) strcat ( buf, path ); if ( *file != '/' && path [strlen(path)-1] != '/' ) strcat ( buf, "/" ); strcat ( buf, file ); -if ( ! stat ( buf, &s ) ) +if ( ! stat ( buf, &s ) && (s.st_mode & 0000111) >= 0000001 ) return ( check_link ( buf ) ); else return ( NULL );