
244
|
Chapter 9, Administration and Automation
#80 Protect Yourself from Windows Applications
HACK
cd /home/jail/cxoffice/bin
sudo -u jail /home/jail/cxoffice/bin/winword f:"$filename"
sudo -u jail rm -f /home/jail/Documents/"$filename"
else
echo "No such file, or file is not readable"
fi
Save your work, and make the file executable:
# chmod +x /usr/local/bin/wordview
You have to take care of two obscure details to make this work. First, you
must configure CrossOver Office (or Wine) to equate DOS drive
f: with the
/home/jail/Documents directory. Here’s how to do that with CrossOver
Office:
# su - jail
$ cd /home/jail/.cxoffice/dotwine/dosdevices
$ ln -sf /home/jail/Documents "f:"
$ exit
If the DOS drive f: is already defined by CrossOver Office, choose another
driver letter, but make sure it matches the drive letter in the /usr/local/bin/
wordview script that looks like this:
sudo -u jail /home/jail/cxoffice/bin/winword f:"$filename"
If you are using something other than CrossOver Office, you also have to
adjust one other line in the /usr/local/bin/wordview script. This line points to
the executables directory for CrossOver Office:
cd /home/jail/cxoffice/bin
It needs to be changed to point to the location of the executable files you are
using:
cd /home/jail/<route to your winword executable file>
Give Your Creation a Try
Now you’re ready to try it out. Log in as a normal user and find a Microsoft
Word document ...