From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 11:33:07 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1201E1065672 for ; Wed, 19 Nov 2008 11:33:07 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 91DAB8FC0A for ; Wed, 19 Nov 2008 11:33:06 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: by ey-out-2122.google.com with SMTP id 6so1336800eyi.7 for ; Wed, 19 Nov 2008 03:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=jNaKXFiqoCphnDHLk7s5nIjtPdHHLvR7RhgSaxhZ3aw=; b=d6pB/PIvDGTi5mbi32nSFNZ26LB1rUXM1V+lIhtVHtNe1ayuf+IaitAcCE3B/WGoYX IK9JCcJAjq5DGCl480quBH4p9Zo12yuF/qsAQNiPMWa/sj4OyDAf5oSSG7VlwyVokrIO 288xBY0y7dXMPdlMhy032X6L+0vfF4OcemwF8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=GpsmNQjeKCSMAYZ6D+cICIqMyUQQ32T73eMQdsueS468hHFMvlh2+JcG7qI+trgILY l14aueeEEkWv56ES4FO8n1nc9f8eobGJ9GZiNls6+8gtQGLdyB0VGA0JliqUzDGj5BlL XH0V6gYwTTuurL8dxq27STClXgfbb8/dif4HY= Received: by 10.103.229.12 with SMTP id g12mr330236mur.87.1227094385313; Wed, 19 Nov 2008 03:33:05 -0800 (PST) Received: by 10.103.137.8 with HTTP; Wed, 19 Nov 2008 03:33:05 -0800 (PST) Message-ID: Date: Wed, 19 Nov 2008 09:33:05 -0200 From: "Carlos A. M. dos Santos" To: "Ed Schouten" In-Reply-To: <20081118213410.GA81783@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081028081154.GQ6808@hoeg.nl> <20081118213410.GA81783@hoeg.nl> Cc: FreeBSD Hackers Subject: Re: [Testers wanted] /dev/console cleanups X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 11:33:07 -0000 On Tue, Nov 18, 2008 at 7:34 PM, Ed Schouten wrote: > Hello Carlos, others, > > * Ed Schouten wrote: >> About the /dev/console issues: Robert Watson and I discussed this some >> time ago on IRC and what I did in HEAD (not RELENG_7) was that I changed >> TIOCCONS not to take a look at the permissions of /dev/console, but we >> changed it to use priv_check(). This means that right now you can only >> call TIOCCONS as root. I can't really understand why the problem exists >> on RELENG_7. >> >> About making xconsole setuid: I've read the messages you mentioned, but >> I think we could just alter console to call TIOCCONS and just drop >> privileges. An even better solution would be to just get rid of TIOCCONS >> and invent a better solution to capture syslog messages. I can't really >> understand why we want to abuse TTY's to do this. >> >> So I can't say we're working on this, but at least I can confirm the >> issue. > > One solution would be to let xconsole just display /var/log/messages. > There shouldn't be a valid reason to let syslogd print messages to > /dev/console and capture them again using TIOCCONS. We could just > instruct xconsole to read its data from the log files. > > If you save the attached patch as /usr/ports/x11/xconsole/files/ > patch-xconsole.c (create directory first) and recompile xconsole, it > will use the log file. > > I'll discuss this with others to decide if we should take such an > approach. It is not necessary to patch xconsole to accomplish this. Using the -file command line argument would be enough. Be warned, however, that 1. messages sent straight to /dev/console will not show up at the xconsole window; 2. with large files it will become slow and consume lots of memory, because it will load the entire contents of /mar/log/messages to its text buffer; 3. it will show *all* messages, not only the urgent ones, which is not necessarily the desired behavior; 4. it will stop working upon log rotation. -- cd /usr/ports/sysutils/life make clean