Skip to Main Content
Linux Desktop Hacks
book

Linux Desktop Hacks

by Nicholas Petreley, Jono Bacon
March 2005
Beginner to intermediate content levelBeginner to intermediate
342 pages
15h 55m
English
O'Reilly Media, Inc.
Content preview from Linux Desktop Hacks
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Server Hacks, Volume Two

Linux Server Hacks, Volume Two

William von Hagen, Brian K. Jones
Introducing Linux Distros

Introducing Linux Distros

Jose Dieguez Castro

Publisher Resources

ISBN: 0596009119Supplemental ContentCatalog PageErrata