nss-pam-ldapd branch master updated. 0.9.13-11-gee1330d
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd branch master updated. 0.9.13-11-gee1330d
- 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, nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd branch master updated. 0.9.13-11-gee1330d
- Date: Sat, 10 Oct 2026 13:26:01 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".
The branch, master has been updated
via ee1330dda4f683a05dee1722a6fe9fbe7fe63b0d (commit)
via ad08f81558cd0eaa90d1b78124a8148d530a008a (commit)
from 30aba46d295b55364bebf6a3b99026e0f01e7e7c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://arthurdejong.org/git/nss-pam-ldapd/commit/?id=ee1330dda4f683a05dee1722a6fe9fbe7fe63b0d
commit ee1330dda4f683a05dee1722a6fe9fbe7fe63b0d
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sat Oct 10 13:18:01 2026 +0200
Avoid using the match keyword in Python
diff --git a/pynslcd/expr.py b/pynslcd/expr.py
index cd213d6..15c8b64 100644
--- a/pynslcd/expr.py
+++ b/pynslcd/expr.py
@@ -177,23 +177,23 @@ class DollarExpression(object):
offset, length = int(offset), int(length)
return value[offset:offset + length]
elif self.op in ('#', '##', '%', '%%'):
- match = fnmatch.translate(self.expr.value(variables))
+ regex = fnmatch.translate(self.expr.value(variables))
# We mangle the regex to change its behaviour
- match = match.replace(r'\Z', r'\z')
+ regex = regex.replace(r'\Z', r'\z')
if self.op == '#':
# ${attr#word} remove shortest match of word
- match = match.replace('*', '*?').replace(r'\z',
r'(?P<replace>.*)\z')
+ regex = regex.replace('*', '*?').replace(r'\z',
r'(?P<replace>.*)\z')
elif self.op == '##':
# ${attr##word} remove longest match of word
- match = match.replace(r'\z', r'(?P<replace>.*?)\z')
+ regex = regex.replace(r'\z', r'(?P<replace>.*?)\z')
elif self.op == '%':
# ${attr%word} remove shortest match from right
- match = r'(?P<replace>.*)' + match.replace('*', '*?')
+ regex = r'(?P<replace>.*)' + regex.replace('*', '*?')
elif self.op == '%%':
# ${attr%%word} remove longest match from right
- match = r'(?P<replace>.*?)' + match
- match = re.match(match, value)
- return match.group('replace') if match else value
+ regex = r'(?P<replace>.*?)' + regex
+ m = re.match(regex, value)
+ return m.group('replace') if m else value
elif self.op == 'lower':
return self.expr.value(variables).lower()
elif self.op == 'upper':
https://arthurdejong.org/git/nss-pam-ldapd/commit/?id=ad08f81558cd0eaa90d1b78124a8148d530a008a
commit ad08f81558cd0eaa90d1b78124a8148d530a008a
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sat Oct 10 12:55:10 2026 +0200
Fix problem with Python version >= 3.14
The fnmatch.translate() match function now returns \z instead of \Z
which we relied upon to mangle the regular expression.
This also fixes and improves the comments in the code.
diff --git a/pynslcd/expr.py b/pynslcd/expr.py
index 7e65c12..cd213d6 100644
--- a/pynslcd/expr.py
+++ b/pynslcd/expr.py
@@ -178,17 +178,19 @@ class DollarExpression(object):
return value[offset:offset + length]
elif self.op in ('#', '##', '%', '%%'):
match = fnmatch.translate(self.expr.value(variables))
+ # We mangle the regex to change its behaviour
+ match = match.replace(r'\Z', r'\z')
if self.op == '#':
# ${attr#word} remove shortest match of word
- match = match.replace('*', '*?').replace(r'\Z',
r'(?P<replace>.*)\Z')
+ match = match.replace('*', '*?').replace(r'\z',
r'(?P<replace>.*)\z')
elif self.op == '##':
- # ${attr#word} remove longest match of word
- match = match.replace(r'\Z', r'(?P<replace>.*?)\Z')
+ # ${attr##word} remove longest match of word
+ match = match.replace(r'\z', r'(?P<replace>.*?)\z')
elif self.op == '%':
- # ${attr#word} remove shortest match from right
+ # ${attr%word} remove shortest match from right
match = r'(?P<replace>.*)' + match.replace('*', '*?')
elif self.op == '%%':
- # ${attr#word} remove longest match from right
+ # ${attr%%word} remove longest match from right
match = r'(?P<replace>.*?)' + match
match = re.match(match, value)
return match.group('replace') if match else value
-----------------------------------------------------------------------
Summary of changes:
pynslcd/expr.py | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
hooks/post-receive
--
nss-pam-ldapd
- nss-pam-ldapd branch master updated. 0.9.13-11-gee1330d,
Commits of the nss-pam-ldapd project