public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL4 - fence_apc_snmp: #498983 - affected by symlink vulnerabilities
@ 2009-06-26 10:52 Marek Grác
0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2009-06-26 10:52 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7868c811ac968bc973ab452f5bcf1676d65565bd
Commit: 7868c811ac968bc973ab452f5bcf1676d65565bd
Parent: e92d478d1d309c329e628997f746e7cda65fd1e6
Author: Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate: Fri Jun 26 12:46:21 2009 +0200
Committer: Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Fri Jun 26 12:46:21 2009 +0200
fence_apc_snmp: #498983 - affected by symlink vulnerabilities
Option -v for verbose mode now expects filename
---
fence/agents/apc_snmp/fence_apc_snmp.py | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py
index 9069461..3078a9e 100755
--- a/fence/agents/apc_snmp/fence_apc_snmp.py
+++ b/fence/agents/apc_snmp/fence_apc_snmp.py
@@ -229,7 +229,7 @@ def usage():
print " -c <community> SNMP community (default 'private')"
print " -n <num> Outlet name/number to act on"
print " -o <string> Action: Reboot (default), On, Off and Status"
- print " -v Verbose mode - write to /tmp/apclog"
+ print " -v <filename> Verbose mode - write to file"
print " -V Version"
sys.exit(0)
@@ -237,10 +237,10 @@ def usage():
file_log = None
-def set_logging(verbose):
+def set_logging(verbose, verbose_filename):
global file_log
if verbose:
- file_log = open('/tmp/apclog', 'a')
+ file_log = open(verbose_filename, 'a')
file_log.write('\n----------- ')
file_log.write(datetime.datetime.today().ctime())
file_log.write(' -----------\n')
@@ -275,7 +275,7 @@ def main2():
if len(sys.argv) > 1:
try:
- opts, args = getopt.getopt(sys.argv[1:], "ha:u:c:n:o:vV", ["help", "output="])
+ opts, args = getopt.getopt(sys.argv[1:], "ha:u:c:n:o:v:V", ["help", "output="])
except getopt.GetoptError:
usage()
sys.exit(2)
@@ -285,6 +285,7 @@ def main2():
a = a.strip()
if o == "-v":
verbose = True
+ verbose_filename = a
if o == "-V":
print "%s\n" % FENCE_RELEASE_NAME
print "%s\n" % REDHAT_COPYRIGHT
@@ -324,7 +325,7 @@ def main2():
params[o] = a
- set_logging(verbose)
+ set_logging(verbose, verbose_filename)
### validation ###
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-26 10:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 10:52 cluster: RHEL4 - fence_apc_snmp: #498983 - affected by symlink vulnerabilities Marek Grác
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).