* AdvFS Trashcans
@ 1994-11-07 9:06 Stuart 'Zen' Bishop
1994-11-07 15:01 ` Paul Southworth
0 siblings, 1 reply; 3+ messages in thread
From: Stuart 'Zen' Bishop @ 1994-11-07 9:06 UTC (permalink / raw)
I am running DEC OSF/1 3.0 with the Advanced File System Utilities.
I would like to automatically have trashcans for all user's home
directories, and subdirectories.
I can create a trashcan directory using the command 'mktrashcan trashdir dir',
but unfortunately, this is not recirsive. ie. 'mktrashcan trashcan .'
does not mean that './subdir' has a trashcan directory.
Creating an alias for mkdir is not an option, as I need to protect
directories created inside applications which create them using kernal calls.
I can think of two methods that will work:
1) A cron job running every 15 minutes that scans the home directories
and adds a trashcan directory for any new directories.
2) Somehow playing around with the auditing systems, detecting when a mkdir
system call is made, and reacting appropriately.
The first has the obvious disadvantage of not protecting files deleted from
recently created directories. And involves scanning the file system a bit
too much for my liking...
The second has the disadvantage that I don't know where to start. This solution
would also probably be far too cumbersom.
Any other ideas?
--
_____
// // __ for a good time call zen@rmit.edu.au //
// / \ I\ I //
// (-- I \I alias Unix Systems Administrator //
// \__/ I I Stuart Bishop Business Faculty, RMIT //
((_________________________________________________________________//
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: AdvFS Trashcans
1994-11-07 9:06 AdvFS Trashcans Stuart 'Zen' Bishop
@ 1994-11-07 15:01 ` Paul Southworth
1994-11-09 1:52 ` Stuart 'Zen' Bishop
0 siblings, 1 reply; 3+ messages in thread
From: Paul Southworth @ 1994-11-07 15:01 UTC (permalink / raw)
In article <39kqmi$blu@aggedor.rmit.EDU.AU>,
Stuart 'Zen' Bishop <zen@hera.bf.rmit.edu.au> wrote:
>I can create a trashcan directory using the command 'mktrashcan trashdir dir',
>but unfortunately, this is not recirsive. ie. 'mktrashcan trashcan .'
>does not mean that './subdir' has a trashcan directory.
>
>Creating an alias for mkdir is not an option, as I need to protect
>directories created inside applications which create them using kernal calls.
Just in case you weren't aware of it, when a directory is created by
an application, it is generally by use of the mkdir(2) function, NOT
by use of mkdir(1) the user command. Consequently, you *can* change
the user-level mkdir command.
Additionally, an alias is defined by the shell. If I go to every user's
home directory and add an alias for mkdir to their .cshrc it has no
bearing on whether or not a non-interactive process run by root will
alter its behavior.
Generally when you start managing large numbers of users and need to
influence their available commands and paths, you have to start maintaining
system-wide .login, .cshrc, .profile script that everyone sources at the
top of their personal ones. This would permit you to, for example,
put /usr/local/bin early in the path, and hack a copy of GNU mkdir and
stick it there. Or create a mkdir shell script wrapper and call it
"mkdir".
/usr/local/bin/mkdir:
#!/bin/sh
mkdir $1
( cd $1 ; mktrashcan trashcan . )
Or whatever. Something smarter would check for the -p flag. I'm sure
you can do it with four bytes of code in perl5 ;)
This is probably a good question for comp.unix.shell and comp.unix.admin;
this is a fairly common problem (in the abstract, not w.r.t. advfs).
--
Paul Southworth
CICNet Systems Support
pauls@cic.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: AdvFS Trashcans
1994-11-07 15:01 ` Paul Southworth
@ 1994-11-09 1:52 ` Stuart 'Zen' Bishop
0 siblings, 0 replies; 3+ messages in thread
From: Stuart 'Zen' Bishop @ 1994-11-09 1:52 UTC (permalink / raw)
pauls@locust.cic.net (Paul Southworth) writes:
>In article <39kqmi$blu@aggedor.rmit.EDU.AU>,
>Stuart 'Zen' Bishop <zen@hera.bf.rmit.edu.au> wrote:
>>Creating an alias for mkdir is not an option, as I need to protect
>>directories created inside applications which create them using kernal calls.
>Just in case you weren't aware of it, when a directory is created by
>an application, it is generally by use of the mkdir(2) function, NOT
>by use of mkdir(1) the user command. Consequently, you *can* change
>the user-level mkdir command.
Yes. I need a solution that will work for both mkdir at the command line,
and the mkdir kernal call (well... just the second, as I assume that
mkdir at the command line uses the kernal call :-)
--
_____
// // __ for a good time call zen@rmit.edu.au //
// / \ I\ I //
// (-- I \I alias Unix Systems Administrator //
// \__/ I I Stuart Bishop Business Faculty, RMIT //
((_________________________________________________________________//
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1994-11-09 1:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-11-07 9:06 AdvFS Trashcans Stuart 'Zen' Bishop
1994-11-07 15:01 ` Paul Southworth
1994-11-09 1:52 ` Stuart 'Zen' Bishop
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox