mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed binary execute permissions for osx and Radarr
Fixes #5388 Co-Authored-By: Taloth <Taloth@users.noreply.github.com>
This commit is contained in:
parent
28e2834c5d
commit
e3ac7d6fc5
@ -30,6 +30,7 @@ public static StringComparison PathStringComparison
|
||||
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 @@ public interface IDiskProvider
|
||||
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);
|
||||
|
@ -61,10 +61,15 @@ public override void SetEveryonePermissions(string filename)
|
||||
{
|
||||
}
|
||||
|
||||
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))
|
||||
@ -72,6 +77,13 @@ public override void SetPermissions(string path, string mask, string group)
|
||||
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)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ public void Start(string installationFolder, int processId)
|
||||
// Set executable flag on app
|
||||
if (OsInfo.IsOsx || (OsInfo.IsLinux && PlatformInfo.IsNetCore))
|
||||
{
|
||||
_diskProvider.SetPermissions(Path.Combine(installationFolder, "Radarr"), "755", null);
|
||||
_diskProvider.SetFilePermissions(Path.Combine(installationFolder, "Radarr"), "755", null);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -91,6 +91,10 @@ public override void SetEveryonePermissions(string filename)
|
||||
}
|
||||
}
|
||||
|
||||
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
Block a user