cluster: RHEL4 - rgmanager: move nfsclient.sh cache files where they belong
Lon Hohberger
lon at fedoraproject.org
Thu Oct 21 22:31:58 UTC 2010
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=efadcbe9493327f6c6b011291fa6909cf5d413cb
Commit: efadcbe9493327f6c6b011291fa6909cf5d413cb
Parent: 0e3074ee3666bef630884c323028486aeed28e62
Author: Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate: Wed Oct 22 10:10:08 2008 +0200
Committer: Lon Hohberger <lhh at redhat.com>
CommitterDate: Thu Oct 21 18:21:50 2010 -0400
rgmanager: move nfsclient.sh cache files where they belong
by using a static path to /tmp, the operation can be used to trigger
a local DoS by a normal user.
Move the cache files to /var/cache/cluster that's owned by root and
doesn't allow normal users to play with it.
Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
rgmanager/src/resources/nfsclient.sh | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/nfsclient.sh b/rgmanager/src/resources/nfsclient.sh
index 7e8104a..a579bb1 100755
--- a/rgmanager/src/resources/nfsclient.sh
+++ b/rgmanager/src/resources/nfsclient.sh
@@ -382,12 +382,15 @@ status|monitor)
# Don't let anyone read the cache files.
#
umask 066
+
+ mkdir -p /var/cache/cluster
+
if [ -n "$OCF_RESKEY_service_name" ] && [ "$OCF_RESKEY_use_cache" = "1" ]; then
#
# For large #s of exports, we need to cache the information
#
- tmpfn=/tmp/nfsclient-status-cache-$OCF_RESKEY_service_name
+ tmpfn=/var/cache/cluster/nfsclient-status-cache-$OCF_RESKEY_service_name
if [ -f "$tmpfn" ]; then
time_created=$(stat -c "%Y" $tmpfn)
@@ -400,7 +403,7 @@ status|monitor)
#
# Create a different file if this is a separate instance
#
- tmpfn=/tmp/nfsclient-status-cache-$$
+ tmpfn=/var/cache/cluster/nfsclient-status-cache-$$
fi
if ! [ -f "$tmpfn" ] || [ $delta -gt 30 ]; then
More information about the cluster-commits
mailing list