Re: Script to allow non-root read acces to a root owned file



On 16 Jan at 11:09 Justin C <justin.0511@xxxxxxxxxxxxxx> wrote in message
<slrneqpcif.eta.justin.0511@xxxxxxxxxxxxxxxxxxxxxxx>

(Debian AMD64 unofficial stable)

There is a log file I don't want to give regular users direct access to
but I want to write a script that will grep that file for a string,
provided on the command line when calling the script, and return some
information.

I'm planning on doing this in perl (but I may be persuaded to use bash).
Any suggestions on how I write a script that can be run by a user and
access a file to which they have no permission?
[snip]

Set the ownership of the script to whoever has permission to open the file,
with exec permission to the appropriate group, and make it suid owner (chmod
4711 or so).

--
Tony van der Hoff | mailto:tony@xxxxxxxxxxxxxx
Buckinghamshire, England
.