mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Fixed binary execute permissions for osx and Radarr
This commit is contained in:
parent
52240bb3ac
commit
72658dd2d5
7 changed files with 24 additions and 7 deletions
|
@ -37,6 +37,7 @@ namespace NzbDrone.Common.Disk
|
||||||
public abstract long? GetAvailableSpace(string path);
|
public abstract long? GetAvailableSpace(string path);
|
||||||
public abstract void InheritFolderPermissions(string filename);
|
public abstract void InheritFolderPermissions(string filename);
|
||||||
public abstract void SetEveryonePermissions(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 SetPermissions(string path, string mask, string group);
|
||||||
public abstract void CopyPermissions(string sourcePath, string targetPath);
|
public abstract void CopyPermissions(string sourcePath, string targetPath);
|
||||||
public abstract long? GetTotalSize(string path);
|
public abstract long? GetTotalSize(string path);
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace NzbDrone.Common.Disk
|
||||||
long? GetAvailableSpace(string path);
|
long? GetAvailableSpace(string path);
|
||||||
void InheritFolderPermissions(string filename);
|
void InheritFolderPermissions(string filename);
|
||||||
void SetEveryonePermissions(string filename);
|
void SetEveryonePermissions(string filename);
|
||||||
|
void SetFilePermissions(string path, string mask, string group);
|
||||||
void SetPermissions(string path, string mask, string group);
|
void SetPermissions(string path, string mask, string group);
|
||||||
void CopyPermissions(string sourcePath, string targetPath);
|
void CopyPermissions(string sourcePath, string targetPath);
|
||||||
long? GetTotalSize(string path);
|
long? GetTotalSize(string path);
|
||||||
|
|
|
@ -149,7 +149,7 @@ namespace NzbDrone.Core.Update
|
||||||
// Set executable flag on update app
|
// Set executable flag on update app
|
||||||
if (OsInfo.IsOsx || (OsInfo.IsLinux && PlatformInfo.IsNetCore))
|
if (OsInfo.IsOsx || (OsInfo.IsLinux && PlatformInfo.IsNetCore))
|
||||||
{
|
{
|
||||||
_diskProvider.SetPermissions(_appFolderInfo.GetUpdateClientExePath(updatePackage.Runtime), "0755", null);
|
_diskProvider.SetFilePermissions(_appFolderInfo.GetUpdateClientExePath(updatePackage.Runtime), "755", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Info("Starting update client {0}", _appFolderInfo.GetUpdateClientExePath(updatePackage.Runtime));
|
_logger.Info("Starting update client {0}", _appFolderInfo.GetUpdateClientExePath(updatePackage.Runtime));
|
||||||
|
|
|
@ -38,6 +38,7 @@ namespace NzbDrone.Mono.Test.DiskProviderTests
|
||||||
{
|
{
|
||||||
Syscall.chmod(_tempPath, FilePermissions.S_IRUSR | FilePermissions.S_IWUSR);
|
Syscall.chmod(_tempPath, FilePermissions.S_IRUSR | FilePermissions.S_IWUSR);
|
||||||
}
|
}
|
||||||
|
|
||||||
_tempPath = null;
|
_tempPath = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +56,6 @@ namespace NzbDrone.Mono.Test.DiskProviderTests
|
||||||
protected void SetWritePermissionsInternal(string path, bool writable, bool setgid)
|
protected void SetWritePermissionsInternal(string path, bool writable, bool setgid)
|
||||||
{
|
{
|
||||||
// Remove Write permissions, we're still owner so we can clean it up, but we'll have to do that explicitly.
|
// Remove Write permissions, we're still owner so we can clean it up, but we'll have to do that explicitly.
|
||||||
|
|
||||||
Stat stat;
|
Stat stat;
|
||||||
Syscall.stat(path, out stat);
|
Syscall.stat(path, out stat);
|
||||||
FilePermissions mode = stat.st_mode;
|
FilePermissions mode = stat.st_mode;
|
||||||
|
@ -69,7 +69,6 @@ namespace NzbDrone.Mono.Test.DiskProviderTests
|
||||||
mode &= ~(FilePermissions.S_IWUSR | FilePermissions.S_IWGRP | FilePermissions.S_IWOTH);
|
mode &= ~(FilePermissions.S_IWUSR | FilePermissions.S_IWGRP | FilePermissions.S_IWOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (setgid)
|
if (setgid)
|
||||||
{
|
{
|
||||||
mode |= FilePermissions.S_ISGID;
|
mode |= FilePermissions.S_ISGID;
|
||||||
|
|
|
@ -77,10 +77,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)
|
public override void SetPermissions(string path, string mask, string group)
|
||||||
{
|
{
|
||||||
_logger.Debug("Setting permissions: {0} on {1}", mask, path);
|
|
||||||
|
|
||||||
var permissions = NativeConvert.FromOctalPermissionString(mask);
|
var permissions = NativeConvert.FromOctalPermissionString(mask);
|
||||||
|
|
||||||
if (_fileSystem.File.Exists(path))
|
if (_fileSystem.File.Exists(path))
|
||||||
|
@ -88,6 +93,13 @@ namespace NzbDrone.Mono.Disk
|
||||||
permissions = GetFilePermissions(permissions);
|
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
|
// Preserve non-access permissions
|
||||||
if (Syscall.stat(path, out var curStat) < 0)
|
if (Syscall.stat(path, out var curStat) < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,7 +128,7 @@ namespace NzbDrone.Update.UpdateEngine
|
||||||
// Set executable flag on Lidarr app
|
// Set executable flag on Lidarr app
|
||||||
if (OsInfo.IsOsx || (OsInfo.IsLinux && PlatformInfo.IsNetCore))
|
if (OsInfo.IsOsx || (OsInfo.IsLinux && PlatformInfo.IsNetCore))
|
||||||
{
|
{
|
||||||
_diskProvider.SetPermissions(Path.Combine(installationFolder, "Lidarr"), "0755", null);
|
_diskProvider.SetFilePermissions(Path.Combine(installationFolder, "Lidarr"), "755", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Abstractions;
|
using System.IO.Abstractions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -102,6 +102,10 @@ namespace NzbDrone.Windows.Disk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void SetFilePermissions(string path, string mask, string group)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public override void SetPermissions(string path, string mask, string group)
|
public override void SetPermissions(string path, string mask, string group)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue