shadowsocks/shadowsocks-rust

插件是否也会遵循 `--user` 选项所指定的用户?

pexcn opened this issue · 1 comments

pexcn commented

当我使用 qtun 插件时:

# 日志显示的证书目录 /root/.acme.sh/example.com
ssservice local --config ./local.json

# 日志显示的证书目录 /root/.acme.sh/example.com
ssservice local --user nobody --config ./local.json

当我使用 xray-plugin 插件时:

# 日志显示的证书目录 /root/.acme.sh/example.com
ssservice local --config ./local.json

# 日志显示的证书目录 //.acme.sh/example.com
ssservice local --user nobody --config ./local.json

请问为什么在使用 qtun 插件的时候,即使我指定了 --user nobody, 它读取到的证书目录也是在 /root 下?

let mut cmd = Command::new(&plugin.plugin);
cmd.env("SS_REMOTE_HOST", remote.host())
.env("SS_REMOTE_PORT", remote.port().to_string())
.env("SS_LOCAL_HOST", local.ip().to_string())
.env("SS_LOCAL_PORT", local.port().to_string())
.stdin(Stdio::null())
.kill_on_drop(true);

Plugin starts without changing the uid, so the process should run with the user specified by --user.

As for the problem about the path of cert, you should open an issue to qtun, there is nothing related to shadowsocks-rust.