public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: RFC: /dev/stdin, symlinks & permissions
Date: Tue, 18 Mar 2008 00:54:40 +0100	[thread overview]
Message-ID: <jeabkwaou7.fsf@sykes.suse.de> (raw)
In-Reply-To: <47DEFE26.80101@msgid.tls.msk.ru> (Michael Tokarev's message of "Tue\, 18 Mar 2008 02\:26\:30 +0300")

Michael Tokarev <mjt@tls.msk.ru> writes:

>   # ls -l /dev/pts/0
>   crw--w---- 1 root tty 136, 0 Mar 18 02:19 /dev/pts/0
>
> So far so good.  Now, I change uid to something else, --
> doing su(8) to "mjt".  /proc/self changed obviously,
> but stdin &Co is still here, and points to the same
> /dev/pts/0.  But *its* permissions/ownership did not
> change!  So now I can't, for example,
>
>  $ echo x > /dev/stdout
>  bash: /dev/stdout: Permission denied
>
> which is quite unexpected - I for one expect /dev/stdout
> to work the way very similar to /dev/tty, to mean "current
> standard output regardless of any permissions etc".

This has nothing to do with /dev/stdout.  Your terminal simply does not
allow access by anyone except user root or group tty.  You need to open
it up first, or mount /dev/pts with broader permissions (which is a bad
idea however).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2008-03-17 23:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 23:26 RFC: /dev/stdin, symlinks & permissions Michael Tokarev
2008-03-17 23:54 ` Andreas Schwab [this message]
2008-03-18  7:24   ` Michael Tokarev
2008-03-18 12:54     ` Theodore Tso
2008-03-18 14:32       ` Al Viro
2008-03-18 15:04         ` Theodore Tso
2008-03-23 16:50           ` H. Peter Anvin
2008-03-23  4:35         ` Denys Vlasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jeabkwaou7.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox