Example #1
0
	def check(self):
		if self.host == None:
			sys.stdout.write('Checking system security status ... \n')
		else:
			sys.stdout.write('Checking system security status on %s ... \n' % self.host)
		sys.stdout.write('Fetching current GLSA list...\r')
		sys.stdout.flush()
		self.slurp = config.thSlurp()
		self.slurp.registerTrigger('^[0-9]+.*\[U\]', self.addUnaffected)
		self.slurp.register_trigger('^[0-9]+.*\[A\]', self.addApplied)
		self.slurp.register_trigger('^[0-9]+.*\[N\]', self.addAffected)
		if self.host != None and self.user == None:
			obj = popen2.Popen4('ssh %s@%s "%s -ln"' % (os.getenv('USER'),self.host,self.glsa))
		elif self.host != None and self.user != None:
			obj = popen2.Popen4('ssh %s@%s "%s -nl"' % (self.user,self.host,self.glsa))
		else:
			obj = popen2.Popen4('%s -ln' % self.glsa)
		
		self.slurp.run(obj.fromchild)

		print ''
		for i in self.affectd.keys():
			sys.stdout.write('INFO: %s : %s\n' % (i, self.affectd[i]))
Example #2
0
		def setUp(self):
			# THWAP.core.config.thSlurp()
			self.thSlurpFlag = 0
			self.thSlurp = config.thSlurp()
			self.MyOwnError = 'this is the thing they promised you'