mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "J.C. Wren" <jcwren@jcwren.com>
To: <linux-kernel@vger.kernel.org>
Subject: Is there a bug with su, and /dev/std*?
Date: Fri, 6 Jun 2003 17:38:33 -0400	[thread overview]
Message-ID: <200306061738.33612.jcwren@jcwren.com> (raw)
In-Reply-To: <Pine.SOL.4.30.0306062228140.13809-100000@mion.elka.pw.edu.pl>

	I was writing a script that writes to /dev/error, and I'm experiencing odd behavior.  This is with a 2.4.18 kernel.

	I login to an account, 'jcw'.

	[jcw@drive jcw]$ echo test_msg >/dev/error
        test_msg
	[jcw@drive jcw]$ su - slimedr
        Password:
        [slimedr@drive jcw]$ echo test_msg >/dev/error
	bash: /dev/stderr: Permission denied

	As user 'jcw' we see

	[jcw@drive jcw]$ ls -l /dev/stderr
	lrwxrwxrwx    1 root     root           17 Mar 11 15:28 /dev/stderr -> ../proc/self/fd/2
	[jcw@drive jcw]$ ls -l /proc/self/fd/2
	lrwx------    1 jcw      jcw            64 Jun  6 17:31 /proc/self/fd/2 -> /dev/pts/5
	
	As user 'slimedr' we see

	[slimedr@drive slimedr]$ ls -l /dev/stderr
	lrwxrwxrwx    1 root     root           17 Mar 11 15:28 /dev/stderr -> ../proc/self/fd/2
	[slimedr@drive slimedr]$ ls -l /proc/self/fd/2
	lrwx------    1 slimedr  slimedr        64 Jun  6 17:34 /proc/self/fd/2 -> /dev/pts/5

	So what gives?  Shouldn't the user context change with 'su -' allow me to write to /dev/stderr and /dev/stdout?


  reply	other threads:[~2003-06-06 21:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-06 18:31 [Patch] 2.5.70-bk11 zlib cleanup #1 local Jörn Engel
2003-06-06 18:32 ` [Patch] 2.5.70-bk11 zlib cleanup #2 cpp Jörn Engel
2003-06-06 18:39   ` [Patch] 2.5.70-bk11 zlib cleanup #3 Z_NULL Jörn Engel
2003-06-06 18:52     ` [Patch] 2.5.70-bk11 zlib cleanup #4 casts Jörn Engel
2003-06-06 19:23       ` [Patch] 2.5.70-bk11 zlib merge #1 turboc Jörn Engel
2003-06-06 19:28         ` [Patch] 2.5.70-bk11 zlib merge #2 return code Jörn Engel
2003-06-06 20:00           ` [Patch] 2.5.70-bk11 zlib merge #3 inffast.c Jörn Engel
2003-06-06 20:13             ` [Patch] 2.5.70-bk11 zlib merge #4 pure magic Jörn Engel
2003-06-06 20:36               ` Bartlomiej Zolnierkiewicz
2003-06-06 21:38                 ` J.C. Wren [this message]
2003-06-07  9:20                 ` Jörn Engel
2003-06-07  9:40               ` Paul Mackerras
2003-06-07 10:02                 ` Jörn Engel
2003-06-07 11:42                   ` Paul Mackerras
2003-06-06 18:54     ` [Patch] 2.5.70-bk11 zlib cleanup #3 Z_NULL Linus Torvalds
2003-06-06 19:13       ` Jörn Engel

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=200306061738.33612.jcwren@jcwren.com \
    --to=jcwren@jcwren.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®