Selaa lähdekoodia

Treating a star as an unset permission for compatibility with Win32-OpenSSH

Source commit: acc183e0b15a2be8e19735f6929bdaf464a295fa
Martin Prikryl 7 vuotta sitten
vanhempi
sitoutus
14777c3db0
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 1 1
      source/core/RemoteFiles.cpp
  2. 3 0
      source/core/RemoteFiles.h

+ 1 - 1
source/core/RemoteFiles.cpp

@@ -2162,7 +2162,7 @@ void __fastcall TRights::SetText(const UnicodeString & value)
     bool KeepText = false;
     for (int i = TextLen; i >= 1; i--)
     {
-      if (value[i] == UnsetSymbol)
+      if ((value[i] == UnsetSymbol) || (value[i] == UnsetSymbolWin))
       {
         FUnset |= static_cast<unsigned short>(Flag | ExtendedFlag);
       }

+ 3 - 0
source/core/RemoteFiles.h

@@ -315,6 +315,9 @@ public:
   static const int TextLen = 9;
   static const wchar_t UndefSymbol = L'$';
   static const wchar_t UnsetSymbol = L'-';
+  // Used by Win32-OpenSSH for permissions that are not applicable on Windows.
+  // See strmode() in contrib\win32\win32compat\misc.c
+  static const wchar_t UnsetSymbolWin = L'*';
   static const wchar_t BasicSymbols[];
   static const wchar_t CombinedSymbols[];
   static const wchar_t ExtendedSymbols[];