Skip to content

Commit

Permalink
Change permission assignment flags
Browse files Browse the repository at this point in the history
  • Loading branch information
VFansss committed Jun 14, 2018
1 parent eae3e3d commit a423a8f
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions mgs2 v's fix/Ocelot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Ocelot
{

// Current version of the V's Fix - Format is YYMMDD
public const string VERSION = "170614";
public const string VERSION = "180614";

// UPDATE

Expand Down Expand Up @@ -1182,17 +1182,10 @@ private static bool grantAccessToEveryUser(string fullPath)

try{

DirectoryInfo dInfo = new DirectoryInfo(fullPath);
DirectorySecurity dSecurity = dInfo.GetAccessControl();

SecurityIdentifier identity = new SecurityIdentifier(WellKnownSidType.WorldSid, null);

dSecurity.AddAccessRule(new FileSystemAccessRule(identity,
FileSystemRights.FullControl,
InheritanceFlags.ContainerInherit,
PropagationFlags.InheritOnly, AccessControlType.Allow));
dInfo.SetAccessControl(dSecurity);

DirectorySecurity sec = Directory.GetAccessControl(fullPath);
SecurityIdentifier everyone = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
sec.AddAccessRule(new FileSystemAccessRule(everyone, FileSystemRights.Modify | FileSystemRights.Synchronize, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));
Directory.SetAccessControl(fullPath, sec);

success = true;

Expand Down

0 comments on commit a423a8f

Please sign in to comment.