Date: Sun, 15 Jun 1997 12:36:50 -0700 (PDT) From: roman@rpd.univ.kiev.ua To: freebsd-gnats-submit@FreeBSD.ORG Subject: bin/3878: Hang login session if using ttys.deny (or host.deny) capabilities in /etc/login.conf Message-ID: <199706151936.MAA22342@hub.freebsd.org> Resent-Message-ID: <199706151940.MAA22457@hub.freebsd.org>
index | next in thread | raw e-mail
>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:
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706151936.MAA22342>
