diff --git a/lib/msf/core/rpc/base.rb b/lib/msf/core/rpc/base.rb index 8e4087acc3..3d29024b63 100644 --- a/lib/msf/core/rpc/base.rb +++ b/lib/msf/core/rpc/base.rb @@ -9,21 +9,21 @@ class Base end def authenticate(token) - + stale = [] @tokens.each_key do |t| - user,ctime,mtime = @tokens[t] - if(mtime + 300 < Time.now.to_i) + user,ctime,mtime,perm = @tokens[t] + if ! perm and mtime + 300 < Time.now.to_i stale << t end end - + stale.each { |t| @tokens.delete(t) } - + if(not @tokens[token]) raise ::XMLRPC::FaultException.new(401, "authentication error") end - + @tokens[token][2] = Time.now.to_i end @@ -31,3 +31,4 @@ class Base end end end +