non-root process and PID files
tlambert2 at mindspring.com
Thu Oct 30 03:46:32 PST 2003
Christopher Vance wrote:
> You can already mark a fd 'close on exec'.
> May I suggest a different feature: the ability to mark an open file
> (not just its fd) 'remove on close', with permission checked at mark
> time rather than close time (this status forgotten if not permitted
> when set) and the unlink actually done at close time only if the file
> has exactly one link and one open file instance at that time.
If all you have is an fd, you can not get from an fd to a path
without an exhaustive search of the disk, in most FS's.
Also, leaving the path peresent permits someone to hard-link it
to some other file, to make it stay around. Since /var has a
/var/tmp, this would be a real danger, I think.
More information about the freebsd-hackers