You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="IntSecurity.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.ComponentModel {
|
||||
using System;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
|
||||
[HostProtection(SharedState = true)]
|
||||
internal static class IntSecurity {
|
||||
#if FEATURE_MONO_CAS
|
||||
public static readonly CodeAccessPermission UnmanagedCode = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
|
||||
public static readonly CodeAccessPermission FullReflection = new ReflectionPermission(PermissionState.Unrestricted);
|
||||
#endif
|
||||
|
||||
public static string UnsafeGetFullPath(string fileName) {
|
||||
#if FEATURE_MONO_CAS
|
||||
string full = fileName;
|
||||
|
||||
FileIOPermission fiop = new FileIOPermission(PermissionState.None);
|
||||
fiop.AllFiles = FileIOPermissionAccess.PathDiscovery;
|
||||
fiop.Assert();
|
||||
try {
|
||||
full = System.IO.Path.GetFullPath(fileName);
|
||||
}
|
||||
finally {
|
||||
CodeAccessPermission.RevertAssert();
|
||||
}
|
||||
return full;
|
||||
#else
|
||||
return System.IO.Path.GetFullPath(fileName);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user