Xref: utzoo comp.unix.wizards:22952 alt.security:1127 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!mikros!mwtech!martin From: martin@mwtech.UUCP (Martin Weitzel) Newsgroups: comp.unix.wizards,alt.security Subject: Re: Hard links to directories: why not? Keywords: ln, directories, security... Message-ID: <847@mwtech.UUCP> Date: 19 Jul 90 13:51:27 GMT References: <5222@milton.u.washington.edu> <13432@ulysses.att.com> Reply-To: martin@mwtech.UUCP (Martin Weitzel) Organization: MIKROS Systemware, Darmstadt/W-Germany Lines: 30 In article <13432@ulysses.att.com> smb@ulysses.att.com (Steven Bellovin) writes: [question about security issues when hard-linking to directories] >In article <5222@milton.u.washington.edu>, wiml@milton.u.washington.edu (William Lewis) writes: [qoute from a Ritchie and Thompson paper] > [...] The reason for this is to > simplify the writing of programs that visit subtrees of the > directory structure, and more important, to avoid the > separation of portions of the hierarchy. [...] Exactly! For those of us who have no symlinks, hard-linking to a directory (if possible) can sometimes avoid lot's of headaches. If you don't create circular links, the only "surprise" may be that ".." sometimes is not what you normally expect. Minor problems may occur with find and some backup programs, which may duplicate parts of the disk on the backup media and hence use more space than expected or available. BTW: A few years back I wrote a "directory compression program" which only linked around the files to get rid of empty slots in directories, that were large some day but shrunk in size later. (This *can* be done with standard commands, but not in the most efficient way.) If the directory which was to compress contained sub-directories, things became a bit complicated, because the ".." entry of the sub-directories had to be re-linked ... all in all it's a nice exercise for students who want really to understand how the directory- hierachies is implemented under unix :-) -- Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83