diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-04-07 14:23:20 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-07 14:23:20 -0700 |
| commit | 45e31f0bacc863586de9a7e57c3cb4450a27fbb4 (patch) | |
| tree | 3a50d89aa98693fea15fc320aec75b51df122b24 /t/helper/test-path-utils.c | |
| parent | Merge branch 'tb/bitamp-typofix' (diff) | |
| parent | test-tool path-utils: support debugging "dubious ownership" issues (diff) | |
| download | git-45e31f0bacc863586de9a7e57c3cb4450a27fbb4.tar.gz git-45e31f0bacc863586de9a7e57c3cb4450a27fbb4.zip | |
Merge branch 'js/mingw-admins-are-special'
"Dubious ownership" checks on Windows has been tightened up.
* js/mingw-admins-are-special:
test-tool path-utils: support debugging "dubious ownership" issues
mingw: special-case administrators even more
Diffstat (limited to 't/helper/test-path-utils.c')
| -rw-r--r-- | t/helper/test-path-utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c index 72ac8d1b1b..f3c59e5028 100644 --- a/t/helper/test-path-utils.c +++ b/t/helper/test-path-utils.c @@ -504,6 +504,25 @@ int cmd__path_utils(int argc, const char **argv) return !!res; } + if (argc > 1 && !strcmp(argv[1], "is_path_owned_by_current_user")) { + int res = 0; + + for (int i = 2; i < argc; i++) { + struct strbuf buf = STRBUF_INIT; + + if (is_path_owned_by_current_user(argv[i], &buf)) + printf("'%s' is owned by current SID\n", argv[i]); + else { + printf("'%s' is not owned by current SID: %s\n", argv[i], buf.buf); + res = 1; + } + + strbuf_release(&buf); + } + + return res; + } + fprintf(stderr, "%s: unknown function name: %s\n", argv[0], argv[1] ? argv[1] : "(there was none)"); return 1; |
