From 79209ee3892a7ec19400e5ef80573f17883e1aab Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 18 Aug 2013 15:29:19 +0200 Subject: Rename isvalidname() to is_valid_name() in pynslcd --- pynslcd/common.py | 4 ++-- pynslcd/group.py | 6 +++--- pynslcd/pam.py | 2 +- pynslcd/passwd.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pynslcd/common.py b/pynslcd/common.py index 146ed4c..df2a644 100644 --- a/pynslcd/common.py +++ b/pynslcd/common.py @@ -29,7 +29,7 @@ import cfg import constants -def isvalidname(name): +def is_valid_name(name): """Checks to see if the specified name seems to be a valid user or group name. @@ -47,7 +47,7 @@ def isvalidname(name): def validate_name(name): """Checks to see if the specified name seems to be a valid user or group - name. See isvalidname().""" + name. See is_valid_name().""" if not cfg.validnames.search(name): raise ValueError('%r: denied by validnames option' % name) diff --git a/pynslcd/group.py b/pynslcd/group.py index 10e3423..965148d 100644 --- a/pynslcd/group.py +++ b/pynslcd/group.py @@ -123,7 +123,7 @@ class GroupRequest(common.Request): def get_members(self, attributes, members, subgroups, seen): # add the memberUid values for member in clean(attributes['memberUid']): - if common.isvalidname(member): + if common.is_valid_name(member): members.add(member) # translate and add the member values for memberdn in clean(attributes['member']): @@ -131,7 +131,7 @@ class GroupRequest(common.Request): continue seen.add(memberdn) member = passwd.dn2uid(self.conn, memberdn) - if member and common.isvalidname(member): + if member and common.is_valid_name(member): members.add(member) elif cfg.nss_nested_groups: subgroups.append(memberdn) @@ -155,7 +155,7 @@ class GroupRequest(common.Request): self.get_members(attributes2, members, subgroups, seen) # actually return the results for name in names: - if not common.isvalidname(name): + if not common.is_valid_name(name): logging.warning('%s: %s: denied by validnames option', dn, attmap['cn']) else: diff --git a/pynslcd/pam.py b/pynslcd/pam.py index 7c01517..3a3d55d 100644 --- a/pynslcd/pam.py +++ b/pynslcd/pam.py @@ -131,7 +131,7 @@ class PAMRequest(common.Request): logging.warning('%s: is missing a %s attribute', entry[0], passwd.attmap['uid']) value = values[0] # check the username - if value and not common.isvalidname(value): + if value and not common.is_valid_name(value): raise ValueError('%s: has invalid %s attribute', entry[0], passwd.attmap['uid']) # check if the username is different and update it if needed if value != parameters['username']: diff --git a/pynslcd/passwd.py b/pynslcd/passwd.py index a8e407f..a5e4d1f 100644 --- a/pynslcd/passwd.py +++ b/pynslcd/passwd.py @@ -84,7 +84,7 @@ class PasswdRequest(common.Request): home = attributes['homeDirectory'][0] shell = attributes['loginShell'][0] for name in names: - if not common.isvalidname(name): + if not common.is_valid_name(name): logging.warning('%s: %s: denied by validnames option', dn, attmap['uid']) else: for uid in uids: -- cgit v1.2.3