Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2008 09:33:05 -0200
From:      "Carlos A. M. dos Santos" <unixmania@gmail.com>
To:        "Ed Schouten" <ed@80386.nl>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: [Testers wanted] /dev/console cleanups
Message-ID:  <e71790db0811190333y6a943b03teba1df92274a8c73@mail.gmail.com>
In-Reply-To: <20081118213410.GA81783@hoeg.nl>
References:  <e71790db0810271936r1ce4619an1d64c6aae62c3ec1@mail.gmail.com> <20081028081154.GQ6808@hoeg.nl> <20081118213410.GA81783@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 18, 2008 at 7:34 PM, Ed Schouten <ed@80386.nl> wrote:
> Hello Carlos, others,
>
> * Ed Schouten <ed@80386.nl> 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



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