Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!midway!mimsy!mojo!proven From: proven@eng.umd.edu (Christopher Provenzano) Newsgroups: comp.unix.wizards Subject: Hard links: Why? Message-ID: <1990Aug3.193609.22399@eng.umd.edu> Date: 3 Aug 90 19:36:09 GMT References: <1990Jul24.200022.2265@dg-rtp.dg.com> <1990Jul30.153949.28122@dg-rtp.dg.com> Sender: news@eng.umd.edu (The News System) Organization: College of Sneering, Merryversity von Uniland, College Purgatory Lines: 39 In article <1990Jul30.153949.28122@dg-rtp.dg.com> goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes: > >Here's an example of the problem: > >1) I create a subdirectory named "sub". > >2) Unbeknownst to be me, Joe Schmo creates a hard link of his own > to "sub". > >3) I try to rmdir "sub", which is empty, and find that I cannot, > because its link count is > 2. > >So now I'm stuck with a subdirectory that I own that lives in a >directory that I can write, but I can't delete it! All I know is how >many extra links to it exist -- and I have no way of finding out >*where* those links are. Contrast this case to the deletion of an >ordinary file with many links, and you'll see the difference. There's >nothing preventing me unlinking the file, yet there is for the >directory. > >That is the behavior I find objectionable. > Lets take it one step further. Suppose You have a quota and you fave a file XXX. Joe Schmo cretes a hrd link to file XXX. Later you delete the file, but XXX exists as another file name, so your quota is still charged for file XXX. This can happen, also Joe Schmo could (if he's an annoying user) link system files to random places (Granted there are ways of finding the links.) This type of action may be deploreable, but I believe it raises the question of letting the user make hard links at all. Is there a particular reason that a user should be allowed to hard link a file if he doesn't own it and doesn't have write permission to it? -- Christopher A. Provenzano | System Administration is like uucp: uunet!mimsy!proven | juggling, the more systems you have, email: proven@eng.umd.edu | the more likely they will be down... voice: (301) 454-7705 |