From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,ed6d503eceff92c6,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-11-07 07:28:57 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.mathworks.com!news.cic.net!locust.cic.net!pauls From: pauls@locust.cic.net (Paul Southworth) Newsgroups: comp.unix.osf.osf1 Subject: Re: AdvFS Trashcans Date: 7 Nov 1994 15:01:58 GMT Organization: CICNet, Inc. Message-ID: <39lfh6$oe9@spruce.cic.net> References: <39kqmi$blu@aggedor.rmit.EDU.AU> NNTP-Posting-Host: locust.cic.net In article <39kqmi$blu@aggedor.rmit.EDU.AU>, Stuart 'Zen' Bishop 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