开发者

Create a wrapper for wine that runs under another user?

开发者 https://www.devze.com 2023-01-06 14:43 出处:网络
I have created a user called wine to run Wine under for two reasons: any malicious activity can only damage /home/wine

I have created a user called wine to run Wine under for two reasons:

  1. any malicious activity can only damage /home/wine
  2. 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:

  1. create a bash script, /usr/local/bin/wine (remember that /usr/local/bin is before /usr/bin in $PATH)
  2. this script will gksu into the wine 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
g开发者_如何学编程ksu -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.


Your best bet is to use setuid.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号