Ansgar pushed to branch master at Debian FTP Team / dak
Commits:
-
369f2fc7
by Ansgar at 2020-10-31T21:03:53+01:00
2 changed files:
Changes:
| ... | ... | @@ -921,6 +921,7 @@ class Keyring(object): |
| 921 | 921 |
from .utils import open_ldap_connection
|
| 922 | 922 |
l = open_ldap_connection()
|
| 923 | 923 |
cnf = Config()
|
| 924 |
+ LDAPDn = cnf["Import-LDAP-Fingerprints::LDAPDn"]
|
|
| 924 | 925 |
Attrs = l.search_s(LDAPDn, ldap.SCOPE_ONELEVEL,
|
| 925 | 926 |
"(&(keyfingerprint=*)(supplementaryGid=%s))" % (cnf["Import-Users-From-Passwd::ValidGID"]),
|
| 926 | 927 |
["uid", "keyfingerprint", "cn", "mn", "sn"])
|
| ... | ... | @@ -798,6 +798,7 @@ def open_ldap_connection(): |
| 798 | 798 |
def get_logins_from_ldap(fingerprint='*'):
|
| 799 | 799 |
"""retrieve login from LDAP linked to a given fingerprint"""
|
| 800 | 800 |
l = open_ldap_connection()
|
| 801 |
+ LDAPDn = Cnf["Import-LDAP-Fingerprints::LDAPDn"]
|
|
| 801 | 802 |
Attrs = l.search_s(LDAPDn, ldap.SCOPE_ONELEVEL,
|
| 802 | 803 |
'(keyfingerprint=%s)' % fingerprint,
|
| 803 | 804 |
['uid', 'keyfingerprint'])
|
| ... | ... | @@ -814,6 +815,7 @@ def get_logins_from_ldap(fingerprint='*'): |
| 814 | 815 |
def get_users_from_ldap():
|
| 815 | 816 |
"""retrieve login and user names from LDAP"""
|
| 816 | 817 |
l = open_ldap_connection()
|
| 818 |
+ LDAPDn = Cnf["Import-LDAP-Fingerprints::LDAPDn"]
|
|
| 817 | 819 |
Attrs = l.search_s(LDAPDn, ldap.SCOPE_ONELEVEL,
|
| 818 | 820 |
'(uid=*)', ['uid', 'cn', 'mn', 'sn'])
|
| 819 | 821 |
users = {}
|