2004-12-19 Dmitry V. Levin <ldv@altlinux.org>

* 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.
This commit is contained in:
Roland McGrath 2005-02-06 01:16:32 +00:00
parent a24aaae493
commit 15dca8e307
3 changed files with 7 additions and 39 deletions

1
defs.h
View File

@ -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));

View File

@ -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;

View File

@ -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;
}
}