]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Improve the checks in PRE(execve) to check that the file being executed
authorTom Hughes <tom@compton.nu>
Sat, 25 Sep 2004 16:13:55 +0000 (16:13 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 25 Sep 2004 16:13:55 +0000 (16:13 +0000)
is a regular file and fail with EINVAL if it is not.

This problem was highlight by bug 89481 although this doesn't solve the
actual problem reported in that bug.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2723

coregrind/vg_syscalls.c

index 60e13e415e8aa4780d1e2deeb570e1b03104127c..7f4153d8439dc489ae0ab9c895f6fc041eb8b8fb 100644 (file)
@@ -1764,10 +1764,10 @@ PRE(execve)
         res = ret;
         return;
       }
-      /* just look for any X bit set
+      /* just look for regular file with any X bit set
         XXX do proper permissions check?
        */
-      if ((st.st_mode & 0111) == 0) {
+      if ((st.st_mode & 0100111) == 0100000) {
         res = -VKI_EACCES;
         return;
       }