Xref: utzoo comp.unix.wizards:22989 alt.security:1139 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!chinacat!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.wizards,alt.security Subject: Re: Hard links to directories: why not? Message-ID: <18461@rpp386.cactus.org> Date: 21 Jul 90 19:12:52 GMT References: <5222@milton.u.washington.edu> <10527@odin.corp.sgi.com> <1990Jul19.121048.16332@cbnews.att.com> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Distribution: na Organization: Lone Star Cafe and BBS Service Lines: 21 X-Clever-Slogan: Recycle or Die. In article <1990Jul19.121048.16332@cbnews.att.com> mvadh@cbnews.att.com (andrew.d.hay) writes: >it would be easy to have ln disallow this: >1) resolve argv[1] and argv[2] to absolute paths >2) determine which path is shorter >3) strncmp() both paths for the shorter length >4) if you have a match, you're trying to create a loop > >this would also let you safely mv directories... So, how does this relate to the link() system call? Permitting a non-tree-like structure to exist is a really bad idea for all of the reasons in the Dennis Ritchie quote. Aren't there better things to worry about? My favorite is why doesn't the ln command require the use of a -f flag to blast a target file? -- John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 832-8832 Domain: jfh@rpp386.cactus.org Proud Pilot of RS/6000 Serial #1472