# HG changeset patch # User Waqas Hussain # Date 1280756853 -18000 # Node ID 046a8cf304ddaabb6b6c6797aa34e7d8f0a3b2b2 # Parent 37b9b8e171b94b161d1b35e405ecc7e9cd2e628c util.sasl: Removed method:forbidden() and its side effects. diff -r 37b9b8e171b9 -r 046a8cf304dd util/sasl.lua --- a/util/sasl.lua Mon Aug 02 18:46:13 2010 +0500 +++ b/util/sasl.lua Mon Aug 02 18:47:33 2010 +0500 @@ -61,29 +61,15 @@ end -- create a new SASL object which can be used to authenticate clients -function new(realm, profile, forbidden) +function new(realm, profile) local sasl_i = {profile = profile}; sasl_i.realm = realm; - local s = setmetatable(sasl_i, method); - if forbidden == nil then forbidden = {} end - s:forbidden(forbidden) - return s; + return setmetatable(sasl_i, method); end --- get a fresh clone with the same realm, profiles and forbidden mechanisms +-- get a fresh clone with the same realm and profile function method:clean_clone() - return new(self.realm, self.profile, self:forbidden()) -end - --- set the forbidden mechanisms -function method:forbidden( restrict ) - if restrict then - -- set forbidden - self.restrict = set.new(restrict); - else - -- get forbidden - return array.collect(self.restrict:items()); - end + return new(self.realm, self.profile) end -- get a list of possible SASL mechanims to use @@ -94,9 +80,7 @@ for backend, f in pairs(self.profile) do if backend_mechanism[backend] then for _, mechanism in ipairs(backend_mechanism[backend]) do - if not self.restrict:contains(mechanism) then - mechanisms[mechanism] = true; - end + mechanisms[mechanism] = true; end end end