More on chroot()'s history, and my blind spot about System III

October 25, 2015

In a comment on my entry on chroot()'s history, Greg A. Woods noted that System III is the first Unix where chroot() actually prevents your process from just doing chdir("/..") to escape the new root directory. System III predates 4.x BSD, so I was more or less wrong in my entry on this. Only in the BSD line was 4.1c the starting point for this bit of chroot() security. System III source code is even available online here, so I could have checked and seen this myself if I'd thought of it.

I didn't, though, and that's because I have a blind spot about System III. For a long time Unix was split into two sides, which I'll call the university side and the commercial side. BSD and all of its descendents come from the university side; System III and then System V came from the commercial side. The university side dominated both in universities themselves and in Sun and DEC workstations that more or less derived from that environment, while the commercial side mostly wound up in high end big iron servers.

(SGI was an odd case; it was System V derived but had a bunch of BSD stuff added. This caused a certain amount of heartburn in people who dealt with it.)

Although I've used System V machines, in cultural terms I come from the university side of Unix; it's what I have the most exposure to, what I'm most familiar with, and as a result it's what I reflexively think of as 'real Unix'. In other words, it's a tribal affiliation. With a few exceptions I tend to just assume that BSD did something first and best, and that System V had a lot of hacks. So when I was looking at the history of chroot(), I didn't pay a lot of attention to System III; I didn't really look to see the state of chroot() in it, and I didn't actually look at its release date (which is surprisingly early).

(It looks like System III and information about it probably wasn't publicly available early enough to influence BSD's chroot() stuff, but it's at least possible I'm wrong here and that hearing about chroot() security in System III helped push BSD to implement it.)

This is, of course, kind of a mistake. System III and later System V had their own innovations, chroot() security among them, and I shouldn't dismiss their contributions to Unix so reflexively and tribally (even if AT&T too often had terrible ideas there).

Comments on this page:

SunOS was even odder than SGI's Irix. It started of as a BSD derived system (not really a surprise given Bill Joy's affiliation with Berkeley), but then they replaced large swaths of code with what they got from AT&T - which was System V. This code eventually turned into Solaris. Check a Solaris 10 box and you'll find /usr/ucb with (ancient) BSD-compatible tools.

By cks at 2015-10-25 14:56:34:

Sun essentially had two Unixes over its history. SunOS (later retconned into 'Solaris 1') was BSD, while Solaris 2+ was System V Release 4. System V R4 itself was the product of a grand Unix unification between Sun and AT&T in which System V R3 picked up massive amounts of BSD features and became much more BSD-like than before.

(System V before R4 was a very different place for BSD people. If I remember right, there was no job control in the shell, people couldn't be in multiple groups, and any number of other similar core differences.)

Written on 25 October 2015.
« How my PS/2 to USB conversion issues have shaken out
The null sender spammers now seem to be entrenched on »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun Oct 25 01:35:33 2015
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.