From owner-freebsd-arch Sun Nov 4 2:28:53 2001 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 90A5937B406 for ; Sun, 4 Nov 2001 02:28:49 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id fA4AS0q15788 for ; Sun, 4 Nov 2001 11:28:01 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: arch@freebsd.org Subject: /etc/ttys, /var/run/utmp, ttyslot(3) and {get|put}utx* API From: Poul-Henning Kamp Date: Sun, 04 Nov 2001 11:28:00 +0100 Message-ID: <15786.1004869680@critter.freebsd.dk> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG While thinking about the new cloning behaviour of the PTY driver, my attention again crossed the /etc/ttys vs /var/run/utmp mess. Briefly speaking, all tty devices must be prelisted in /etc/ttys, if they are not, no record will be made in /var/run/utmp and consequently, the user will not show up in who(1). This is a minor security issue. A particular tty's entry in /var/run/utmp is determined by its index in the /etc/ttys file, so if you edit /etc/ttys and change the order, insert or delete a record, you screw up your /var/run/utmp. This is just ugly. To complicate matters, some sessions, like ftp, rsync, scp, ppp and so on should also be registered, but are not reliably so. This is just sloppy, and a minor security hazzle. I guess the correct solution is to implement the Single Unix "{get|put}utx" API backed by a db(3) file. http://www.opengroup.org/onlinepubs/007908799/xsh/endutxent.html Any comments ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message