Date: Fri, 19 Sep 1997 23:40:13 +0200 (MEST) From: arnej@math.ntnu.no To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/4585: termcap search fails too early Message-ID: <199709192140.XAA21866@frida.math.ntnu.no> Resent-Message-ID: <199709192150.OAA11722@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709192140.XAA21866>
