# Set working directory of a command run via sudo?

I have a command that I run via sudo. This command needs to have its working directory set to the directory where the command is installed. The user that calls sudo has no permissions in this directory so I can not cd beforehand.

So basically what I like to be able to inlude in /etc/sudoers is something like :

appuser localhost = (appowner) NOPASSWD: cd /opt/app/bin \; ./binary


I know I can use a wrapper script around binary but I would rather not... Any suggestions?

-
Why would you rather not use a script? –  Skyhawk Jan 2 '13 at 9:11
Mostly because using wrappers would add another place to check when something goes wrong while running the application... –  Willem Jan 2 '13 at 9:41
Thanks for helping out, guys! –  Willem Jan 3 '13 at 9:48

appuser localhost = (appowner) NOPASSWD: /path/to/wrapper