RE: UNIX question
Posted in 1998
There are two possibilities:
1. Ensure that users other than root can write to /dev/console by setting
the permissions appropriately, which might be '622' in this case (yes,
peculiar permissions, but it gives write permission to group and others,
and the owner can read from it).
2. Run something which is setuid root that writes the message to
/dev/console for the unprivileged user.
Nothing much else is going to work... You could consider using the syslog
interface instead; this is probably preferable to the system administrator
if the sysadmin is aware of its existence.
Yours,
Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h>
----------
From: Steve Romankiw[SMTP:sromankiw@execrisk.com]
Sent: Tuesday, March 17, 1998 11:04 AM
As root, you can send messages to the console by typing "echo hello >
/dev/console".
When I try this as any user besides root, I get a message similar to
"/dev/console: cannot create".
As someone other than root, how would you do something like:
<<snip>>
example# sendtoconsole hello
example# cat sendtoconsole
echo $1 > /dev/console
<<snip>>
JL: I'd be looking at writing something like the code below in the shell
script, but I'm fussy like that...
echo "$*" >/dev/console