tags:

views:

23

answers:

1

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
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.

+1  A: 

Your best bet is to use setuid.

supercheetah
Thanks for that. Sorry about the *really* late accept. :)
Delan Azabani