Path: utzoo!attcan!uunet!mcsun!cernvax!chx400!unizh!gorgo!meyer From: meyer@gorgo.ifi.unizh.ch (Urs Meyer) Newsgroups: comp.sys.sgi Subject: Re: chown thru multiple directories Message-ID: <1990Jul10.105223.27591@gorgo.ifi.unizh.ch> Date: 10 Jul 90 10:52:23 GMT References: <9007072013.AA25848@mcirps2.med.nyu.edu> Organization: University of Zurich, Department of Computer Science Lines: 31 >JORDAN%gmr.com@relay.cs.net asks about "chown thru multiple directories" > >>Is there a command available that will change the owner and group >>of every file in the current directory, and every file & directory >>below the current directory? > >Do this one liner: > >find /$startdir -exec chown $username "{}" \; -print > >| karron@nyu.edu Dan Karron | WARNING: There is a security leak in this procedure if the super-user executes the find command. If a file in the user's directory tree is a (symbolic) link, the file pointed to by the link will change ownership and not the link itself. Therefore, if the user has a link to /etc/passwd, he will own is afterwards. This is true at least up to IRIX 3.2.1. Omit at least the links in the find command: find /$startdir ! -type l -exec ... Or let the user copy his stuff using tar. I really don't like the way symbolic links are implemented in IRIX. But, there have been enough discussions on that topic. Urs Meyer ---------- meyer@ifi.unizh.ch, {uunet,...}!mcsun!cernvax!unizh!meyer University of Zurich, Dept of Computer Science, Multimedia Lab, CH-8057 Zurich