From owner-freebsd-bugs Fri Sep 19 14:50:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA11732 for bugs-outgoing; Fri, 19 Sep 1997 14:50:06 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA11722; Fri, 19 Sep 1997 14:50:02 -0700 (PDT) Resent-Date: Fri, 19 Sep 1997 14:50:02 -0700 (PDT) Resent-Message-Id: <199709192150.OAA11722@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, arnej@math.ntnu.no Received: from romberg.math.ntnu.no (153@romberg.imf.unit.no [129.241.15.150]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id OAA11059 for ; Fri, 19 Sep 1997 14:40:18 -0700 (PDT) Received: (qmail 12319 invoked from network); 19 Sep 1997 21:40:14 -0000 Received: from frida.math.ntnu.no (129.241.15.136) by romberg.imf.unit.no with SMTP; 19 Sep 1997 21:40:14 -0000 Received: (from arnej@localhost) by frida.math.ntnu.no (8.8.7/8.8.4) id XAA21866; Fri, 19 Sep 1997 23:40:13 +0200 (MEST) Message-Id: <199709192140.XAA21866@frida.math.ntnu.no> Date: Fri, 19 Sep 1997 23:40:13 +0200 (MEST) From: arnej@math.ntnu.no Reply-To: arnej@math.ntnu.no To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4585: termcap search fails too early Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4585 >Category: bin >Synopsis: termcap search fails too early >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 19 14:50:00 PDT 1997 >Last-Modified: >Originator: Arne Henrik Juul >Organization: Norwegian University of Technology and Science >Release: FreeBSD 2.2-STABLE i386 >Environment: >Description: The routines to find termcap entries (ultimately ending up in getent in libc) has problems if it has problems opening your ~/.termcap; only ENOENT is ignored. But there may be other reasons why this fails and it should proceed to try /usr/share/misc/termcap; we got the problem when xterm couldn't access the home directory (because xterm is suid root, the home directory was on NFS without root privs, and was mod 700). Other failure modes could probably be found as well. >How-To-Repeat: Have a home directory on NFS, mounted without root privs, mode 700, then try starting xterm. You should get the rather obscure message "unable to find usable termcap entry." >Fix: Patch from NetBSD: Index: src/lib/libc/gen/getcap.c =================================================================== RCS file: /usr/cvs/src/lib/libc/gen/getcap.c,v retrieving revision 1.4 diff -u -r1.4 getcap.c --- getcap.c 1995/10/22 14:36:15 1.4 +++ getcap.c 1997/09/19 21:26:27 @@ -269,10 +269,7 @@ fd = open(*db_p, O_RDONLY, 0); if (fd < 0) { /* No error on unfound file. */ - if (errno == ENOENT) - continue; - free(record); - return (-2); + continue; } myfd = 1; } >Audit-Trail: >Unformatted: