kext icon indicating copy to clipboard operation
kext copied to clipboard

Read and write unlinked files with open handles

Open ritikm opened this issue 7 years ago • 1 comments

This allows files that have open handles, but have been unlinked after the handle was opened to still be read and written to without errors. To make this possible, the following changes are made:

  • If the user-space daemon implements fgetattr, it will now be called for any unlinked files that have an open handle.
  • If a read call comes in, the kext will allow it to proceed if it realizes the vnode is in use (aka there's at least one open handle).
  • Same thing for a write call.

ritikm avatar Mar 29 '17 22:03 ritikm

@ritikm Unless I'm misreading the original comment

     * But by doing so, we would not get an ENOENT error in case the file does
     * no longer exist (under its original name) for as long as its vnode is in
     * the vnode name cache.
     */

it appears, doing this will make the file in question virtually "un-deletable" (in that the delete will succeed but a stat for it will still succeed) when it has open file handles. Are you not running into this problem?

kaushiks avatar Jan 13 '19 21:01 kaushiks