Browse Source

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

(cherry picked from commit 14777c3db0c58966749d07e8ddeac943c70259c8)

Source commit: 8c1a717700719e151a26088d53ccb4432a6f071e
Martin Prikryl 7 years ago
parent
commit
fa32b842e1
2 changed files with 4 additions and 1 deletions
  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[];