*BSD News Article 5308


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!uunet!cs.utexas.edu!asuvax!ncar!hsdndev!husc-news.harvard.edu!burrhus!ddl
From: ddl@burrhus.harvard.edu (Dan Lanciani)
Newsgroups: comp.unix.bsd
Subject: Re: /sbin/init patch (was Re: 386BSD - multiple /sbin/init's in process list, solution ?)
Keywords: 386BSD /sbin/init
Message-ID: <1992Sep20.033906.22930@burrhus.harvard.edu>
Date: 20 Sep 92 03:39:06 GMT
References: <1578@hcshh.hcs.de> <1992Sep18.151351.23495@news.tu-graz.ac.at> <1581@hcshh.hcs.de>
Organization: Harvard University, Cambridge, MA
Lines: 75

In article <1581@hcshh.hcs.de>, hm@hcshh.hcs.de (Hellmuth Michaelis) writes:
| In <1992Sep18.151351.23495@news.tu-graz.ac.at> chmr@fstgds01.tu-graz.ac.at (Christoph Robitschko) writes:
| 
| >In article <1578@hcshh.hcs.de> hm@hcshh.hcs.de (Hellmuth Michaelis) writes:
| >>i (re-) tried to install the /sbin/init program from the original 0.1
| >>distribution in various patched levels.
| >>
| >>all types of init's showed multiples of itself (ca. 10..15) in the 
| >>process list, constantly killing (disappearing) init's from lower pid's
| >>and forking new ones with higher pid's.
| >>
| >>so i have constantly 10-15 init's running, with constantly incementing
| >>process id's (and an increased "background load" ...)
| 
| 
| >This can happen if init cannot execute the programs you specified in /etc/ttys.
| >However, it should also write a message to /dev/console if this happens.
| >Look at your /etc/ttys file and make sure the commands specified therein are
| >executable.
| 
| that hint did it, thank you christoph!
| 
| my entries in /etc/ttys for the pty's looked like this:
| 
| 	ttyp0	none	network		on secure
| 
| (yes, i know this is a security hole ....)
| 
| because the man page ttys(5) says:
| 
| "..... while "secure" (if "on" is also specified) allows users ...."
| 
| what i read from it is, that if you want root logins, you have to specify
| "secure" AND "on", what i did. (btw: if you leave out "on" and just write
| "secure", you can login as root. is it a bug or a feature ?)

	feature

| if init finds the flag corresponding to "on", it tries to execute the
| program "none", which obviously fails ....
| 
| a quick & dirty (because christoph has something in the queue ..) hack-patch
| which solves the problem follows:
| 
| *** init.c.old	Sat Sep 19 17:01:38 1992
| --- init.c	Sat Sep 19 17:09:16 1992
| ***************
| *** 329,335 ****
|   	char *sargv[NARG];
|   	register char *p = arg, **sp = sargv;
|   
| ! 	if(!(tt->tt_status & TTY_ON)) {
|   		tt->tt_pid = -1;
|   		return;
|   	}
| --- 329,335 ----
|   	char *sargv[NARG];
|   	register char *p = arg, **sp = sargv;
|   
| ! 	if((!(tt->tt_status & TTY_ON)) || (!strncmp(tt->tt_getty,"none",4))) {
|   		tt->tt_pid = -1;
|   		return;
|   	}

	No, don't do this.  It isn't a bug.  ``on'' means that you
want to run a getty (or whatever).  The man page that is confusing you
probably doesn't take into account telnetd, rlogind, and other users
of pseudo-ttys which start their own getty/login sequence.  In other
words, pseudo-ttys should be marked ``off'' in /etc/ttys.  Fix the
man page, not the code...
	Oh, and the above hack will break the merge code since it
changes the meaning of ON.

			Dan Lanciani
			ddl@harvard.*