lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1574 - nss-pam-ldapd/pynslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1574 - nss-pam-ldapd/pynslcd



Author: arthur
Date: Tue Dec 27 22:05:06 2011
New Revision: 1574
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1574&view=revision

Log:
make logging more consistent and remove test bases from shadow and passwd maps

Modified:
   nss-pam-ldapd/pynslcd/common.py
   nss-pam-ldapd/pynslcd/group.py
   nss-pam-ldapd/pynslcd/netgroup.py
   nss-pam-ldapd/pynslcd/passwd.py
   nss-pam-ldapd/pynslcd/shadow.py

Modified: nss-pam-ldapd/pynslcd/common.py
==============================================================================
--- nss-pam-ldapd/pynslcd/common.py     Tue Dec 27 19:04:33 2011        (r1573)
+++ nss-pam-ldapd/pynslcd/common.py     Tue Dec 27 22:05:06 2011        (r1574)
@@ -85,6 +85,8 @@
     case_insensitive = []
     limit_attributes = []
 
+# FIXME: figure out which of these arguments are actually needed
+
     def __init__(self, conn, base=None, scope=None, filter=None, 
attributes=None,
                  parameters=None):
         # load information from module that defines the class
@@ -143,19 +145,21 @@
         # check that these attributes have at least one value
         for attr in self.required:
             if not attributes.get(attr, None):
-                print '%s: attribute %s not found' % (dn, self.attmap[attr])
+                print '%s: %s: missing' % (dn, self.attmap[attr])
                 return
         # check that requested attribute is present (case sensitive)
         for attr in self.case_sensitive:
             value = self.parameters.get(attr, None)
             if value and str(value) not in attributes[attr]:
-                print '%s: attribute %s does not contain %r value' % (dn, 
self.attmap[attr], value)
+                # TODO: log at debug level, this can happen in normal cases
+                print '%s: %s: does not contain %r value' % (dn, 
self.attmap[attr], value)
                 return  # not found, skip entry
         # check that requested attribute is present (case insensitive)
         for attr in self.case_insensitive:
             value = self.parameters.get(attr, None)
             if value and str(value).lower() not in (x.lower() for x in 
attributes[attr]):
-                print '%s: attribute %s does not contain %r value' % (dn, 
self.attmap[attr], value)
+                # TODO: log at debug level, this can happen in normal cases
+                print '%s: %s: does not contain %r value' % (dn, 
self.attmap[attr], value)
                 return  # not found, skip entry
         # limit attribute values to requested value
         for attr in self.limit_attributes:

Modified: nss-pam-ldapd/pynslcd/group.py
==============================================================================
--- nss-pam-ldapd/pynslcd/group.py      Tue Dec 27 19:04:33 2011        (r1573)
+++ nss-pam-ldapd/pynslcd/group.py      Tue Dec 27 22:05:06 2011        (r1574)
@@ -91,7 +91,7 @@
         # actually return the results
         for name in names:
             if not common.isvalidname(name):
-                print 'Warning: group entry %s contains invalid group name: 
"%s"' % (dn, name)
+                print '%s: %s: denied by validnames option' % (dn, 
self.attmap['cn'])
             else:
                 for gid in gids:
                     self.fp.write_int32(constants.NSLCD_RESULT_BEGIN)

Modified: nss-pam-ldapd/pynslcd/netgroup.py
==============================================================================
--- nss-pam-ldapd/pynslcd/netgroup.py   Tue Dec 27 19:04:33 2011        (r1573)
+++ nss-pam-ldapd/pynslcd/netgroup.py   Tue Dec 27 22:05:06 2011        (r1574)
@@ -47,7 +47,7 @@
         for triple in attributes['nisNetgroupTriple']:
             m = _netgroup_triple_re.match(triple)
             if not m:
-                print 'Warning: entry %s contains invalid %s value: %r' % (dn, 
attmap['nisNetgroupTriple'], triple)
+                print '%s: %s: invalid value: %r' % (dn, 
attmap['nisNetgroupTriple'], triple)
             else:
                 self.fp.write_int32(constants.NSLCD_RESULT_BEGIN)
                 self.fp.write_int32(constants.NSLCD_NETGROUP_TYPE_TRIPLE)

Modified: nss-pam-ldapd/pynslcd/passwd.py
==============================================================================
--- nss-pam-ldapd/pynslcd/passwd.py     Tue Dec 27 19:04:33 2011        (r1573)
+++ nss-pam-ldapd/pynslcd/passwd.py     Tue Dec 27 22:05:06 2011        (r1574)
@@ -34,7 +34,6 @@
                            loginShell='loginShell',
                            objectClass='objectClass')
 filter = '(objectClass=posixAccount)'
-bases = ('ou=people,dc=test,dc=tld', )
 
 
 class Search(common.Search):
@@ -62,7 +61,7 @@
         # write results
         for name in names:
             if not common.isvalidname(name):
-                print 'Warning: passwd entry %s contains invalid user name: 
"%s"' % (dn, name)
+                print '%s: %s: denied by validnames option' % (dn, 
self.attmap['uid'])
             else:
                 for uid in uids:
                     self.fp.write_int32(constants.NSLCD_RESULT_BEGIN)

Modified: nss-pam-ldapd/pynslcd/shadow.py
==============================================================================
--- nss-pam-ldapd/pynslcd/shadow.py     Tue Dec 27 19:04:33 2011        (r1573)
+++ nss-pam-ldapd/pynslcd/shadow.py     Tue Dec 27 22:05:06 2011        (r1574)
@@ -34,7 +34,6 @@
                            shadowExpire='"${shadowExpire:--1}"',
                            shadowFlag='"${shadowFlag:-0}"')
 filter = '(objectClass=shadowAccount)'
-bases = ('ou=people,dc=test,dc=tld', )
 
 
 class Search(common.Search):
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/