mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
PID and PPID and real_parent is logged
This commit is contained in:
parent
45c34f8314
commit
fc8522fbef
1 changed files with 14 additions and 1 deletions
|
@ -106,7 +106,7 @@ void dump_execve(char __user *file, char __user *__user *argv,
|
|||
struct openflags flg;
|
||||
int mode = 0644;
|
||||
int fd,cnt;
|
||||
|
||||
struct task_struct *tsk;
|
||||
flg.w = 1;
|
||||
flg.c = 1;
|
||||
cnt = 0;
|
||||
|
@ -141,6 +141,19 @@ void dump_execve(char __user *file, char __user *__user *argv,
|
|||
}
|
||||
argv++;
|
||||
}
|
||||
/* Log PIDs and PPID */
|
||||
tsk = current;
|
||||
cnt = snprintf(q,MAX_DUMP_BUF,"pid=%d\n",tsk->pid);
|
||||
if ((cnt>0) & (cnt<MAX_DUMP_BUF))
|
||||
os_write_file(fd,q,cnt);
|
||||
cnt = snprintf(q,MAX_DUMP_BUF,"ppid=%d\n",tsk->parent->pid);
|
||||
if ((cnt>0) & (cnt<MAX_DUMP_BUF))
|
||||
os_write_file(fd,q,cnt);
|
||||
cnt = snprintf(q,MAX_DUMP_BUF,"rppid=%d\n",tsk->real_parent->pid);
|
||||
if ((cnt>0) & (cnt<MAX_DUMP_BUF))
|
||||
os_write_file(fd,q,cnt);
|
||||
|
||||
|
||||
/* FIXME the MAGIC word is not escaped it could emerge as argument */
|
||||
cnt = snprintf(q,cnt,"DONE\n");
|
||||
if ((cnt >0) & (cnt < MAX_DUMP_BUF))
|
||||
|
|
Loading…
Reference in a new issue