mirror of
https://github.com/Jackett/Jackett.git
synced 2025-12-25 23:24:52 +01:00
31 lines
848 B
C#
31 lines
848 B
C#
using System;
|
|
using Jackett.Common.Services.Interfaces;
|
|
using Mono.Unix;
|
|
using NLog;
|
|
|
|
namespace Jackett.Server.Services
|
|
{
|
|
public class FilePermissionService : IFilePermissionService
|
|
{
|
|
private readonly Logger logger;
|
|
|
|
public FilePermissionService(Logger l) => logger = l;
|
|
|
|
public void MakeFileExecutable(string path)
|
|
{
|
|
logger.Debug($"Attempting to give execute permission to: {path}");
|
|
try
|
|
{
|
|
var jackettUpdaterFI = new UnixFileInfo(path)
|
|
{
|
|
FileAccessPermissions = FileAccessPermissions.UserReadWriteExecute | FileAccessPermissions.GroupRead | FileAccessPermissions.OtherRead
|
|
};
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(ex);
|
|
}
|
|
}
|
|
}
|
|
}
|