Skip to content

Commit

Permalink
Changed Posix compatibility dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushi Patel committed Jun 8, 2021
1 parent ab2dd15 commit faac640
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<PackageReference Update="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="[1.7.7, 2.0.0)" />
<PackageReference Update="Microsoft.ServiceFabric.Data" Version="3.3.624" />
<PackageReference Update="Microsoft.Spatial" Version="7.5.3" />
<PackageReference Update="Mono.Posix.NETStandard" Version="5.20.1-preview" />
<PackageReference Update="Mono.Posix" Version="7.0.0-alpha8.21302.6" />
<PackageReference Update="Moq" Version="4.10.1" />
<PackageReference Update="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Update="MSTest.TestFramework" Version="1.3.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Mono.Posix.NETStandard" />
<PackageReference Include="Mono.Posix" />
<PackageReference Include="System.IO.FileSystem.AccessControl" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\src\Azure.Storage.Common.DataMovement.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\Azure.Storage.Common\tests\Azure.Storage.Common.Tests.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,28 +186,18 @@ private void AllowReadData(string path, bool isDirectory, bool allowRead)
dynamic fsInfo = isDirectory ? new DirectoryInfo(path) : new FileInfo(path);
dynamic fsSec = FileSystemAclExtensions.GetAccessControl(fsInfo);

if (allowRead)
{
fsSec.RemoveAccessRule(_winAcl);
}
else
{
fsSec.AddAccessRule(_winAcl);
}
fsSec.ModifyAccessRule(allowRead ? AccessControlModification.Remove : AccessControlModification.Add, _winAcl, out bool result);

FileSystemAclExtensions.SetAccessControl(fsInfo, fsSec);
}
#if !NETFRAMEWORK
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
if (allowRead)
{
Syscall.chmod(path, FilePermissions.S_IRWXO);
}
else
{
Syscall.chmod(path, FilePermissions.S_IWUSR);
}
FilePermissions permissions = (allowRead ?
(FilePermissions.S_IRWXU | FilePermissions.S_IRWXG | FilePermissions.S_IRWXO) :
(FilePermissions.S_IWUSR | FilePermissions.S_IWGRP | FilePermissions.S_IWOTH));

Syscall.chmod(path, permissions);
}
#endif
}
Expand Down

0 comments on commit faac640

Please sign in to comment.