Technical article 109399

Using pg(C), then shell escape and execute mesg(C) changes the file permissions on /dev/tty.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

I execute the command pg(C) either as root, or as a regular user, and take these steps:

- I shell escape, ":!sh" - If I am a regular user, I become root. - I execute the command mesg(C).

The above steps change the permissions on the /dev/tty device to:

crw-rw----   1 root     root       3,  0 Jun  3 15:13 /dev/tty
The original state of the /dev/tty is 666 permissions.  These
permission changes have subsequent problems on programs that
use the /dev/tty device.

According to the man pages, the mesg command should only report the current state without changing it.

Solution

This has been fixed in SCO OpenServer Release 5.0.6.

As a workaround for earlier releases, do not execute mesg(C)
with root privileges in a shell environment in which the
controlling tty is /dev/tty.  To find if this is the controlling
tty, type the tty(C) command.  This will result in /dev/tty, or
some other device.

Make sure to change the permissions of /dev/tty back to 666, as root, using this command:

#chmod 666 /dev/tty

From the Xinuos technical article database, record 109399. Reproduced with permission. The original is at www.sco.com/ta/109399, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.