Hi,

>Is there anyway for dtrace to report me the actual user name instead of a uid.
>
>For example If I have the following code somewhere in in my script, I know 
>that I am getting uid with printf function
>
>syscall::open:return,syscall::open64:return
>{
>        .............
>        printf("%d,%s,... ",uid, ......);
>
>}
>
>Is there any way to get the username corresponding to that uid? I know that I 
>can look at /etc/password and get the username but is there anything I can do 
>directly from Dtrace?
>

You can't obtain the username from within probe context but you can
use the system() action to do this. Actually, this very example is given
in the docs. Check out the system() action example at:

http://docs.sun.com/app/docs/doc/817-6223/chp-actsub#hic

Jon.
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to