This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
master - rgmanager: randomize svclib_nfslock temp dir
- From: "Fabio M. Di Nitto" <fabbione at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Thu, 30 Oct 2008 11:36:58 +0000 (UTC)
- Subject: master - rgmanager: randomize svclib_nfslock temp dir
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8161a3c65ae08fbf631c457b3e008359936feedf
Commit: 8161a3c65ae08fbf631c457b3e008359936feedf
Parent: 4cc4d59283138e4a6587fffdf78beacc57ee7427
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Thu Oct 30 12:36:05 2008 +0100
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Thu Oct 30 12:36:05 2008 +0100
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 9cf74d5..f69a57c 100644
--- a/rgmanager/src/resources/svclib_nfslock
+++ b/rgmanager/src/resources/svclib_nfslock
@@ -19,7 +19,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
@@ -37,7 +37,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