mirror of
https://github.com/gryf/wicd.git
synced 2026-02-21 17:35:46 +01:00
Committed patch from Sabin Iacob to sanitize a user's psk, to prevent possible parsing errors and security risks.
This commit is contained in:
6
misc.py
6
misc.py
@@ -23,6 +23,7 @@ import locale
|
||||
import gettext
|
||||
import time
|
||||
import sys
|
||||
import re
|
||||
from subprocess import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -260,6 +261,10 @@ def error(parent, message):
|
||||
dialog.run()
|
||||
dialog.destroy()
|
||||
|
||||
def shell_escape(data):
|
||||
escape_re = re.compile('(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF])')
|
||||
print 'data is',data
|
||||
return escape_re.sub("\\\\", data)
|
||||
|
||||
class LogWriter():
|
||||
""" A class to provide timestamped logging. """
|
||||
@@ -308,7 +313,6 @@ class LogWriter():
|
||||
if self.eol: self.file.write('\n')
|
||||
self.file.close()
|
||||
|
||||
|
||||
def get_time(self):
|
||||
""" Return a string with the current time nicely formatted.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user