diff -Nru twextpy-0.1~git20161216.0.b90293c/debian/changelog twextpy-0.1~git20161216.0.b90293c/debian/changelog --- twextpy-0.1~git20161216.0.b90293c/debian/changelog 2017-08-26 06:53:56.000000000 +0000 +++ twextpy-0.1~git20161216.0.b90293c/debian/changelog 2019-03-17 19:30:34.000000000 +0000 @@ -1,3 +1,11 @@ +twextpy (1:0.1~git20161216.0.b90293c-1.19.04.1) disco; urgency=low + + * Removed constructors for NssUserRecord and NssGroupRecord classes allowing + them to fallback to the constructor of their parent class (Closes: #923230) + LP: #1821130 + + -- Rahul Amaram Mon, 18 Mar 2019 01:00:34 +0530 + twextpy (1:0.1~git20161216.0.b90293c-1) unstable; urgency=low * New upstream version from master branch commit diff -Nru twextpy-0.1~git20161216.0.b90293c/debian/patches/nss.patch twextpy-0.1~git20161216.0.b90293c/debian/patches/nss.patch --- twextpy-0.1~git20161216.0.b90293c/debian/patches/nss.patch 2017-08-26 06:53:56.000000000 +0000 +++ twextpy-0.1~git20161216.0.b90293c/debian/patches/nss.patch 2019-03-17 19:30:34.000000000 +0000 @@ -2,7 +2,7 @@ calendarserver package. --- /dev/null +++ b/twext/who/nss.py -@@ -0,0 +1,201 @@ +@@ -0,0 +1,208 @@ +## +# Copyright (c) 2016 Rahul Amaram +# @@ -31,13 +31,15 @@ +import PAM +from time import time +from uuid import UUID ++from zope.interface import implementer + +from twisted.internet.defer import succeed +from twext.python.log import Logger +from twistedcaldav.directory.util import uuidFromName +from .idirectory import ( + RecordType, -+ FieldName ++ FieldName, ++ IPlaintextPasswordVerifier +) +from .index import ( + DirectoryService, @@ -111,7 +113,7 @@ + records = set() + for result in pwd.getpwall(): + if self._isValidUid(result[2]): -+ record = NssUserRecord( ++ record = NssUserRecord.fromUserName( + service=self, + userName=result[0], + gecos=result[4], @@ -121,7 +123,7 @@ + for result in grp.getgrall(): + if result[0].startswith(self.groupPrefix) and \ + self._isValidGid(result[2]): -+ record = NssGroupRecord( ++ record = NssGroupRecord.fromGroupName( + service=self, + groupName=result[0], + members=result[3] @@ -138,11 +140,14 @@ + _lastRefresh = now + + ++@implementer(IPlaintextPasswordVerifier) +class NssUserRecord(DirectoryRecord): + """ + NSS Users implementation of L{IDirectoryRecord}. + """ -+ def __init__(self, service, userName, gecos): ++ ++ @classmethod ++ def fromUserName(cls, service, userName, gecos): + uid = _generateUID(service.guid, "users", userName) + guid = UUID(uid) + shortNames = (unicode(userName, "utf-8"),) @@ -154,7 +159,7 @@ + log.debug("Creating user record with uid: %r, guid: %r, " + "shortNames: %r, fullNames: %r, emailAddresses: %r" % + (uid, guid, shortNames, fullNames, emailAddresses)) -+ super(NssUserRecord, self).__init__(service, dict([ ++ return cls(service, dict([ + (FieldName.recordType, service.recordType.user), + (FieldName.uid, uid), + (FieldName.guid, guid), @@ -185,7 +190,9 @@ + """ + NSS Groups implementation of L{IDirectoryRecord}. + """ -+ def __init__(self, service, groupName, members=()): ++ ++ @classmethod ++ def fromGroupName(cls, service, groupName, members=()): + groupNameWithoutPrefix = groupName.replace(service.groupPrefix, '', 1) + uid = _generateUID(service.guid, "groups", groupNameWithoutPrefix) + guid = UUID(uid) @@ -195,7 +202,7 @@ + log.debug("Creating group record with uid: %r, guid: %r, " + "shortNames: %r, memberUIDs: %r" % + (uid, guid, shortNames, memberUIDs)) -+ super(NssGroupRecord, self).__init__(service, dict([ ++ return cls(service, dict([ + (FieldName.recordType, service.recordType.group), + (FieldName.uid, uid), + (FieldName.guid, guid),