Merge branch 'encoding_fix' of git://github.com/rsmudge/metasploit-framework
commit
2c41ca6598
|
@ -1453,8 +1453,16 @@ class DBManager
|
||||||
service = opts.delete(:service) || report_service(:host => host, :port => port, :proto => proto, :name => sname, :workspace => wspace)
|
service = opts.delete(:service) || report_service(:host => host, :port => port, :proto => proto, :name => sname, :workspace => wspace)
|
||||||
|
|
||||||
# Non-US-ASCII usernames are tripping up the database at the moment, this is a temporary fix until we update the tables
|
# Non-US-ASCII usernames are tripping up the database at the moment, this is a temporary fix until we update the tables
|
||||||
( token[0] = token[0].gsub(/[\x00-\x1f\x7f-\xff]/){|m| "\\x%.2x" % m.unpack("C")[0] } ) if token[0]
|
if (token[0])
|
||||||
( token[1] = token[1].gsub(/[\x00-\x1f\x7f-\xff]/){|m| "\\x%.2x" % m.unpack("C")[0] } ) if token[1]
|
# convert the token to US-ASCII from UTF-8 to prevent an error
|
||||||
|
token[0] = token[0].unpack("C*").pack("C*")
|
||||||
|
token[0] = token[0].gsub(/[\x00-\x1f\x7f-\xff]/){|m| "\\x%.2x" % m.unpack("C")[0] }
|
||||||
|
end
|
||||||
|
|
||||||
|
if (token[1])
|
||||||
|
token[1] = token[1].unpack("C*").pack("C*")
|
||||||
|
token[1] = token[1].gsub(/[\x00-\x1f\x7f-\xff]/){|m| "\\x%.2x" % m.unpack("C")[0] }
|
||||||
|
end
|
||||||
|
|
||||||
ret = {}
|
ret = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue