Previous problem solved and a new question: within KAUTH_FILEOP_OPEN check whether this is a USB device...
Previous problem solved and a new question: within KAUTH_FILEOP_OPEN check whether this is a USB device...
- Subject: Previous problem solved and a new question: within KAUTH_FILEOP_OPEN check whether this is a USB device...
- From: Misha Pak <email@hidden>
- Date: Tue, 08 Oct 2013 16:31:02 +0300
It turns out that during the execution of the kauth FileOp callback, I called proc_self() to get the process name of the process who tried to access a certain folder, but then I forgot to proc_rele() it...
This caused any process who accessed my folder, to hang when exiting. I still don't know the precise reason why, but adding the relevant proc_rele() call, solved the issue.
The new question I have concerns checking the device of the folder which triggered a KAUTH callback.
I'm using a File Scope listener, and monitor all KAUTH_FILEOP_OPEN actions for a specific folder. But I need to know whether this folder is on local disk or on a removable media (USB).
I didn't see any easy way of figuring this out.
What's worse, even if I know (via a user-mode supplied side info) which BSD names correspond to USB devices, there seems to be no documented method of extracting the BSD name of the device on which the "listened" folder resides.
I know I have the vnode in 'arg0' (in KAUTH_FILEOP_OPEN), but the "struct vnode" data type is opaque.
I know that it has a v_mount member which points to a "struct mount" (another opaque struct!!) which in turn has the relevant "f_mntfromname" field which is what I need.
But is there more standard, documented and supported method of extracting this (or better still) knowing whether this is a USB device or not?
Thanks a lot!
Misha.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden