[Nix-dev] atd broken by hard-link security features

Peter Simons simons at cryp.to
Sat Apr 27 00:14:21 CEST 2013


Hi Vladimír,

 > I still don't see how hardlinking can lock a file, but never mind :-)

link(2) is an atomic operation that fails with EEXIST if the target path
exists already. If several processes call link("foo", "foo.lck") at the
same time, then only one of them will succeed.

Take care,
Peter



More information about the nix-dev mailing list