Refactor permission setting in ChineseNfoRegistry to use sudo for improved security
This commit is contained in:
@@ -64,20 +64,14 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
|||||||
var failedCount = 0;
|
var failedCount = 0;
|
||||||
var skippedCount = 0;
|
var skippedCount = 0;
|
||||||
|
|
||||||
// 使用 chmod -R 666 设置全部文件的读写权限
|
// 使用 root 角色执行 chmod -R 666 设置全部文件的读写权限
|
||||||
var permission = new Process
|
var permission = new ProcessStartInfo("sudo", "chmod -R 666 " + tvFolder)
|
||||||
{
|
{
|
||||||
StartInfo = new ProcessStartInfo
|
CreateNoWindow = true,
|
||||||
{
|
UseShellExecute = false
|
||||||
FileName = "chmod",
|
|
||||||
Arguments = "-R 666 " + tvFolder,
|
|
||||||
RedirectStandardOutput = true,
|
|
||||||
UseShellExecute = false,
|
|
||||||
CreateNoWindow = true
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
Process.Start(permission);
|
||||||
|
|
||||||
permission.Start();
|
|
||||||
|
|
||||||
// 扫描 tvshow.nfo 文件
|
// 扫描 tvshow.nfo 文件
|
||||||
var tvShowFiles = Directory.GetFiles(tvFolder, "tvshow.nfo", SearchOption.AllDirectories);
|
var tvShowFiles = Directory.GetFiles(tvFolder, "tvshow.nfo", SearchOption.AllDirectories);
|
||||||
|
|||||||
Reference in New Issue
Block a user