public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - rgmanager: randomize svclib_nfslock temp dir
@ 2009-05-21 14:29 Lon Hohberger
  0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-05-21 14:29 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c3ca8bc855e3b01c0ca6e169b0d68eee622983e2
Commit:        c3ca8bc855e3b01c0ca6e169b0d68eee622983e2
Parent:        a36c34552f1655d542ada70a4f3bad45fb602bb5
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Thu Oct 30 12:36:05 2008 +0100
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Thu May 21 10:27:58 2009 -0400

rgmanager: randomize svclib_nfslock temp dir

by using a static path to /tmp, the operation can be used to trigger
a local DoS by a normal user.

Randomize temp dir via mktemp.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 rgmanager/src/resources/svclib_nfslock |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/rgmanager/src/resources/svclib_nfslock b/rgmanager/src/resources/svclib_nfslock
index 2101e1e..a0250b2 100644
--- a/rgmanager/src/resources/svclib_nfslock
+++ b/rgmanager/src/resources/svclib_nfslock
@@ -37,7 +37,7 @@
 #
 nfslock_statd_notify()
 {
-	declare tmpdir=/tmp/statd-$2.$$
+	declare tmpdir=$(mktemp -d /tmp/statd-$2.XXXXXX)
 	declare nl_dir=$1
 	declare nl_ip=$2
 	declare command		# Work around bugs in rpc.statd
@@ -55,7 +55,6 @@ nfslock_statd_notify()
 	fi
 
 	# Ok, copy the HA directory to something we can use.
-	rm -rf $tmpdir
        	mkdir -p $tmpdir/sm
 	
 	# Copy in our specified entries


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-21 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-21 14:29 cluster: RHEL5 - rgmanager: randomize svclib_nfslock temp dir Lon Hohberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).