🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #523

Re: Unlinking "."

#523
From: guy
Date: Sun, 05 Apr 1987 12:31
42 lines
2793 bytes
>Doug is right about the races, but if you start moving all of the utilities
>into the kernel, Sys5 will wind up looking a little fat.  There are plenty
>of good reasons to let people unlink "." and "..".  Fix the races instead.

Wrongo.  First of all, you're not moving "the utilities" into the
kernel.  There's more to the "mkdir" and "rmdir" than the system
calls of the same name.

Second of all, there are some annoying restrictions caused by the
lack of these calls; a program that is set-UID to somebody other than
"root" can't create or destroy directories using its set-UID
protection, since the "mkdir" and "rmdir" commands must be set-UID
"root" and, as such, will throw away the old set-UID privileges when
they are run (remember, vanilla V7, S3, and S5 won't let you set the
real UID to match the effective UID).

Third of all, directories are an abstraction whose implementation is
hidden from applications when you do lookups of names in directories
or creation of new names.  As such, the implementation of directories
should be hidden from programs creating or destroying them as well.

You might barely be able to argue against this in systems that
support only one type of file system.  However, both systems using
the Sun "vnode" mechanism or the S5R3 File System Switch can support
many *different* types of file systems, not all of which would permit
you to create directories using the code from the old-style "mkdir"
command or to remove them using the code from the old-style "rmdir"
command.

The cleanest way of doing this is to make "mkdir" and "rmdir" into
system calls and provide per-file-system-type entries for creating
and removing directories.

Even if it were possible to fix the races without providing "mkdir"
and "rmdir" system calls, that wouldn't be a reason to "fix the
races" and leave those calls out of the kernel.  Yeah, it makes the
system fatter, but if you really worry about every single thing that
is put into system you should be running V6.  (I'd rather not, thank
you.)

And if you don't want S5 to acquire "mkdir" and "rmdir", you're too
late.  They're already there.
Technical Details
Message-ID: <16186@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!think!ames!ucbcad!ucbvax!decvax!decwrl!sun!gorodish!guy
References: <1059@cci632.UUCP> <5715@brl-smoke.ARPA> <736@killer.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!think!ames!ucbcad!ucbvax!decvax!decwrl!sun!gorodish!guy
From: guy@gorodish.UUCP
Newsgroups: comp.bugs.sys5
Subject: Re: Unlinking "."
Message-ID: <16186@sun.uucp>
Date: Sun, 5-Apr-87 07:31:42 EST
Article-I.D.: sun.16186
Posted: Sun Apr  5 07:31:42 1987
Date-Received: Sun, 5-Apr-87 22:37:57 EST
References: <1059@cci632.UUCP> <5715@brl-smoke.ARPA> <736@killer.UUCP>
Sender: news@sun.uucp
Reply-To: guy@sun.UUCP (Guy Harris)
Organization: Sun Microsystems, Mountain View
Lines: 42
Keywords: unlink