Messages to the console

David Elliott dce at smsc.sony.com
Wed Nov 28 03:10:46 AEST 1990


In article <25112 at adm.brl.mil> sct60a.sunyct.edu!buck at sct60a.sunyct.edu (Jesse R. Buckley Jr.) writes:
>
>On Nov 26, 16:10, iis!venkat%sun.com at nisc.nyser.net wrote:
>} I have a process running in the background at all times which performs certain
>} tasks. How can my process write messages to the system console irrespective 
>} of who owns /dev/console? Any responses will be appreciated. 
>
>  Simple, just make your process Set uid root.

Which may or may not be simple.

Even assuming that Venkat has root priveleges, changing just any old
program to be setuid can have serious consequences.  I recently found
that a program that had been changed to setuid root for using the
SVR4 real-time scheduler didn't deal with file access correctly, and
could be used by anyone to overwrite any file in the system.

In this case, I believe it's better to use some connection to syslog
(either the syslog subroutine or the logger program), since that will
allow for configuration of the messages.  Programs (including parts
of the kernel) should avoid writing directly to the console.



More information about the Comp.unix.questions mailing list