1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00
git/compat/fsmonitor
Patrick Steinhardt 2a0e11479f compat/fsmonitor: fix socket path in networked SHA256 repos
The IPC socket used by the fsmonitor on Darwin is usually contained in
the Git repository itself. When the repository is hosted on a networked
filesystem though, we instead create the socket path in the user's home
directory or the socket directory. In that case, we derive the path by
hashing the repository path.

But while we always use SHA1 to hash the repository path, we then end up
using `hash_to_hex()` to append the computed hash to the socket path.
This is wrong because `hash_to_hex()` uses the hash algorithm configured
in `the_repository`, which may not be SHA1. The consequence is that we
may append uninitialized bytes to the path when operating in a SHA256
repository.

Fix this bug by using `hash_to_hex_algop()` with SHA1.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-14 10:26:34 -07:00
..
fsm-darwin-gcc.h fsmonitor: eliminate call to deprecated FSEventStream function 2022-12-15 09:08:27 +09:00
fsm-health-darwin.c fsmonitor: mark unused parameters in stub functions 2023-09-18 15:56:15 -07:00
fsm-health-win32.c fsmonitor--daemon.h: remove unnecessary includes 2023-12-26 12:04:32 -08:00
fsm-health.h fsmonitor--daemon: stub in health thread 2022-05-26 15:59:27 -07:00
fsm-ipc-darwin.c compat/fsmonitor: fix socket path in networked SHA256 repos 2024-06-14 10:26:34 -07:00
fsm-ipc-win32.c fsmonitor: prefer repo_git_path() to git_pathdup() 2023-09-18 15:56:14 -07:00
fsm-listen-darwin.c fsmonitor--daemon.h: remove unnecessary includes 2023-12-26 12:04:32 -08:00
fsm-listen-win32.c fsmonitor--daemon.h: remove unnecessary includes 2023-12-26 12:04:32 -08:00
fsm-listen.h fsmonitor--daemon: rename listener thread related variables 2022-05-26 15:59:26 -07:00
fsm-path-utils-darwin.c fsmonitor-ll.h: split this header out of fsmonitor.h 2023-06-21 13:39:54 -07:00
fsm-path-utils-win32.c fsmonitor: mark unused parameters in stub functions 2023-09-18 15:56:15 -07:00
fsm-settings-darwin.c fsmonitor-ll.h: split this header out of fsmonitor.h 2023-06-21 13:39:54 -07:00
fsm-settings-win32.c fsmonitor/win32: mark unused parameter in fsm_os__incompatible() 2023-09-18 15:56:15 -07:00