Angelo's Soapbox |
|
Monday Apr 02, 2007
DTrace, April Fools and Solaris 10 Binary Compatability.
Its been a while since I blogged. Its definitely not for lack of content but lack of the discipline to sit down and "just do it". Well its about time.
#!/usr/sbin/dtrace -qs
#pragma D option destructive
BEGIN
{
printf("Changing output of uname for pid %d and its descendants...\n",$1);
}
syscall::uname:entry
/progenyof($1)/
{
self->addr = arg0;
}
syscall::uname:return
/progenyof($1)/
{
copyoutstr("5.9", self->addr+(257*2), 257);
}
This script expects the pid of a shell as its only argument and it will change the uname version to 5.9 for this shell and all its descendants and as with all D-scripts once you stop this script (with a ^c) everything would be back as it was before. Enjoy! Posted at 02:08PM Apr 02, 2007 by angelo in DTrace | Comments:
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||