Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2000 09:57:01 -0500 (EST)
From:      Richard J Kuhns <rjk@grauel.com>
To:        stable@FreeBSD.ORG
Subject:   Re: Something strange with top, truss, and termcap
Message-ID:  <14869.18237.773120.922251@moriarity.grauel.com>
In-Reply-To: <14869.17229.49954.884086@moriarity.grauel.com>
References:  <14869.17229.49954.884086@moriarity.grauel.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Richard J Kuhns writes:
 > I'm having something strange happen on a -stable system that was built
 > (world and kernel) on 11/13.
 > 
 > I'm playing around with Eterm, and have created an eterm terminal
 > description that I put in ~/.termcap.  This seems to work just fine for
 > everything (jove, vi, etc) except top, which says
 > "top: can't open termcap file".
 > 
 > I thought I'd use truss to find out more precisely what was going on, but
 > it gives me no output at all.  "truss -o truss.top top" runs top just fine,
 > but truss.top is empty.  "truss -o truss.ls ls" works like it should.
 > 
 > Comments?

As usual, I found something right after I posted.  I presume truss doesn't
produce any output since it's a setgid.  I had tried running it under truss
as root, but it still didn't create any output.

I just now tried the following as root:

: moriarity#~; cp /usr/bin/top /var/tmp
: moriarity#~; TERM=eterm truss -o /var/tmp/truss.top /var/tmp/top

and it worked perfectly, not only creating a 1.5M truss.top file but
also not having any trouble accessing my local termcap file.

A little more experimenting has shown me that any setgid/setuid binary
won't read a local termcap.  Is this intentional?  I guess I can understand
it if you're afraid of buffer overflows in ncurses, but it makes it harder
to upgrade a system since I have to manually append the new entry to
/usr/share/misc/termcap and remake termcap.db after installworld.

I think truss should produce output even on set[ug]id binaries when run as
root, though.

-- 
Richard Kuhns			rjk@grauel.com
PO Box 6249			Tel: (765)477-6000 \
100 Sawmill Road				    x319
Lafayette, IN  47903		     (800)489-4891 /


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14869.18237.773120.922251>