From: pauls@locust.cic.net (Paul Southworth)
Subject: Re: AdvFS Trashcans
Date: 7 Nov 1994 15:01:58 GMT [thread overview]
Message-ID: <39lfh6$oe9@spruce.cic.net> (raw)
In-Reply-To: 39kqmi$blu@aggedor.rmit.EDU.AU
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
next prev parent reply other threads:[~1994-11-07 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-11-07 9:06 AdvFS Trashcans Stuart 'Zen' Bishop
1994-11-07 15:01 ` Paul Southworth [this message]
1994-11-09 1:52 ` Stuart 'Zen' Bishop
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox