|
|
|
@ -61,10 +61,15 @@ namespace NzbDrone.Mono.Disk
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SetPermissions(string path, string mask, string group)
|
|
|
|
|
public override void SetFilePermissions(string path, string mask, string group)
|
|
|
|
|
{
|
|
|
|
|
_logger.Debug("Setting permissions: {0} on {1}", mask, path);
|
|
|
|
|
var permissions = NativeConvert.FromOctalPermissionString(mask);
|
|
|
|
|
|
|
|
|
|
SetPermissions(path, mask, group, permissions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SetPermissions(string path, string mask, string group)
|
|
|
|
|
{
|
|
|
|
|
var permissions = NativeConvert.FromOctalPermissionString(mask);
|
|
|
|
|
|
|
|
|
|
if (File.Exists(path))
|
|
|
|
@ -72,6 +77,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)
|
|
|
|
|
{
|
|
|
|
|