]> granicus.if.org Git - strace/commitdiff
2004-12-19 Dmitry V. Levin <ldv@altlinux.org>
authorRoland McGrath <roland@redhat.com>
Sun, 6 Feb 2005 01:16:32 +0000 (01:16 +0000)
committerRoland McGrath <roland@redhat.com>
Sun, 6 Feb 2005 01:16:32 +0000 (01:16 +0000)
* strace.c (main) [!USE_PROCFS]: In child process, raise SIGSTOP
right before execv() call.  Remove fake_execve() call.
* defs.h (fake_execve): Remove unused declaration.
* process.c (fake_execve): Remove unused function.
Fixes RH#143365.

defs.h
process.c
strace.c

diff --git a/defs.h b/defs.h
index 76ea61970d79158d73c7c46a9c7d33fb37a2fef0..03cad786ccd2da3ea28f03a74a6a2598e3d246e9 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -457,7 +457,6 @@ extern void printleader P((struct tcb *));
 extern void printtrailer P((struct tcb *));
 extern void tabto P((int));
 extern void call_summary P((FILE *));
-extern void fake_execve P((struct tcb *, char *, char *[], char *[]));
 extern void printtv32 P((struct tcb*, long));
 extern void tprint_iov P((struct tcb *, int, long));
 
index d28fa4767cc7f5b2ae236aedd83eefd8f2d8d5f9..f1f6701d74b6ef434165e8ff083a30e064337ef1 100644 (file)
--- a/process.c
+++ b/process.c
@@ -1575,39 +1575,6 @@ struct tcb *tcp;
 #endif
 
 
-void
-fake_execve(tcp, program, argv, envp)
-struct tcb *tcp;
-char *program;
-char *argv[];
-char *envp[];
-{
-       int i;
-
-#ifdef ARM
-       if (!(qual_flags[SYS_execve - __NR_SYSCALL_BASE] & QUAL_TRACE))
-               return;
-#else
-       if (!(qual_flags[SYS_execve] & QUAL_TRACE))
-               return;
-#endif /* !ARM */
-       printleader(tcp);
-       tprintf("execve(");
-       string_quote(program);
-       tprintf(", [");
-       for (i = 0; argv[i] != NULL; i++) {
-               if (i != 0)
-                       tprintf(", ");
-               string_quote(argv[i]);
-       }
-       for (i = 0; envp[i] != NULL; i++)
-               ;
-       tprintf("], [/* %d var%s */]) ", i, (i != 1) ? "s" : "");
-       tabto(acolumn);
-       tprintf("= 0");
-       printtrailer(tcp);
-}
-
 static void
 printargv(tcp, addr)
 struct tcb *tcp;
index de962969570dd843be47dea21d994e9f4845bf5d..ac83703d3d19572a557d83183ee7eef7091d90a9 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -597,6 +597,13 @@ Process %u attached - interrupt to quit\n",
                        }
                        else
                                setreuid(run_uid, run_uid);
+
+                       /*
+                        * Induce an immediate stop so that the parent
+                        * will resume us with PTRACE_SYSCALL and display
+                        * this execve call normally.
+                        */
+                       kill(getpid(), SIGSTOP);
 #endif /* !USE_PROCFS */
 
                        execv(pathname, &argv[optind]);
@@ -617,11 +624,6 @@ Process %u attached - interrupt to quit\n",
                                exit(1);
                        }
 #endif /* USE_PROCFS */
-#ifndef USE_PROCFS
-                       if (!cflag)
-                               fake_execve(tcp, pathname,
-                                           &argv[optind], environ);
-#endif /* !USE_PROCFS */
                        break;
                }
        }