Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!iecc!johnl From: johnl@iecc.cambridge.ma.us (John R. Levine) Newsgroups: comp.unix.internals Subject: Re: non-superuser chown(2)s considered harmful Summary: Charging by UID doesn't work Message-ID: <1990Dec09.043647.25826@iecc.cambridge.ma.us> Date: 9 Dec 90 04:36:47 GMT References: <1990Dec7.171501.18028@mp.cs.niu.edu> <18792@rpp386.cactus.org> <1990Dec8.184047.22221@mp.cs.niu.edu> Organization: I.E.C.C. Lines: 35 In article <1990Dec8.184047.22221@mp.cs.niu.edu> rickert@mp.cs.niu.edu (Neil Rickert) writes: > Why do you completely misinterpret what people are saying. The problem >with quotas and non-root chown is that the file is charged against the >new owner, and the ability to chown allows one to circumvent limits applied. > > Any different meaning of quotas would mean that the system would have to >read the system administrator's mind as to who should be charged for the >file space. Does anyone really do quota accounting by the UID of the file? Consider the following scenario: User A creates a large file. User B links to it. User A then deletes the original link. If you charge by uid, user A is charged for the file even though she has no control over it any more, and might not even be able to see that it exists, depending on B's directory protections. It seems to me that the only plausible way to charge for space is to assign charge responsibility for each directory (with the default being that a directory is charged to the same user as its parent, so you only have to list users' home directories) and to add up the sizes of the files in all of s user's directory, charging 1/Nth of the blocks in an N block file, rounded up. If users can link to shared public files, you might want to make a pre-pass that collects the inumbers of public files and not charge users for links to them. I did this kind of quota (without the public file hack) under 6th edition Unix at Yale in 1976. It's no big deal. Note that none of this depends on UIDs. I suppose you might want to restrict chowns on directories to keep users from ending up with inacessible subtrees, though it's easy enough to write a privileged recovery utility that would chmod a directory to 777 if it's a descendant of the user's home. -- John R. Levine, IECC, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@iecc.cambridge.ma.us, {ima|spdcc|world}!iecc!johnl "Typically supercomputers use a single microprocessor." -Boston Globe