setup: prepare for more detailed "dubious ownership" messages

When verifying the ownership of the Git directory, we sometimes would
like to say a bit more about it, e.g. when using a platform-dependent
code path (think: Windows has the permission model that is so different
from Unix'), but only when it is a appropriate to actually say
something.

To allow for that, collect that information and hand it back to the
caller (whose responsibility it is to show it or not).

Note: We do not actually fill in any platform-dependent information yet,
this commit just adds the infrastructure to be able to do so.

Based-on-an-idea-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2022-08-08 13:27:47 +00:00
committed by Junio C Hamano
parent d51e1dff98
commit 17d3883fe9
4 changed files with 21 additions and 13 deletions

View File

@ -2673,7 +2673,7 @@ static PSID get_current_user_sid(void)
return result;
}
int is_path_owned_by_current_sid(const char *path)
int is_path_owned_by_current_sid(const char *path, struct strbuf *report)
{
WCHAR wpath[MAX_PATH];
PSID sid = NULL;