lkml.org 
[lkml]   [2003]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectIs there a bug with su, and /dev/std*?
Date
	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?

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

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