Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 2003 03:45:24 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Christopher Vance <vance@aurema.com>
Cc:        Dan Langille <dan@langille.org>
Subject:   Re: non-root process and PID files
Message-ID:  <3FA0F9D4.1AA51E73@mindspring.com>
References:  <3F9CF3F6.8307.ABC1250@localhost> <20031030003153.GC16553@aurema.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FA0F9D4.1AA51E73>