This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: RHEL5 - rgmanager: randomize svclib_nfslock temp dir
- From: Lon Hohberger <lon at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Thu, 21 May 2009 14:28:39 +0000 (UTC)
- Subject: cluster: RHEL5 - rgmanager: randomize svclib_nfslock temp dir
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