John Beranek - PA wrote:
> You could write a small shell script and then provide sudo access to
> that. Beware that if you do allow user parameters to be entered that
> people can be sneaky with "../". e.g. with a shell script "move_file.sh":
>
> ================================
> #!/bin/sh
>
> mv /ifs/basedir1/$1 /ifs/basedir2/$2
> ================================
>
> A user could call:
>
> move_file.sh ../../basedir3 ../../basedir4
>
> and thereby escape the expected area of influence. You'd need to spot
> the .. in the shell script and disallow the operation...
...as well as about a million other possible problems.
If your goal is to prevent good people from making mistakes, it's more
or less achievable. I wrote a similar script at a former employer,
unfortunatelyi don't have it.
If your goal is to prevent an malicious attacker from doing something
they shouldn't, well, good luck. You're gonna need it.
danno
--
Dan Pritts
ICPSR Computing & Network Services
University of Michigan