Re: [patch] pg_copy - a command for reliable WAL archiving - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [patch] pg_copy - a command for reliable WAL archiving
Date
Msg-id CAM-w4HNQNE7+G4gR=4BbwqarBk2aKgVAXyR-RV+cwD1Hq+mTjg@mail.gmail.com
Whole thread Raw
In response to Re: [patch] pg_copy - a command for reliable WAL archiving  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [patch] pg_copy - a command for reliable WAL archiving
List pgsql-hackers
On Wed, Aug 20, 2014 at 2:27 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Hmm, the real trick here is linkat(... "/proc/self/foobar"), not the
> O_TMPFILE: you can have an open file descriptor to an "invisible" file
> simply by creating a normal file and unlinking it.  I looked at linkat()
> yesterday but the idea of using /proc/self didn't occur to me.  Nasty
> trick :-(  It seems linkat() is quite a bit more portable than
> O_TMPFILE, fortunately ...

Supposedly linkat(2) on Linux refuses to create a link to a file that
was opened normally and had its last link removed with unlink(2) due
to concerns that this would create security holes.


-- 
greg



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [patch] pg_copy - a command for reliable WAL archiving
Next
From: Andres Freund
Date:
Subject: Re: [patch] pg_copy - a command for reliable WAL archiving