Re: run a piece of code before start a program *always*
- From: "Tony Lawrence" <pcunix@xxxxxxxxx>
- Date: 5 Dec 2006 11:20:07 -0800
Unruh wrote:
"gaetanoortisi@xxxxxxxx" <gaetanoortisi@xxxxxxxx> writes:
Hello,
as the subject says: suppose I want to prefix the execution of an
application with a log program
that records the session so that is not possible to run the application
directly without being logged.
What is the smart solution?
Write a shell script which calls the log and then calls the renamed
program.
I guess it depends upon how rigorous you want "not possible" to be.
Interpreting that as I would, a shell script isn't going to cut it, but
a setuid binary that sets up the logging and then execs the actual
program (which has its perms set only to be executable only by the
setuid person or group) would prevent un-logged use.
Or, you could use sudo ( gentle intro at
http://aplawrence.com/Basics/sudo.html ) to enforce a similar idea, but
that's not quite so bulletproof for this use.
--
Tony Lawrence
Unix/Linux/Mac OS X Resources
http://aplawrence.com
.
- References:
- run a piece of code before start a program *always*
- From: gaetanoortisi@xxxxxxxx
- Re: run a piece of code before start a program *always*
- From: Unruh
- run a piece of code before start a program *always*
- Prev by Date: Re: run a piece of code before start a program *always*
- Next by Date: Re: run a piece of code before start a program *always*
- Previous by thread: Re: run a piece of code before start a program *always*
- Next by thread: Re: run a piece of code before start a program *always*
- Index(es):
Relevant Pages
|