mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 04:25:45 +00:00
Don't pass sudo password, all commands should be in sudoers
This commit is contained in:
parent
ce4793cc91
commit
f86e876242
1 changed files with 2 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ public class CoreAdminManager
|
||||||
StringBuilder sb = new();
|
StringBuilder sb = new();
|
||||||
sb.AppendLine("#!/bin/bash");
|
sb.AppendLine("#!/bin/bash");
|
||||||
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}";
|
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}";
|
||||||
sb.AppendLine($"exec sudo -u#{UID.ToString()} -S -- {cmdLine}");
|
sb.AppendLine($"exec sudo -u#{UID.ToString()} -- {cmdLine}");
|
||||||
var shFilePath = await FileUtils.CreateLinuxShellFile("run_as_sudo.sh", sb.ToString(), true);
|
var shFilePath = await FileUtils.CreateLinuxShellFile("run_as_sudo.sh", sb.ToString(), true);
|
||||||
Dictionary<string,string> env = new Dictionary<string, string>();
|
Dictionary<string,string> env = new Dictionary<string, string>();
|
||||||
env.Add("ENABLE_DEPRECATED_LEGACY_DNS_SERVERS", "true");
|
env.Add("ENABLE_DEPRECATED_LEGACY_DNS_SERVERS", "true");
|
||||||
|
|
@ -43,7 +43,7 @@ public class CoreAdminManager
|
||||||
arguments: "",
|
arguments: "",
|
||||||
workingDirectory: Utils.GetBinConfigPath(),
|
workingDirectory: Utils.GetBinConfigPath(),
|
||||||
displayLog: true,
|
displayLog: true,
|
||||||
redirectInput: true,
|
redirectInput: false,
|
||||||
environmentVars: env,
|
environmentVars: env,
|
||||||
updateFunc: _updateFunc
|
updateFunc: _updateFunc
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue