]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'sk/mingw-owner-check-error-message-improvement'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Jan 2024 23:04:46 +0000 (15:04 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Jan 2024 23:04:46 +0000 (15:04 -0800)
In addition to (rather cryptic) Security Identifiers, show username
and domain in the error message when we barf on mismatch between
the Git directory and the current user on Windows.

* sk/mingw-owner-check-error-message-improvement:
  mingw: give more details about unsafe directory's ownership

1  2 
compat/mingw.c

diff --cc compat/mingw.c
index 42053c1f656bd8b73696b751f30177ce9e544d59,852cfe8d0f86ecf3db1421029dba30b136097276..238a84ddbaa1b4c7563f6950eca469949d77fa68
@@@ -2762,12 -2773,14 +2786,14 @@@ int is_path_owned_by_current_sid(const 
                        /*
                         * On FAT32 volumes, ownership is not actually recorded.
                         */
 -                      strbuf_addf(report, "'%s' is on a file system that does"
 +                      strbuf_addf(report, "'%s' is on a file system that does "
                                    "not record ownership\n", path);
                } else if (report) {
-                       LPSTR str1, str2, to_free1 = NULL, to_free2 = NULL;
+                       LPSTR str1, str2, str3, str4, to_free1 = NULL,
+                           to_free3 = NULL, to_local_free2 = NULL,
+                           to_local_free4 = NULL;
  
-                       if (ConvertSidToStringSidA(sid, &str1))
+                       if (user_sid_to_user_name(sid, &str1))
                                to_free1 = str1;
                        else
                                str1 = "(inconvertible)";