Fixed binary execute permissions for osx and Radarr
This commit is contained in:
parent
2c76afb839
commit
0bc190e97e
|
@ -32,6 +32,7 @@ namespace NzbDrone.Common.Disk
|
|||
public abstract long? GetAvailableSpace(string path);
|
||||
public abstract void InheritFolderPermissions(string filename);
|
||||
public abstract void SetEveryonePermissions(string filename);
|
||||
public abstract void SetFilePermissions(string path, string mask, string group);
|
||||
public abstract void SetPermissions(string path, string mask, string group);
|
||||
public abstract void CopyPermissions(string sourcePath, string targetPath);
|
||||
public abstract long? GetTotalSize(string path);
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace NzbDrone.Common.Disk
|
|||
long? GetAvailableSpace(string path);
|
||||
void InheritFolderPermissions(string filename);
|
||||
void SetEveryonePermissions(string filename);
|
||||
void SetFilePermissions(string path, string mask, string group);
|
||||
void SetPermissions(string path, string mask, string group);
|
||||
void CopyPermissions(string sourcePath, string targetPath);
|
||||
long? GetTotalSize(string path);
|
||||
|
|
|
@ -66,10 +66,15 @@ namespace NzbDrone.Mono.Disk
|
|||
|
||||
}
|
||||
|
||||
public override void SetFilePermissions(string path, string mask, string group)
|
||||
{
|
||||
var permissions = NativeConvert.FromOctalPermissionString(mask);
|
||||
|
||||
SetPermissions(path, mask, group, permissions);
|
||||
}
|
||||
|
||||
public override void SetPermissions(string path, string mask, string group)
|
||||
{
|
||||
Logger.Debug("Setting permissions: {0} on {1}", mask, path);
|
||||
|
||||
var permissions = NativeConvert.FromOctalPermissionString(mask);
|
||||
|
||||
if (File.Exists(path))
|
||||
|
@ -77,6 +82,13 @@ namespace NzbDrone.Mono.Disk
|
|||
permissions = GetFilePermissions(permissions);
|
||||
}
|
||||
|
||||
SetPermissions(path, mask, group, permissions);
|
||||
}
|
||||
|
||||
protected void SetPermissions(string path, string mask, string group, FilePermissions permissions)
|
||||
{
|
||||
Logger.Debug("Setting permissions: {0} on {1}", mask, path);
|
||||
|
||||
// Preserve non-access permissions
|
||||
if (Syscall.stat(path, out var curStat) < 0)
|
||||
{
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace NzbDrone.Update.UpdateEngine
|
|||
{
|
||||
// Old MacOS App stores Sonarr binaries in MacOS together with shell script
|
||||
// Make shim executable
|
||||
_diskProvider.SetPermissions(shimPath, "755", null);
|
||||
_diskProvider.SetFilePermissions(shimPath, "755", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,6 +88,11 @@ namespace NzbDrone.Windows.Disk
|
|||
|
||||
}
|
||||
|
||||
public override void SetFilePermissions(string path, string mask, string group)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void SetPermissions(string path, string mask, string group)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue