Olaf Bohlen
2011-08-10 08:12:23 UTC
Hello,
for some strange reasons ;) I want to use dtrace to modify a exec*
syscall when it's entered.
So, if someone calls "./foobar.ksh" I want the exec to call
/usr/bin/date instead.
But somehow this does not work. I think it's too late to modify arg0
when exece() is already called, am I right?
This is my try:
#!/usr/sbin/dtrace -s
#pragma D option destructive
syscall::exec*:entry
/copyinstr(arg0) == "./foobar.ksh" /
{
printf("exec arg0: %s\n", copyinstr(arg0));
copyout("/usr/bin/date", arg0, 14);
}
Yours
for some strange reasons ;) I want to use dtrace to modify a exec*
syscall when it's entered.
So, if someone calls "./foobar.ksh" I want the exec to call
/usr/bin/date instead.
But somehow this does not work. I think it's too late to modify arg0
when exece() is already called, am I right?
This is my try:
#!/usr/sbin/dtrace -s
#pragma D option destructive
syscall::exec*:entry
/copyinstr(arg0) == "./foobar.ksh" /
{
printf("exec arg0: %s\n", copyinstr(arg0));
copyout("/usr/bin/date", arg0, 14);
}
Yours
--
Olaf Bohlen <olafbohlen-gM/Ye1E23mwN+***@public.gmane.org>
Fon: +49 172 4561817 RIPE: DARK-RIPE
UKW/DSC: 211501050 DH6432 S/Y Annemarie (HX)
Olaf Bohlen <olafbohlen-gM/Ye1E23mwN+***@public.gmane.org>
Fon: +49 172 4561817 RIPE: DARK-RIPE
UKW/DSC: 211501050 DH6432 S/Y Annemarie (HX)