aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/diff-highlight/diff-highlight.perl
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2021-03-15 21:08:27 +0000
committerJunio C Hamano <gitster@pobox.com>2021-03-15 14:32:51 -0700
commit9fd19027621fc4f8beb2e57ba37d91465d1906f6 (patch)
tree72e88d15033dd50ec434f003c0d68e7431fece43 /contrib/diff-highlight/diff-highlight.perl
parentunix-socket: disallow chdir() when creating unix domain sockets (diff)
downloadgit-9fd19027621fc4f8beb2e57ba37d91465d1906f6.tar.gz
git-9fd19027621fc4f8beb2e57ba37d91465d1906f6.zip
unix-stream-server: create unix domain socket under lock
Create a wrapper class for `unix_stream_listen()` that uses a ".lock" lockfile to create the unix domain socket in a race-free manner. Unix domain sockets have a fundamental problem on Unix systems because they persist in the filesystem until they are deleted. This is independent of whether a server is actually listening for connections. Well-behaved servers are expected to delete the socket when they shutdown. A new server cannot easily tell if a found socket is attached to an active server or is leftover cruft from a dead server. The traditional solution used by `unix_stream_listen()` is to force delete the socket pathname and then create a new socket. This solves the latter (cruft) problem, but in the case of the former, it orphans the existing server (by stealing the pathname associated with the socket it is listening on). We cannot directly use a .lock lockfile to create the socket because the socket is created by `bind(2)` rather than the `open(2)` mechanism used by `tempfile.c`. As an alternative, we hold a plain lockfile ("<path>.lock") as a mutual exclusion device. Under the lock, we test if an existing socket ("<path>") is has an active server. If not, we create a new socket and begin listening. Then we use "rollback" to delete the lockfile in all cases. This wrapper code conceptually exists at a higher-level than the core unix_stream_connect() and unix_stream_listen() routines that it consumes. It is isolated in a wrapper class for clarity. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/diff-highlight/diff-highlight.perl')
0 files changed, 0 insertions, 0 deletions
span>[PATCH] Fix err in size calculation for readdir response.Neil Brown2-2/+2 2002-11-20[PATCH] NFSv3 to extract large symlinks from paginated requests.Neil Brown1-2/+41 2002-11-20[PATCH] Avoid 'defined but not used' warning with i386/xor.hNeil Brown1-0/+2 2002-11-20[PATCH] Remove unused variable in umem.cNeil Brown1-1/+0 2002-11-20[PATCH] Tidy up some handling of sb_dirty in md.cNeil Brown1-7/+3 2002-11-20[PATCH] Fix r5 bug - wrong variable used.Neil Brown1-1/+1 2002-11-20[PATCH] Fix *_mergeable_bvec routines for linear/raid0.Neil Brown2-12/+9 2002-11-20[PATCH] explicitly initialise kstat per-cpu storageAndrew Morton1-1/+1 2002-11-20[PATCH] detect uninitialised per-cpu storageAndrew Morton2-1/+33 2002-11-20[PATCH] fix the build for egcs-1.1.2Andrew Morton1-1/+1 2002-11-20[PATCH] Via KT400 agp supportNicolas Mailhot3-0/+10 2002-11-20[PATCH] threading enhancements, tid-2.5.48-C0Ingo Molnar6-38/+41 2002-11-20[PATCH] A new Athlon 'bug'.Dave Jones2-2/+14 2002-11-20[PATCH] uClinux bits for /dev/zeroChristoph Hellwig1-0/+24 2002-11-20[PATCH] fix compilation for !CONFIG_SWAPChristoph Hellwig1-2/+2