A question on ownership of tty*'s when using openlook 3.0..

A question on ownership of tty*'s when using openlook 3.0..

Post by Vinay Somashek » Mon, 12 Apr 1993 13:57:26



Hello..

I have a sought of peculiar question concerning ownership of terminals
while using openlook 3.0 on a SUN Network (running SOLARIS 1.2).
Only the console terminal is owned by the user on a particular machine,
when openlook is executed a number of windows or terminals come into
existence but apparently all these terminals have root as their owner.
This info. is obtained by typing in 'who' to find out all the terminals
u are currently using. Then ownership of these terminals can be checked by
typing in 'ls -l /dev/ttyp*' considering u are using terminals console,ttyp0,
ttyp1 & ttyp2. It so happens that only console is owned by the user and the
rest of these terminals owned by root. So whenever the user opens up a new
cmdtool a small message is echoed as the first line on the screen of this
new cmdtool saying "/dev/ttyp3 not owner".
Can someone tell me what exactly is responsible for giving ownership of
these new terminals to the user instead of being  owned by root. I also
figured that one is not able to set 'mesg n' as the tty's are not owned
by the user.
Setting 'mesg n or y' is basically giving nowrite or write permissions to
group and others. This can also be done using the 'chmod' command on the
terminals u own.
This has been happening for quite some time on our SUN network using Openlook
3.0, but I have'nt been able to figure out why this  is happening.

Any ideas as to what might be happening and how I could set this right?

Thanx

Vinay



 
 
 

A question on ownership of tty*'s when using openlook 3.0..

Post by Barry Margol » Tue, 13 Apr 1993 00:44:10



Quote:>I have a sought of peculiar question concerning ownership of terminals

What's a "sought"? :-)

Quote:>while using openlook 3.0 on a SUN Network (running SOLARIS 1.2).
>Only the console terminal is owned by the user on a particular machine,
>when openlook is executed a number of windows or terminals come into
>existence but apparently all these terminals have root as their owner.
>This info. is obtained by typing in 'who' to find out all the terminals
>u are currently using.

You can also be using terminals that aren't listed by who(1).  It just
lists the ones that are registered in /etc/utmp.

Quote:>                    Then ownership of these terminals can be checked by
>typing in 'ls -l /dev/ttyp*' considering u are using terminals console,ttyp0,
>ttyp1 & ttyp2. It so happens that only console is owned by the user and the
>rest of these terminals owned by root. So whenever the user opens up a new
>cmdtool a small message is echoed as the first line on the screen of this
>new cmdtool saying "/dev/ttyp3 not owner".
>Can someone tell me what exactly is responsible for giving ownership of
>these new terminals to the user instead of being  owned by root.

The program that allocates the terminal to the user is responsible for
this.  When you login normally login(1) does it.  In the case of
OpenWindows, it's cmdtool or shelltool that should do it.  However, they
can't do it because they're not setuid to root.  (No, don't just make them
setuid -- I don't think they're designed to run that way, so they won't
revert to your normal uid before starting the shell).

Quote:>                                                              I also
>figured that one is not able to set 'mesg n' as the tty's are not owned
>by the user.

In fact, this is probably what's printing out the "not owner" error message
you see.

You could try making /usrbin/mesg setuid to root.
--
Barry Margolin
System Manager, Thinking Machines Corp.



 
 
 

A question on ownership of tty*'s when using openlook 3.0..

Post by James P. Boy » Sun, 18 Apr 1993 07:26:40


Previous articles have discussed problems w/ terminals not being owned

I run sunos 4.1.3 w/ openwin also, but use xterms for console and terminal
I also am not the owner of my terminals.  Therefore biff doesn't work,
yet xbiff does (as well as biff if I have telnet'd in).  Another wierd
ownership problem w/ this computer is that the X-sockets in /tmp are owned
by the first person to create them, therefore we had to put everybody in
the same group to allow diff't users the abillity to openwin.  If anybody
had either of these troubles and fixed it I'd love to hear about it.

                                -Jim

 
 
 

A question on ownership of tty*'s when using openlook 3.0..

Post by Oleg Kibir » Sun, 18 Apr 1993 20:46:33



   Previous articles have discussed problems w/ terminals not being owned

   I run sunos 4.1.3 w/ openwin also, but use xterms for console and terminal
   I also am not the owner of my terminals.  Therefore biff doesn't work,
   yet xbiff does (as well as biff if I have telnet'd in).  Another wierd
   ownership problem w/ this computer is that the X-sockets in /tmp are owned
   by the first person to create them, therefore we had to put everybody in
   the same group to allow diff't users the abillity to openwin.  If anybody
   had either of these troubles and fixed it I'd love to hear about it.

xterm needs to be suid root to change owner of the terminals. It's not
in standard OpenWin  installation. Unfortunately cmdtool and shelltool
were not designed to run setuid

Oleg

 
 
 

1. question about pppd, pty's and tty's

I'm attempting to get pppd to talk to my application instead of the serial
port (long story, but I need to intercept the packets).

pppd insists on using a device, so someone recommended I use pty-redir,
and I found pty-redir-0.1, but no author attribution.  The way it was
explained to me, running pty-redir on my application would open a pty,
which pppd could then talk to through it's corresponding tty.

Unfortunately, this did not work.  pppd can talk to my application just
fine, but return packets are dropped on the floor.  pppd never sees the
packets.

Furthermore, I wrote a quick program that just opens the pty and tty and
attempts to talk to each other.

It's as simple as

int fd = open ( "/dev/ptyrf", O_RDWR );

while (1)
   {
   length = read( fd, buffer, 1024 );
   fprintf( stderr, buffer );
   write( fd, "foo", 4 );
   }

The other program is the same, but it opens /dev/ttyrf

There is also an option for sending a line after opening the file descriptor.

Here is the problem.  The side that opens the pty, it receives everything
from the tty side, but it also receives everything it writes.

The tty side, it can write everything fine, but it never receives a thing.

Can anyone tell me what I'm doing wrong?  This seems very very simple.

2. Yggdrasil & Aztech CD-ROM players

3. tty ownership problems

4. Matrox G450 and Xfree86 question

5. creating tty's, mknod, stuck after boot with wrong tty - help

6. Sudden lockups when overloading a socket?

7. What is 'stty', 'term' & 'tty'

8. Conexant modem under Redhat 7.3

9. tty-less processes with tty's open

10. Ownership of /dev/tty*: Does it change regularly?

11. Odd 'w', 'who' and 'tty' output

12. tty ownership

13. TTY's using telnet