• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Deleting a file in KEXT
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting a file in KEXT


  • Subject: Re: Deleting a file in KEXT
  • From: Anatol Pomozov <email@hidden>
  • Date: Tue, 10 Apr 2012 13:49:47 -0700

Hi

On Mon, Apr 9, 2012 at 6:38 AM, Rupesh Khetawat
<email@hidden> wrote:
> Is there anyway a file can be deleted in KEXT?
>
>
>
> I have written KEXT where file scope listener is registered with kauth. I am
> trying to delete certain files when the action is close with modified flag.
> I looked at the documentation, but did not find anything deleting file in
> kernel mode.
>
> Can someone throw some light on this?

In kernel you do not have access to POSIX functions such as unlink().
I believe the only way to achieve the goal is to use VNOP operations
directly. In your case this will be VNOP_REMOVE.

Here is an example from XNU that removes a file
https://github.com/anatol/xnu/blob/master/bsd/vfs/vfs_xattr.c#L529
 _______________________________________________
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

References: 
 >Deleting a file in KEXT (From: Rupesh Khetawat <email@hidden>)

  • Prev by Date: Re: Permission level required for injecting in another task
  • Next by Date: monitoring syscalls
  • Previous by thread: Deleting a file in KEXT
  • Next by thread: Re: Deleting a file in KEXT
  • Index(es):
    • Date
    • Thread