}
static void __attribute__((format(printf,1,2)))
-log(char *msg, ...)
+msg(char *msg, ...)
{
va_list args;
va_start(args, msg);
}
while (*p++);
- log("[%s] ", namebuf);
+ msg("[%s] ", namebuf);
if (file_access >= 3)
return;
if (!strchr(namebuf, '/') && strcmp(namebuf, ".."))
return allow_times;
case __NR_kill:
if (u->regs.ebx == box_pid)
- die("Commited suicide by signal %d", (int)u->regs.ecx);
+ die("Committed suicide by signal %d", (int)u->regs.ecx);
return 0;
case __NR_tgkill:
if (u->regs.ebx == box_pid && u->regs.ecx == box_pid)
- die("Commited suicide by signal %d", (int)u->regs.edx);
+ die("Committed suicide by signal %d", (int)u->regs.edx);
return 0;
default:
return 0;
die("ptrace(PTRACE_GETREGS): %m");
stop_count++;
if (!stop_count) /* Traceme request */
- log(">> Traceme request caught\n");
+ msg(">> Traceme request caught\n");
else if (stop_count & 1) /* Syscall entry */
{
- log(">> Syscall %3ld (%08lx,%08lx,%08lx) ", u.regs.orig_eax, u.regs.ebx, u.regs.ecx, u.regs.edx);
+ msg(">> Syscall %3ld (%08lx,%08lx,%08lx) ", u.regs.orig_eax, u.regs.ebx, u.regs.ecx, u.regs.edx);
syscall_count++;
if (!valid_syscall(&u))
{
}
}
else /* Syscall return */
- log("= %ld\n", u.regs.eax);
+ msg("= %ld\n", u.regs.eax);
ptrace(PTRACE_SYSCALL, box_pid, 0, 0);
}
else if (sig != SIGSTOP && sig != SIGXCPU && sig != SIGXFSZ)
{
- log(">> Signal %d\n", sig);
+ msg(">> Signal %d\n", sig);
ptrace(PTRACE_SYSCALL, box_pid, 0, sig);
}
else
{
struct rlimit rl;
char *args[argc+1];
- char *env[1] = { NULL };
+ char *env[] = { "LIBC_FATAL_STDERR_=1", NULL };
memcpy(args, argv, argc * sizeof(char *));
args[argc] = NULL;