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

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

Thread Previous | Thread Next
From:
Aaron Crane
Date:
August 12, 2010 10:03
Subject:
Re: What do we do about perl -pi on Windows?
Message ID:
AANLkTi=Mw1+pwQEAm8g1+u0ELVor-_V427zPXHwO0rdD@mail.gmail.com
Ben Morrow <ben@morrow.me.uk> 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 ** http://aaroncrane.co.uk/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About