Re: Hooking mount events from within kernel.
Re: Hooking mount events from within kernel.
- Subject: Re: Hooking mount events from within kernel.
- From: Terry Lambert <email@hidden>
- Date: Tue, 26 Aug 2008 01:17:40 -0700
On Aug 25, 2008, at 9:23 PM, Maxim Zhuravlev wrote:
What do you mean by "hook" here?
I mean, I need to get notified on every mount/umount event. I.e. I
need, say, some kauth semantics for mount/umount.
What problem you are actually trying to solve that you think
hooking mounts
and unmounts will solve for you?
I need to do some initialization in my kext for newly coming
filesystem on mount and some invalidation for umonted filesystem based
on it's device id ( in terms of stat() ) or fsid (in terms of vnodes).
There are no kauth hooks for mount/unmount notification, as the
permissions are vetted before you get there, and so there are no allow/
deny hooks in kernel space.
You can get notification through disk arbitration in user space, and
then call down into your KEXT to tell it about the events. This is
typically done with DARegisterDiskMountApprovalCallback and
DARegisterDiskUnmountApprovalCallback, which would allow you to ensure
mostly synchronous operation.
More information is available at:
<http://developer.apple.com/DOCUMENTATION/Darwin/Reference/DiscArbitrationFramework/DiskArbitration/index.html
>
-- Terry
_______________________________________________
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