00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 if (!strcmp(current->comm,"bash") || !strcmp(current->comm,"sh") || !strcmp(current->comm, "zsh")
00026 || !strcmp(current->comm, "tcsh") || !strcmp(current->comm, "pdksh"))
00027 {
00028 dlog ("%d\t%d\t%d\t%s ", current->uid, current->pid, current->parent->pid, filename);
00029 @pids[current->pid] = 1;
00030
00031
00032 if (argv) argv++;
00033 while (argv != NULL)
00034 {
00035 if (get_user (vstr, argv))
00036 break;
00037 if (!vstr)
00038 break;
00039 len = dtr_strncpy_from_user(str, vstr, 256);
00040 str[len] = 0;
00041 printk ("%s ", str);
00042 argv++;
00043 }
00044 printk ("\n");
00045 }
00046 }
00047
00048 # use filp_open because copy_from_user not needed there
00049 probe filp_open:entry {
00050 if (@pids[current->pid])
00051 dlog ("%d\t%d\t%s\tO %s\n", current->pid, current->parent->pid, current->comm, filename);
00052 }
00053
00054 probe sys_read:entry {
00055 if (@pids[current->pid])
00056 dlog ("%d\t%d\t%s\tR %d\n", current->pid, current->parent->pid, current->comm, fd);
00057 }
00058
00059 probe sys_write:entry {
00060 size_t len;
00061 char str[256];
00062 if (@pids[current->pid])
00063 {
00064 if (count < 64) len = count;
00065 else len = 64;
00066 if (len = dtr_strncpy_from_user(str, buf, len)) {
00067 str[len] = 0;
00068 dlog ("%d\t%d\t%s\tW %s\n", current->pid, current->parent->pid, current->comm, str);
00069 }
00070 }
00071 }
00072 \endverbatim
00073 */