为在另一个用户下运行的 wine 创建一个包装器?
我创建了一个名为 wine
的用户来运行 Wine,原因有两个:
- 任何恶意活动只能损坏
/home/wine
- Wine 往往会用大量配置污染主文件夹
~/.local
中的文件
但是,我希望为 wine
创建一个包装器,以便在运行时设置 UID 并在该用户下运行 Wine。
到目前为止,我当前的想法是:
- 创建一个
bash
脚本,/usr/local/bin/wine
(记住/usr/local/bin
> 位于$PATH
中的/usr/bin
之前) - 此脚本将
gksu
进入wine
用户,运行 < code>/usr/bin/wine (带有完整路径,以避免递归运行此脚本)和参数
这看起来有点笨拙。还有其他想法吗?
到目前为止我在 /usr/local/bin/wine
中的内容:
#!/bin/bash
gksu -D Wine -u wine /usr/bin/wine $@
编辑:打开应用程序时脚本似乎正在启动,但是 Wine 打印 Cannot find file
在标准输出上。
I have created a user called wine
to run Wine under for two reasons:
- any malicious activity can only damage
/home/wine
- Wine tends to pollute the home folder with heaps of configuration files in
~/.local
However, I wish to create a wrapper for wine
so that when run, sets the UID and runs Wine under that user.
So far, my current idea is:
- create a
bash
script,/usr/local/bin/wine
(remember that/usr/local/bin
is before/usr/bin
in$PATH
) - this script will
gksu
into thewine
user, running/usr/bin/wine
(with full path, to avoid recursively running this script) with the arguments
This seems a little clunky though. Any other ideas?
What I have so far in /usr/local/bin/wine
:
#!/bin/bash
gksu -D Wine -u wine /usr/bin/wine $@
Edit: the script seems to be launching when opening applications, however Wine prints Cannot find file
on stdout.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的选择是使用 setuid。
Your best bet is to use setuid.