[net.unix-wizards] recent xenix flame

shawn%mit-dspg@BRL.ARPA (01/06/84)

>From shawn Thu Jan  5 20:43:53 1984 remote from futura
To: bug-system
Subject: /dev/null


Its not clear what the 'right' thing to do here is, but it seems
that /dev/null (like in all other versions of unix), permits a program
to unlink it. This is generally bad. One reasonable thing to do, to
prevent this, is as follows:

1)	User program, (say an editor like elle), wan'ts to write to /dev/null,
	it makes a link to a '/dev/null.O' file, and unlinks /dev/null,
	then it writes out your data into the now DATA FILE /dev/null.

Ok, that's my problem, here's the fix:

Kernel gets 'unlink("/dev/null")',

Is file a special file? (yes), ok, then does it have the 'directory file bit'
set? No? then return error. anything else returns ok if the user has the
right access.

The basic idea is that on a special file, the directory bit is not used,
normally, (ok, some systems use it to hack with network software, but
this will not do any harm to even that type software).. and haveing to set
the d bit to a file, before being able to delete it, seems to be alot
better then haveing editors that don't know about /dev/null, and /dev/tty01,
etc, removeing DEVICE files, when people are hacking as root. I had this
happen, I must say, its somewhat strange to see a 100 block /dev/null.

			Yours In Hacking,
			  -- Shawn

p.s.
This letter is aimed at TRS-XENIX, by Radio (S)Hack, But I am
sending it off to the net world in hopes that someone might like it
and unix might adopt it, or someone will explain why this is a bad idea,
in any case, its my complete hope, tandy will addopt SOMETHING to keep
/dev/null from being removed, and '/dev/tty' is also a must.
(tandy and other vendors should know that THEY have to be 10* more careful
dealing with the general public).

mike%brl-vgr@sri-unix.UUCP (01/06/84)

From:      Mike Muuss <mike@brl-vgr>

Shawn -

On every UNIX system I have ever seen, the directory /dev is keep
writable only to the Superuser, so that only the Superuser can
add and delete entries from /dev.  Permitting user programs to
unlink /dev/null can induce intersting failure modes into otherwise
healthy programs...

Obviously, your system needs a CHMOD command, quick!
		-Mike

olson@fortune.UUCP (01/12/84)

#R:sri-arpa:-1519300:fortune:11600040:000:574
fortune!olson    Jan 11 12:21:00 1984

The point you are missing here is that this is a micro. (And probably
a single user one at that!).

In this situation, you FREQUENTLY have a naive user who can become the
superuser.  What was being suggested/requested was a change to protect
these naive superusers from themselves.

We have similar problems with naive superusers, and a fair amount
of support is simply fixing up the things that naive (and not so
naive) superusers have done to their systems.

	Dave Olson, Fortune Systems
	UUCP: {ihnp4,harpo,ucbvax!amd70}!fortune!olson
	ARPA: amd70!fortune!olson@BERKELEY