lkml.org 
[lkml]   [1999]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: UNIX98 Ptys and chroot bug/question
On Wed, 24 Nov 1999, Valentin Podlovchenko wrote:

> crw--w---- 1 valya tty 136, 0 Nov 24 13:25 0
> crw--w--w- 1 root root 136, 1 Nov 24 13:25 1
>
> in chroot:
> >chroot /web/ !!
> chroot /web/ ls -l /dev/pts/
> total 0
> crw--w--w- 1 root root 136, 0 Nov 24 12:16 0
> crw--w---- 1 valya tty 136, 1 Nov 24 13:25 1
[...]
> so any user from basic root system can write to chrooted pty and
> any user from chroot can write to basic root ptys.
>
> It seems to me slightly wrong ;)

I'm surprised that you say /dev/pts/1 (or 0) is rw--w--w- in partition
and rw--w---- in the other. However, it might be a typo or ok, if the
Unix98ptys just take the permissions of the filesystem, and the
corresponding login process sets the permissions

Anyway, its simply ok that anyone has write only permission on the pty.
The intentional result is that anyuser can send you a message into
you login session. And, almost any full screen unix program (editor etc)
has a screen refresh key (very often ^V) to redraw teh screen and
purge any messages. ( The key is exactly to remove such msges, not to
redraw when the screen was garbled due to a bug ;-) )

If you want peace from msgs of other people, the 'mesg' command allows
you to enable/disable this. All it does is: Remove the write permission
for group and others from the corresponding tty.

Note that others have no read permission, so they can neither modify
control parameters by ioctl, nor rob keystrokes. They can only print
something to you.

> And one problem too:
> After some days work well my server in chrooted partition loose possibility
> to log users in by telnet. I think it is because of some problems with ptys but
> I wouldn't say it with certainty... ;)

I've no idea about that. It might be related to having those two mounts of
Unix98 ptys, maybe something with ownership permission goes wrong, I
dunno.

Michael.

--

Michael Weller: eowmob@exp-math.uni-essen.de, eowmob@ms.exp-math.uni-essen.de,
or even mat42b@spi.power.uni-essen.de. If you encounter an eowmob account on
any machine in the net, it's very likely it's me.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.284 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site