Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site fortune.UUCP Path: utzoo!linus!decvax!harpo!ihnp4!fortune!olson From: olson@fortune.UUCP Newsgroups: net.unix-wizards Subject: chroot(2) and ttyname(3) problem - (nf) Message-ID: <2944@fortune.UUCP> Date: Tue, 3-Apr-84 15:08:33 EST Article-I.D.: fortune.2944 Posted: Tue Apr 3 15:08:33 1984 Date-Received: Thu, 5-Apr-84 01:41:41 EST Sender: notes@fortune.UUCP Organization: Fortune Systems, Redwood City, CA Lines: 35 #N:fortune:11600081:000:1487 fortune!olson Apr 3 10:20:00 1984 I am in the process of setting up some restricted logins (using chroot(2), a modified login, etc.). (This is on a V7/4.1 BSD hybrid) I have just run into an annoying problem, and would appreciate any solutions you can suggest. The problem is that (for space reasons) I am setting up the restricted root on a different device than the root pack. For most programs, this is not a problem. However, any program which uses ttyname(3) can not get the tty name. The problem is that ttyname checks NOT the real device number, but the device number AND the inode number OF THE FILE /dev/tty*. Why did they not simply check for the REAL device number? Since my root is on a different device, the inode numbers of the tty's are different, and hence, ttyname(), and the programs which use it (tty(1), who am i (1), etc.) all come back with 'not a tty', or '??', etc. While this is certainly not fatal, it is annoying. Does anyone have any ideas, other than fixing ttyname(), and recompiling everything that uses it? Parenthetically, does anyone know why ttyname was written this way, given the fact that chroot(2) has been around in one form or another for quite a while? (I suspect the main reason was so a tty device could have several names (NOT links!) and have the correct one reported. If this was the case, it appears that the impact of chroot() was not thought through. Dave Olson, Fortune Systems UUCP: {ihnp4,ucbvax!amd70}!fortune!olson ARPA: amd70!fortune!olson@BERKELEY