nss-pam-ldapd commit: r1452 - nss-pam-ldapd/pynslcd
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd commit: r1452 - nss-pam-ldapd/pynslcd
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd commit: r1452 - nss-pam-ldapd/pynslcd
- Date: Sun, 1 May 2011 14:14:56 +0200 (CEST)
Author: arthur
Date: Sun May 1 14:14:54 2011
New Revision: 1452
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1452
Log:
pass dn and attributes to functions separately
Modified:
nss-pam-ldapd/pynslcd/alias.py
nss-pam-ldapd/pynslcd/common.py
nss-pam-ldapd/pynslcd/ether.py
nss-pam-ldapd/pynslcd/host.py
nss-pam-ldapd/pynslcd/netgroup.py
nss-pam-ldapd/pynslcd/network.py
nss-pam-ldapd/pynslcd/pam.py
nss-pam-ldapd/pynslcd/passwd.py
nss-pam-ldapd/pynslcd/protocol.py
nss-pam-ldapd/pynslcd/rpc.py
nss-pam-ldapd/pynslcd/service.py
nss-pam-ldapd/pynslcd/shadow.py
Modified: nss-pam-ldapd/pynslcd/alias.py
==============================================================================
--- nss-pam-ldapd/pynslcd/alias.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/alias.py Sun May 1 14:14:54 2011 (r1452)
@@ -33,8 +33,7 @@
attributes = ( 'cn', 'rfc822MailMember' )
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get name and check against requested name
names = attributes.get(self.attmap_cn, [])
if not names:
Modified: nss-pam-ldapd/pynslcd/common.py
==============================================================================
--- nss-pam-ldapd/pynslcd/common.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/common.py Sun May 1 14:14:54 2011 (r1452)
@@ -95,7 +95,7 @@
res = self.conn.search_s(base, self.scope, self.mk_filter(),
self.attributes)
for entry in res:
if entry[0]:
- self.write(entry)
+ self.write(entry[0], entry[1])
except ldap.NO_SUCH_OBJECT:
# FIXME: log message
pass
@@ -121,6 +121,6 @@
res[cls.action] = cls
return res
-def get_rdn_value(entry, attribute):
+def get_rdn_value(dn, attribute):
dn, attributes = entry
return dict((x, y) for x, y, z in ldap.dn.str2dn(dn)[0])[attribute]
Modified: nss-pam-ldapd/pynslcd/ether.py
==============================================================================
--- nss-pam-ldapd/pynslcd/ether.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/ether.py Sun May 1 14:14:54 2011 (r1452)
@@ -45,8 +45,7 @@
super(EtherRequest, self).__init__(*args)
self.ether = None
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get name and check against requested name
names = attributes.get(self.attmap_cn, [])
if not names:
Modified: nss-pam-ldapd/pynslcd/host.py
==============================================================================
--- nss-pam-ldapd/pynslcd/host.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/host.py Sun May 1 14:14:54 2011 (r1452)
@@ -33,9 +33,8 @@
attributes = ( 'cn', 'ipHostNumber' )
- def write(self, entry):
- dn, attributes = entry
- hostname = common.get_rdn_value(entry, self.attmap_cn)
+ def write(self, dn, attributes):
+ hostname = common.get_rdn_value(dn, self.attmap_cn)
hostnames = attributes.get(self.attmap_cn, [])
if not hostnames:
print 'Error: entry %s does not contain %s value' % ( dn,
self.attmap_cn )
Modified: nss-pam-ldapd/pynslcd/netgroup.py
==============================================================================
--- nss-pam-ldapd/pynslcd/netgroup.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/netgroup.py Sun May 1 14:14:54 2011 (r1452)
@@ -38,8 +38,7 @@
attributes = ( 'cn', 'nisNetgroupTriple', 'memberNisNetgroup' )
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get names and check against requested user name
names = attributes.get(self.attmap_cn, [])
if self.name:
Modified: nss-pam-ldapd/pynslcd/network.py
==============================================================================
--- nss-pam-ldapd/pynslcd/network.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/network.py Sun May 1 14:14:54 2011 (r1452)
@@ -33,9 +33,8 @@
attributes = ( 'cn', 'ipNetworkNumber' )
- def write(self, entry):
- dn, attributes = entry
- networkname = common.get_rdn_value(entry, self.attmap_cn)
+ def write(self, dn, attributes):
+ networkname = common.get_rdn_value(dn, self.attmap_cn)
networknames = attributes.get(self.attmap_cn, [])
if not networknames:
print 'Error: entry %s does not contain %s value' % ( dn,
self.attmap_cn)
Modified: nss-pam-ldapd/pynslcd/pam.py
==============================================================================
--- nss-pam-ldapd/pynslcd/pam.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/pam.py Sun May 1 14:14:54 2011 (r1452)
@@ -56,7 +56,7 @@
# save the DN
self.userdn = entry[0]
# get the "real" username
- value = common.get_rdn_value(entry,
passwd.PasswdRequest.attmap_passwd_uid)
+ value = common.get_rdn_value(entry[0],
passwd.PasswdRequest.attmap_passwd_uid)
if not value:
# get the username from the uid attribute
values = myldap_get_values(entry,
passwd.PasswdRequest.attmap_passwd_uid)
Modified: nss-pam-ldapd/pynslcd/passwd.py
==============================================================================
--- nss-pam-ldapd/pynslcd/passwd.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/passwd.py Sun May 1 14:14:54 2011 (r1452)
@@ -52,8 +52,7 @@
bases = ( 'ou=people,dc=test,dc=tld', )
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get uid attribute and check against requested user name
names = attributes.get('uid', [])
if self.name:
Modified: nss-pam-ldapd/pynslcd/protocol.py
==============================================================================
--- nss-pam-ldapd/pynslcd/protocol.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/protocol.py Sun May 1 14:14:54 2011 (r1452)
@@ -33,10 +33,9 @@
attributes = ( 'cn', 'ipProtocolNumber' )
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get name
- name = common.get_rdn_value(entry, self.attmap_cn)
+ name = common.get_rdn_value(dn, self.attmap_cn)
names = attributes.get(self.attmap_cn, [])
if not names:
print 'Error: entry %s does not contain %s value' % ( dn,
self.attmap_cn )
Modified: nss-pam-ldapd/pynslcd/rpc.py
==============================================================================
--- nss-pam-ldapd/pynslcd/rpc.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/rpc.py Sun May 1 14:14:54 2011 (r1452)
@@ -33,10 +33,9 @@
attributes = ( 'cn', 'oncRpcNumber' )
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get name
- name = common.get_rdn_value(entry, self.attmap_cn)
+ name = common.get_rdn_value(dn, self.attmap_cn)
names = attributes.get(self.attmap_cn, [])
if not names:
print 'Error: entry %s does not contain %s value' % ( dn,
self.attmap_cn )
Modified: nss-pam-ldapd/pynslcd/service.py
==============================================================================
--- nss-pam-ldapd/pynslcd/service.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/service.py Sun May 1 14:14:54 2011 (r1452)
@@ -38,10 +38,9 @@
super(ServiceRequest, self).__init__(*args)
self.protocol = None
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get name
- name = common.get_rdn_value(entry, self.attmap_cn)
+ name = common.get_rdn_value(dn, self.attmap_cn)
names = attributes.get(self.attmap_cn, [])
if not names:
print 'Error: entry %s does not contain %s value' % ( dn,
self.attmap_cn )
Modified: nss-pam-ldapd/pynslcd/shadow.py
==============================================================================
--- nss-pam-ldapd/pynslcd/shadow.py Sun May 1 14:06:38 2011 (r1451)
+++ nss-pam-ldapd/pynslcd/shadow.py Sun May 1 14:14:54 2011 (r1452)
@@ -44,8 +44,7 @@
bases = ( 'ou=people,dc=test,dc=tld', )
- def write(self, entry):
- dn, attributes = entry
+ def write(self, dn, attributes):
# get name and check against requested name
names = attributes.get(self.attmap_uid, [])
if not names:
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits
- nss-pam-ldapd commit: r1452 - nss-pam-ldapd/pynslcd,
Commits of the nss-pam-ldapd project