Thread (1 message) 1 message, 1 author, 2016-06-15

Re: git update-ref --stdin : too many open files

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:21

Stefan Beller [off-list ref] writes:
Sounds reasonable. Though by closing the file we're giving up again a
bit of safety. If we close the file everyone could tamper with the lock
file. (Sure they are not supposed to touch it, but they could)
There are locking primitives (SysV mandatory locking) that require
you to keep the file you have lock on open for you to retain the
ownership of the lock, and that kind of lock does prevent random
other processes from simultaneously accessing the locked file.

But that is not what our locks are designed around; our locks rely
only on "open(O_EXCL|O_CREAT) fails if it already exists".  And
between keeping a lockfile open and closing but not removing a
lockfile, there is no difference how the lockfile that still exists
prevents open(O_EXCL|O_CREAT) by other processes from succeeding.

So we are not giving up any safety at all, which is a good thing ;-).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help