From owner-freebsd-stable Fri Nov 17 6:58: 0 2000 Delivered-To: freebsd-stable@freebsd.org Received: from moriarity.grauel.com (moriarity.grauel.com [199.233.104.37]) by hub.freebsd.org (Postfix) with ESMTP id B81B737B479 for ; Fri, 17 Nov 2000 06:57:57 -0800 (PST) Received: (from rjk@localhost) by moriarity.grauel.com (8.11.1/8.11.1) id eAHEv1l19720; Fri, 17 Nov 2000 09:57:01 -0500 (EST) (envelope-from rjk) From: Richard J Kuhns MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14869.18237.773120.922251@moriarity.grauel.com> Date: Fri, 17 Nov 2000 09:57:01 -0500 (EST) To: stable@FreeBSD.ORG Subject: Re: Something strange with top, truss, and termcap In-Reply-To: <14869.17229.49954.884086@moriarity.grauel.com> References: <14869.17229.49954.884086@moriarity.grauel.com> X-Mailer: VM 6.75 under 21.1 (patch 11) "Carlsbad Caverns" XEmacs Lucid Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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