[1701] in linux-security and linux-alert archive

home help back first fref pref prev next nref lref last post

[linux-security] Re: Re: Re: Towards a solution of tmp-file problems (fwd)

daemon@ATHENA.MIT.EDU (Nick Andrew)
Thu Mar 12 04:11:55 1998

From: Nick Andrew <nick@zeta.org.au>
To: linux-security@redhat.com
Date: Thu, 12 Mar 1998 08:55:19 +1100 (EST)
Resent-From: linux-security@redhat.com
Reply-To: linux-security@redhat.com

Forwarding a message from Steve \"Stevers!\" Coile:
> This is already possible.  Create the file then unlink it.  The file
> contents aren't deleted and i-node isn't released until the file is
> closed.

Without kernel support, unlinking the file at creation time requires
a code change in the process which creates the file. And this doesn't
protect scripts which use temp files for communication between their
subprocesses, e.g.

#!/bin/sh

cat > /tmp/a.$$
awk ' { print $1 } ' < /tmp.a.$$ | sort -o /tmp/field1.$$
awk ' { print $2 } ' < /tmp.a.$$ | sort -o /tmp/field2.$$
paste /tmp/field1.$$ /tmp/field2.$$
rm -f /tmp/a.$$ /tmp/field1.$$ /tmp/field2.$$
exit 0

A private namespace protects this script and its subprocesses by making the
files _totally_ inaccessible to unrelated processes. The private namespace
can be imposed from above or the script can define its own.

Nick.
-- 
Zeta Internet                     SP4   Fax: +61-2-9233-6545 Voice: 9231-9400
G.P.O. Box 3400, Sydney NSW 1043        http://www.zeta.org.au/

-- 
----------------------------------------------------------------------
Please refer to the information about this list as well as general
information about Linux security at http://www.aoy.com/Linux/Security.
----------------------------------------------------------------------

To unsubscribe: mail -s unsubscribe test-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post