public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: "Marek Grác" <marx@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: RHEL5 - fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities Date: Thu, 21 May 2009 14:27:00 -0000 [thread overview] Message-ID: <20090521142631.90E8A1201FA@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a1cb7f4397f4c66f912e1b2871707777b87e35ef Commit: a1cb7f4397f4c66f912e1b2871707777b87e35ef Parent: 8f7ef65924e8a48178e72ef359dc5a92091bb9e0 Author: Marek 'marx' Grac <mgrac@redhat.com> AuthorDate: Thu May 21 16:21:43 2009 +0200 Committer: Marek 'marx' Grac <mgrac@redhat.com> CommitterDate: Thu May 21 16:21:43 2009 +0200 fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities --- fence/agents/apc/fence_apc_snmp.py | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fence/agents/apc/fence_apc_snmp.py b/fence/agents/apc/fence_apc_snmp.py index fd85495..6c99758 100755 --- a/fence/agents/apc/fence_apc_snmp.py +++ b/fence/agents/apc/fence_apc_snmp.py @@ -49,7 +49,7 @@ def usage(): print " -p <string> Login password"; print " -q quiet mode"; print " -V version"; - print " -v Log to file /tmp/apclog"; + print " -v <filename> Log to output file"; sys.exit(0); @@ -66,6 +66,7 @@ def main(): action = "outletReboot" status_check = False verbose = False + verbose_filename = "" if not glob('/usr/share/snmp/mibs/powernet*.mib'): sys.stderr.write('This APC Fence script uses snmp to control the APC power switch. This script requires that net-snmp-utils be installed on all nodes in the cluster, and that the powernet369.mib file be located in /usr/share/snmp/mibs/\n') @@ -73,7 +74,7 @@ def main(): if len(sys.argv) > 1: try: - opts, args = getopt.getopt(sys.argv[1:], "a:hl:p:n:o:vV", ["help", "output="]) + opts, args = getopt.getopt(sys.argv[1:], "a:hl:p:n:o:v:V", ["help", "output="]) except getopt.GetoptError: #print help info and quit usage() @@ -82,6 +83,7 @@ def main(): for o, a in opts: if o == "-v": verbose = True + verbose_filename = a if o == "-V": print "%s\n" % FENCE_RELEASE_NAME print "%s\n" % REDHAT_COPYRIGHT @@ -212,7 +214,7 @@ def main(): if status_check: if verbose: - fd = open("/tmp/apclog", "w") + fd = open(verbose_filename, "w") fd.write("Attempting the following command: %s\n" % cmdstr_status) strr = os.system(cmdstr_status) print strr @@ -223,7 +225,7 @@ def main(): else: if action == POWER_OFF: if verbose: - fd = open("/tmp/apclog", "w") + fd = open(verbose_filename, "w") fd.write("Attempting the following command: %s\n" % cmdstr_off) strr = os.system(cmdstr_off) time.sleep(1) @@ -242,7 +244,7 @@ def main(): elif action == POWER_ON: if verbose: - fd = open("/tmp/apclog", "w") + fd = open(verbose_filename, "w") fd.write("Attempting the following command: %s\n" % cmdstr_on) strr = os.system(cmdstr_on) time.sleep(1) @@ -264,7 +266,7 @@ def main(): elif action == POWER_REBOOT: if verbose: - fd = open("/tmp/apclog", "w") + fd = open(verbose_filename, "w") fd.write("Attempting the following command: %s\n" % cmdstr_off) strr = os.system(cmdstr_off) time.sleep(1)
next reply other threads:[~2009-05-21 14:27 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-05-21 14:27 Marek Grác [this message] 2009-05-21 15:26 Marek Grác 2009-05-21 15:49 Marek Grác
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090521142631.90E8A1201FA@lists.fedorahosted.org \ --to=marx@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).