lkml.org 
[lkml]   [1999]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC][PATCH] scripts with stdin replaced
On  5 Jul, Richard Guenther wrote:
+-----
| On Mon, 5 Jul 1999, Jamie Lokier wrote:
| > - Open fd 3, pass /proc/self/fd/3 as the script name.
|
| And rewrite each program to _not_ open("/proc/self/fd/3") as
| this is just a symlink to the real file, i.e. I could have passed
| the filename right away.
+--->8

bzzzt. It's not really a symlink; it's just made to look like one so
e.g . ls on /proc/*/fd behaves semi-sanely. (Remember, /proc isn't a
normal filesystem.)

You can't apply normal symlink-replacement attacks against
/proc/self/fd/*: the only way to alter or replace those is to modify
the process's in-kernel file table. It is therefore a safe way to pass
the script.

--
brandon s. allbery [os/2][linux][solaris][japh] allbery@kf8nh.apk.net
system administrator [WAY too many hats] allbery@ece.cmu.edu
carnegie mellon / electrical and computer engineering KF8NH
We are Linux. Resistance is an indication that you missed the point.


-
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:52    [W:0.022 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site