]> granicus.if.org Git - sudo/commitdiff
now only execs files with (an) executable bit set.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 16 Feb 1993 03:27:57 +0000 (03:27 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 16 Feb 1993 03:27:57 +0000 (03:27 +0000)
find_path.c

index e1656c0c457a69d7129ed660d0d85f343ce61dc2..af00a5f64e632de1d0712a5222f298a53ee3e757 100644 (file)
@@ -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 );