]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common source file not applicable to open-vm-tools.
authorKruti Pendharkar <kp025370@broadcom.com>
Tue, 22 Jul 2025 07:06:54 +0000 (00:06 -0700)
committerKruti Pendharkar <kp025370@broadcom.com>
Tue, 22 Jul 2025 07:06:54 +0000 (00:06 -0700)
open-vm-tools/vgauth/serviceImpl/alias.c

index 4309d4c48c3bd29fbedaa2073de7786997174fb2..568e639afb5d7f3a7ad03080811679b6971a221a 100644 (file)
@@ -278,6 +278,15 @@ mapping file layout:
 #define ISPATHSEP(c)  ((c) == '/')
 #endif
 
+/*
+ * Usernames are case-insensitive in Windows and case-sensitive in Linux.
+ */
+#ifdef _WIN32
+#define USERNAME_CMP  _stricmp
+#else
+#define USERNAME_CMP  g_strcmp0
+#endif
+
 
 /*
  ******************************************************************************
@@ -2716,7 +2725,7 @@ check_map:
                }
             }
             // if its a new subject for the same user, add it
-            if (g_strcmp0(maList[i].userName, userName) == 0) {
+            if (USERNAME_CMP(maList[i].userName, userName) == 0) {
                // additional subject for cert/username pair
                maList[i].num++;
                maList[i].subjects = g_realloc_n(maList[i].subjects,
@@ -2968,7 +2977,7 @@ ServiceAliasRemoveAlias(const gchar *reqUserName,
       userIdIdx = -1;
       for (i = 0; i < numMapped; i++) {
          if (ServiceComparePEMCerts(pemCert, maList[i].pemCert) &&
-             (g_strcmp0(userName, maList[i].userName) == 0)) {
+             (USERNAME_CMP(userName, maList[i].userName) == 0)) {
             userIdIdx = i;
             break;
          }