From owner-freebsd-bugs Sun Jun 15 12:40:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA22468 for bugs-outgoing; Sun, 15 Jun 1997 12:40:04 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA22457; Sun, 15 Jun 1997 12:40:02 -0700 (PDT) Resent-Date: Sun, 15 Jun 1997 12:40:02 -0700 (PDT) Resent-Message-Id: <199706151940.MAA22457@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, roman@rpd.univ.kiev.ua Received: (from nobody@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA22342; Sun, 15 Jun 1997 12:36:50 -0700 (PDT) Message-Id: <199706151936.MAA22342@hub.freebsd.org> Date: Sun, 15 Jun 1997 12:36:50 -0700 (PDT) From: roman@rpd.univ.kiev.ua To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/3878: Hang login session if using ttys.deny (or host.deny) capabilities in /etc/login.conf Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 3878 >Category: bin >Synopsis: Hang login session if using ttys.deny (or host.deny) capabilities in /etc/login.conf >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 15 12:40:01 PDT 1997 >Last-Modified: >Originator: Roman D. Sinyuk >Organization: Kiev University >Release: 2.2.2-RELEASE >Environment: FreeBSD boy.rpd.univ.kiev.ua 2.2.2-RELEASE FreeBSD 2.2.2-RELEASE #0: Wed Jun 4 20:01:23 EEST 1997 roman@boy.rpd.univ.kiev.ua:/usr/src/sys/compile/BOY i386 >Description: This problem is result infinite looping in one function libutil. Other small problem is in man login.conf, in this manual instead ttys.deny, ttys.allow refering to tty.deny, tty.allow. >How-To-Repeat: if /etc/login.conf contain ttys.deny for some userclass and if you trying login as user belong to userclass from other than ttys.deny terminal, then login session is hang. For example: $cat /etc/login.conf userclass1:\ :ttys.deny=ttyd2: cat /etc/master.passwd user1:encrypt_passwd:1103:20:userclass1:0:0::/home/user1:/usr/local/bin/bash If you try to login as user1 from ttyd1 - then login process is hang. >Fix: For fix this problem I made some change in function login_strinlist () from libutil. Original function: int login_strinlist(char **list, char const *str, int flags) { int rc = 0; if (str != NULL && *str != '\0') { int i = 0; while (rc == 0 && list[i] != NULL) rc = fnmatch(list[i], str, flags) == 0; } return rc; } To fix problem replace this function on: int login_strinlist(char **list, char const *str, int flags) { int rc = 0; if (str != NULL && *str != '\0') { int i = 0; while (rc == 0 && list[i] != NULL) rc = fnmatch(list[i++], str, flags) == 0; } return rc; } After recompile libutil, login work fine. >Audit-Trail: >Unformatted: