Checking in on behalf of JKuhne
authorAlex Ghiondea <ghiondea.alexandru@microsoft.com>
Thu, 19 May 2016 19:17:41 +0000 (12:17 -0700)
committerAlex Ghiondea <ghiondea.alexandru@microsoft.com>
Thu, 19 May 2016 19:17:41 +0000 (12:17 -0700)
Fixing build break in K caused by the long file path work.

[tfs-changeset: 1606374]

src/mscorlib/src/System/IO/LongPathHelper.cs
src/mscorlib/src/System/IO/Path.cs
src/mscorlib/src/System/IO/PathHelper.cs
src/mscorlib/src/System/Security/Permissions/FileIOPermission.cs

index 41cbb15..9f99d80 100644 (file)
@@ -377,6 +377,7 @@ namespace System.IO
             }
         }
 
+        [System.Security.SecuritySafeCritical]
         private static string TryExpandShortFileName(StringBuffer outputBuffer, string originalPath)
         {
             // We'll have one of a few cases by now (the normalized path will have already:
index 10da27c..a54e559 100644 (file)
@@ -104,12 +104,11 @@ namespace System.IO {
 #endif // !PLATFORM_UNIX
 
 
-        // Make this public sometime.
         // The max total path is 260, and the max individual component length is 255. 
         // For example, D:\<256 char file name> isn't legal, even though it's under 260 chars.
         internal static readonly int MaxPath = PathInternal.MaxShortPath;
 
-        private static readonly int MaxDirectoryLength = 255;
+        private static readonly int MaxDirectoryLength = PathInternal.MaxComponentLength;
 
         // Windows API definitions
         internal const int MAX_PATH = 260;  // From WinDef.h
@@ -159,6 +158,12 @@ namespace System.IO {
         // "\\server\share").
         public static String GetDirectoryName(String path)
         {
+            return GetDirectoryNameInternal(path);
+        }
+
+        [System.Security.SecuritySafeCritical]
+        private static string GetDirectoryNameInternal(string path)
+        {
             if (path != null)
             {
                 CheckInvalidPathChars(path);
index 0a57f6a..8e39b3c 100644 (file)
@@ -1,6 +1,8 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
+
+#if FEATURE_PATHCOMPAT
 using System;
 using System.Collections;
 using System.Text;
@@ -443,3 +445,4 @@ namespace System.IO {
 
     }
 }
+#endif // FEATURE_PATHCOMPAT
\ No newline at end of file
index e43c49c..a28f54f 100644 (file)
@@ -993,7 +993,7 @@ namespace System.Security.Permissions {
         /// IMPORTANT: This method should only be used after calling GetFullPath on the path to verify
         /// </summary>
         [System.Security.SecuritySafeCritical]
-        internal static void QuickDemand(FileIOPermissionAccess access, string fullPath, bool checkForDuplicates, bool needFullPath)
+        internal static void QuickDemand(FileIOPermissionAccess access, string fullPath, bool checkForDuplicates = false, bool needFullPath = false)
         {
 #if FEATURE_CAS_POLICY
             if (!CodeAccessSecurityEngine.QuickCheckForAllDemands())