develooper Front page | perl.perl5.porters | Postings from August 2010

Re: What do we do about perl -pi on Windows?

Thread Previous | Thread Next
Aaron Crane
August 12, 2010 10:03
Re: What do we do about perl -pi on Windows?
Message ID:
Ben Morrow <> wrote:
> (It's really annoying there
> isn't a flink(2) syscall, which would let you unlink the tempfile right
> away and then link it in place atomically at the end.)

This is somewhat off-topic, but still: if such a syscall existed, I
think it would be a security hole.  Consider a file descriptor
inherited on exec, and opened on a file which lives in a directory on
which you don't have execute permission.  If you could create
additional links to that file, in arbitrary directories on the same
filesystem, you could make that file visible to other processes which
shouldn't be able to see it.  In the absence of flink(2), the opening
process can safely arbitrate access to the file in question.

Aaron Crane **

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About