public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities
@ 2009-05-21 15:49 Marek Grác
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Grác @ 2009-05-21 15:49 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f1bd82c9796eaca11a785ff561f0f0b28aea09ae
Commit:        f1bd82c9796eaca11a785ff561f0f0b28aea09ae
Parent:        3e1ebce12b502170b1de3332cb936da21630d980
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Thu May 21 17:46:27 2009 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Thu May 21 17:46:27 2009 +0200

fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities

bugfix of previous patch
---
 fence/agents/apc_snmp/fence_apc_snmp.py |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py
index c16825b..fb79054 100755
--- a/fence/agents/apc_snmp/fence_apc_snmp.py
+++ b/fence/agents/apc_snmp/fence_apc_snmp.py
@@ -41,10 +41,6 @@ POWER_REBOOT="outletReboot"
 # oid defining fence device 
 oid_sysObjectID = '.1.3.6.1.2.1.1.2.0'
 
-verbose_filename = ""
-
-
-
 class SNMP:
 	def __init__(self, params):
 		self.hostname  = params['ipaddr']
@@ -238,7 +234,7 @@ def usage():
 
 
 file_log = None
-def set_logging(verbose):
+def set_logging(verbose, verbose_filename):
 	global file_log
 	if verbose:
 		file_log = open(verbose_filename, 'a')
@@ -326,7 +322,7 @@ def main2():
 	    params[o] = a 
 	
     
-  set_logging(verbose)
+  set_logging(verbose, verbose_filename)
   
   
   ### validation ###


^ permalink raw reply	[flat|nested] 3+ messages in thread

* cluster: RHEL5 - fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities
@ 2009-05-21 15:26 Marek Grác
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Grác @ 2009-05-21 15:26 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3e1ebce12b502170b1de3332cb936da21630d980
Commit:        3e1ebce12b502170b1de3332cb936da21630d980
Parent:        4d9b91ea4c230c9e10d0e510a68b3e3898132de7
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Thu May 21 17:21:59 2009 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Thu May 21 17:21:59 2009 +0200

fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities

Another apc snmp agent in different location
---
 fence/agents/apc_snmp/fence_apc_snmp.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py
index ec9353a..c16825b 100755
--- a/fence/agents/apc_snmp/fence_apc_snmp.py
+++ b/fence/agents/apc_snmp/fence_apc_snmp.py
@@ -41,6 +41,8 @@ POWER_REBOOT="outletReboot"
 # oid defining fence device 
 oid_sysObjectID = '.1.3.6.1.2.1.1.2.0'
 
+verbose_filename = ""
+
 
 
 class SNMP:
@@ -228,7 +230,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)
@@ -239,7 +241,7 @@ file_log = None
 def set_logging(verbose):
 	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')
@@ -274,7 +276,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)
@@ -284,6 +286,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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* cluster: RHEL5 - fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities
@ 2009-05-21 14:27 Marek Grác
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Grác @ 2009-05-21 14:27 UTC (permalink / raw)
  To: cluster-cvs-relay

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-21 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-21 15:49 cluster: RHEL5 - fence_apc_snmp: #498952 - product is affected by symlink attack vulnerabilities Marek Grác
  -- strict thread matches above, loose matches on Subject: below --
2009-05-21 15:26 Marek Grác
2009-05-21 14:27 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).