diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-09-16 09:32:48 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-09-16 09:32:48 +0100 |
commit | 9ee6d97c2883d42f204a533a8bc1f4562df778fb (patch) | |
tree | b690ddc0ca30f1472887edbb0b8313629bfcbbb2 /sys-auth/nss-pam-ldapd | |
parent | b17a3ef12038de50228bade1f05502c74e135321 (diff) |
gentoo resync : 16.09.2020
Diffstat (limited to 'sys-auth/nss-pam-ldapd')
5 files changed, 682 insertions, 0 deletions
diff --git a/sys-auth/nss-pam-ldapd/Manifest b/sys-auth/nss-pam-ldapd/Manifest index a021b26b685d..30911ec8bfd0 100644 --- a/sys-auth/nss-pam-ldapd/Manifest +++ b/sys-auth/nss-pam-ldapd/Manifest @@ -3,8 +3,12 @@ AUX nslcd.init 513 BLAKE2B 163a960a9d42b13023064e3adebf1aa8a8d4566d4bb472a224d0c AUX nslcd.s6 44 BLAKE2B af69fd0202732721739501a65f608fb9fadfdd7e8a58052103a347bd3cfabecc84e5d5478fe689f565ee47f839c4f280d6ad8e88846339995f05fba8942dc8ac SHA512 190cd1440ab30dc32d09d7de9dee783d5d149547e491930d5f514b4bd53197e45a307906762d0e650ef802aa18ba266b40f61483569208c57709b2cbd74d3ae9 AUX nslcd.service 320 BLAKE2B 18a675fcc821d2c5f7766c0739c3bada8550e5e55f7b589fd9806bd961e9d4149be4a145ac51b9aeabad49293d70c726c1a8dd6a78ff724114e3b34e2270c32b SHA512 f04b66e05bfaefd485a4251c46d2b172a193be77554595086241dcd66a7787cf7678c8e5f6be954192a85a69fd2426965e4ca82c00e610ead8c6dd93a9aa21b1 AUX nss-pam-ldapd-0.9.11-pynslcd-module-paths.patch 537 BLAKE2B 40167724748124428393c2cc0d70c2fa88abd5fc9c2b12739d79f6dbd9f39e7b53351a68fb6db0e4f11bc0f40b960d1ab4ea256ab1f8aa8c75fe9601fc5674c3 SHA512 2fd21d4851f255264cd0e95f88f45fbca62ad8124c1326569c18bea769c205d4992f88a5fff7ca4bf19cd07c9123a39ecd3df2d5221a0430fb1d25d7b4668a30 +AUX nss-pam-ldapd-0.9.11-relative-imports.patch 12280 BLAKE2B 9ae632b572a9a997cf704698b6aca7fc19c32e1f08f29de0f0457a6ee567596abf09ed2aeec2fab5535e98280eb887f6adb7a29ad4406216f0a3355c9931b2aa SHA512 2275d1c8ded5d8c2824c97dc361e84b62613453ec502a9685d7e27e54bc1a72da7830d119727f8f1e4df000b1dff53d631f8967eaf70bf75e043e0e302d9afac +AUX nss-pam-ldapd-0.9.11-tests.patch 1226 BLAKE2B f8fd1170bae8d206dab6fb11437db7290b488caf8f609f5676f46f55f3d31ba5a4fc59c5484e7151da8fb4a20c50f6739fa7de3115bc8ce706022422e753f31b SHA512 e60122304d4cad52a8e11ba804fd432da8102dc021e9272d0e284d88f3a1b5e7392ef71bfcb460eb3a5faf9ae7e95de943c4e35da03b17d029f058496b6a8087 +AUX nss-pam-ldapd-0.9.11-use-mkstemp.patch 789 BLAKE2B da9525e66873be615cfe90f6a03b717c8a0caf03edfbd3c9eba60391a3e92504c01093e254294ac3e063045de07df260573371a5405c8eea87917fc30056daca SHA512 a01a15b94977efc37d9d518049aaa52f308b0e3597aea6e17ca7badc790cccb617eb9154dcd3fef897b4093b147f8261dfc32ac2fc0ba48ba82573653fa358d8 AUX nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch 403 BLAKE2B 2e17a92b3650ce4e6627be7ddb2f656cd9ab53e49d7e2b11d078dac0d7a00015d88d861bfdc1378eb25c1b9750ed3811023cc95b04ccf9d028ffc5899dc01cd5 SHA512 c8cccb044a641f673f12db9717bda4c0c4d91bd1933342595d8f3f540449459c5cf14263133487195b223670d450873f608e3ce5b6f1ca775ca7fe0180a9f962 AUX pynslcd.init 515 BLAKE2B 711ba152ea9cc52198171e451889ab42a224581bae7e4378846f480063ed9a672fdb38b153d6941364d3d06e325d9feb95f6fd17885b4e6181d99393cb54de0a SHA512 56334d86cc027e538d8a0bf9a8b87308e3ae6e91be608a4a630f21c57cc41b6cb5dc6fb3220fed1ca555dd4da6a5c7c10b2776f9e49a7b71a96ece21fc65fed7 DIST nss-pam-ldapd-0.9.11.tar.gz 777878 BLAKE2B c2b442786dd788dcf4373939ed52b4585d1821a7168fdd342ded3c99ef9ac8f3e4af0ac360f842b61885c1f2bc2ef85a0ce9ce0c1027bc974d0ba5242505657f SHA512 2b307805667526b85c724e113fe38899eee397e5c8673e89090d4836ce6d0ffcf18dd022d6c20a5e11d4138e736451b841a0f16ba379d524de4faaaf02906645 EBUILD nss-pam-ldapd-0.9.11-r2.ebuild 4176 BLAKE2B c0d054d5cb6a3ed392d020145bc5443778136b02d974bf51f8795a5467ac6d5dcff5e1287741dce40dba6e782fb0e145210fa1b421b2b57d25d271b2a6f06b24 SHA512 fb245bd9af6207f684964e995348232034ec7d1338ed973cb497cb2962041973d7ed158f6d0b06b27c11177b416dbc6f87287ed48aa75355f877105e02b8b654 +EBUILD nss-pam-ldapd-0.9.11-r3.ebuild 4331 BLAKE2B 7e46f38bfd579f0a9d4e0d4ccfb6237385776bda1a30a2e515f6b0f294a850e308118b89f6cc143002392311d5e91d788807f1e0d2481190fe7606863840c139 SHA512 92a1f91eb4f610b10c7441b924147796530fed0a75658c620537fe16dccd52b4a5994845a71b4a9c67c3694adfe808e9d3869134b76af8d9d5e75a3847b1f709 MISC metadata.xml 1169 BLAKE2B 22b5c9adcafb123a6af088ddfcaa1962eaf250ed153020e65afe36a0e6473b1f8c624f770634a91c3a983c74ded1d43535bb4930f13c6470fad681f5a77fcd51 SHA512 ab658f7d791db370920a4eb57da8ead2713b1cabda6f2dccd24478855043802e7c70a07c3aeaa33829b19dc94a4317d8b5ebec07d1caebe07b4fb3bc59b27b4c diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-relative-imports.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-relative-imports.patch new file mode 100644 index 000000000000..101d0c774505 --- /dev/null +++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-relative-imports.patch @@ -0,0 +1,452 @@ +diff --git a/pynslcd/Makefile.am b/pynslcd/Makefile.am +index 383dd3c..39a3bfb 100644 +--- a/pynslcd/Makefile.am ++++ b/pynslcd/Makefile.am +@@ -19,7 +19,7 @@ + + pynslcddir = $(datadir)/pynslcd + +-pynslcd_PYTHON = pynslcd.py attmap.py cache.py cfg.py common.py expr.py \ ++pynslcd_PYTHON = main.py attmap.py cache.py cfg.py common.py expr.py \ + mypidfile.py invalidator.py search.py tio.py \ + config.py alias.py ether.py group.py host.py netgroup.py \ + network.py passwd.py protocol.py rpc.py service.py \ +@@ -38,6 +38,6 @@ constants.py: constants.py.in $(top_srcdir)/nslcd.h + # create a symbolic link for the pynslcd daemon and fix permissions + install-data-hook: + $(MKDIR_P) $(DESTDIR)$(sbindir) +- [ -L $(DESTDIR)$(sbindir)/pynslcd ] || $(LN_S) $(pynslcddir)/pynslcd.py $(DESTDIR)$(sbindir)/pynslcd +- chmod a+rx $(DESTDIR)$(pynslcddir)/pynslcd.py +- sed -i -e '1 s|^#!.*|#! $(PYTHON)|;1 s|^#! \([^/].*\)|#! /usr/bin/env \1|' $(DESTDIR)$(pynslcddir)/pynslcd.py ++ [ -L $(DESTDIR)$(sbindir)/pynslcd ] || $(LN_S) $(pynslcddir)/main.py $(DESTDIR)$(sbindir)/pynslcd ++ chmod a+rx $(DESTDIR)$(pynslcddir)/main.py ++ sed -i -e '1 s|^#!.*|#! $(PYTHON)|;1 s|^#! \([^/].*\)|#! /usr/bin/env \1|' $(DESTDIR)$(pynslcddir)/main.py +diff --git a/pynslcd/alias.py b/pynslcd/alias.py +index 8096309..614dd53 100644 +--- a/pynslcd/alias.py ++++ b/pynslcd/alias.py +@@ -18,10 +18,10 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + # 02110-1301 USA + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/attmap.py b/pynslcd/attmap.py +index 61862df..4d450f6 100644 +--- a/pynslcd/attmap.py ++++ b/pynslcd/attmap.py +@@ -45,7 +45,7 @@ import re + import ldap.dn + from ldap.filter import escape_filter_chars + +-from expr import Expression ++from pynslcd.expr import Expression + + + # exported names +diff --git a/pynslcd/cfg.py b/pynslcd/cfg.py +index 877d442..14ae850 100644 +--- a/pynslcd/cfg.py ++++ b/pynslcd/cfg.py +@@ -133,8 +133,8 @@ _tls_reqcert_options = {'never': ldap.OPT_X_TLS_NEVER, + + def _get_maps(): + # separate function as not to pollute the namespace and avoid import loops +- import alias, ether, group, host, netgroup, network, passwd # noqa: E401 +- import protocol, rpc, service, shadow # noqa: E401 ++ from pynslcd import alias, ether, group, host, netgroup, network, passwd # noqa: E401 ++ from pynslcd import protocol, rpc, service, shadow # noqa: E401 + import sys + return dict( + alias=alias, aliases=alias, +@@ -293,7 +293,7 @@ def read(filename): # noqa: C901 (many simple branches) + # pam_authz_search <FILTER> + m = re.match(r'pam_authz_search\s+(?P<value>\S.*)', line, re.IGNORECASE) + if m: +- from expr import Expression ++ from pynslcd.expr import Expression + pam_authz_searches.append(Expression(m.group('value'))) + # TODO: check pam_authz_search expression to only contain + # username, service, ruser, rhost, tty, hostname, fqdn, dn or +diff --git a/pynslcd/common.py b/pynslcd/common.py +index a5b168d..568ac2f 100644 +--- a/pynslcd/common.py ++++ b/pynslcd/common.py +@@ -23,9 +23,9 @@ import sys + + import ldap + +-from attmap import Attributes # noqa: F401 (used by other modules) +-import cfg +-import constants ++from pynslcd.attmap import Attributes # noqa: F401 (used by other modules) ++from pynslcd import cfg ++from pynslcd import constants + + + def is_valid_name(name): +diff --git a/pynslcd/config.py b/pynslcd/config.py +index ee57db3..ba8badb 100644 +--- a/pynslcd/config.py ++++ b/pynslcd/config.py +@@ -18,9 +18,9 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + # 02110-1301 USA + +-import cfg +-import common +-import constants ++from pynslcd import cfg ++from pynslcd import common ++from pynslcd import constants + + + class ConfigGetRequest(common.Request): +diff --git a/pynslcd/ether.py b/pynslcd/ether.py +index 9462ef0..2edc5de 100644 +--- a/pynslcd/ether.py ++++ b/pynslcd/ether.py +@@ -20,10 +20,10 @@ + + import struct + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + def ether_aton(ether): +diff --git a/pynslcd/group.py b/pynslcd/group.py +index 263e40c..422ee9e 100644 +--- a/pynslcd/group.py ++++ b/pynslcd/group.py +@@ -23,12 +23,12 @@ import logging + import ldap + from ldap.filter import escape_filter_chars + +-import cache +-import cfg +-import common +-import constants +-import passwd +-import search ++from pynslcd import cache ++from pynslcd import cfg ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import passwd ++from pynslcd import search + + + def clean(lst): +diff --git a/pynslcd/host.py b/pynslcd/host.py +index c6639df..30259d6 100644 +--- a/pynslcd/host.py ++++ b/pynslcd/host.py +@@ -18,10 +18,10 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + # 02110-1301 USA + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/invalidator.py b/pynslcd/invalidator.py +index 6d2eefe..b54946e 100644 +--- a/pynslcd/invalidator.py ++++ b/pynslcd/invalidator.py +@@ -23,7 +23,7 @@ import logging + import os + import subprocess + +-import cfg ++from pynslcd import cfg + + + # the file descriptor used for sending messages to the child process +diff --git a/pynslcd/mypidfile.py b/pynslcd/mypidfile.py +index 42935e2..dd7d59a 100644 +--- a/pynslcd/mypidfile.py ++++ b/pynslcd/mypidfile.py +@@ -22,7 +22,7 @@ import errno + import fcntl + import os + +-import cfg ++from pynslcd import cfg + + + class MyPIDLockFile(object): +diff --git a/pynslcd/netgroup.py b/pynslcd/netgroup.py +index 47a4c6e..8d0fbb2 100644 +--- a/pynslcd/netgroup.py ++++ b/pynslcd/netgroup.py +@@ -20,10 +20,10 @@ + + import re + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + _netgroup_triple_re = re.compile( +diff --git a/pynslcd/network.py b/pynslcd/network.py +index da587b9..3b94d06 100644 +--- a/pynslcd/network.py ++++ b/pynslcd/network.py +@@ -18,10 +18,10 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + # 02110-1301 USA + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/pam.py b/pynslcd/pam.py +index b372cdd..bb7add8 100644 +--- a/pynslcd/pam.py ++++ b/pynslcd/pam.py +@@ -27,12 +27,12 @@ import ldap + from ldap.controls.ppolicy import PasswordPolicyControl, PasswordPolicyError + from ldap.filter import escape_filter_chars + +-import cfg +-import common +-import constants +-import passwd +-import search +-import shadow ++from pynslcd import cfg ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import passwd ++from pynslcd import search ++from pynslcd import shadow + + + random = random.SystemRandom() +diff --git a/pynslcd/passwd.py b/pynslcd/passwd.py +index 1274f21..51ae57e 100644 +--- a/pynslcd/passwd.py ++++ b/pynslcd/passwd.py +@@ -20,11 +20,11 @@ + + import logging + +-import cache +-import cfg +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import cfg ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/protocol.py b/pynslcd/protocol.py +index dc41c4b..396f337 100644 +--- a/pynslcd/protocol.py ++++ b/pynslcd/protocol.py +@@ -18,10 +18,10 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + # 02110-1301 USA + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py +index 0691b61..973ecd9 100755 +--- a/pynslcd/pynslcd.py ++++ b/pynslcd/pynslcd.py +@@ -30,13 +30,13 @@ import threading + import daemon + import ldap + +-import cfg +-import common +-import constants +-import invalidator +-import mypidfile +-import search +-from tio import TIOStream ++import pynslcd.cfg as cfg ++import pynslcd.common as common ++import pynslcd.constants as constants ++import pynslcd.invalidator as invalidator ++import pynslcd.mypidfile as mypidfile ++import pynslcd.search as search ++from pynslcd.tio import TIOStream + + + # the name of the program +@@ -188,20 +188,20 @@ def getpeercred(fd): + + + handlers = {} +-handlers.update(common.get_handlers('config')) +-handlers.update(common.get_handlers('alias')) +-handlers.update(common.get_handlers('ether')) +-handlers.update(common.get_handlers('group')) +-handlers.update(common.get_handlers('host')) +-handlers.update(common.get_handlers('netgroup')) +-handlers.update(common.get_handlers('network')) +-handlers.update(common.get_handlers('passwd')) +-handlers.update(common.get_handlers('protocol')) +-handlers.update(common.get_handlers('rpc')) +-handlers.update(common.get_handlers('service')) +-handlers.update(common.get_handlers('shadow')) +-handlers.update(common.get_handlers('pam')) +-handlers.update(common.get_handlers('usermod')) ++handlers.update(common.get_handlers('pynslcd.config')) ++handlers.update(common.get_handlers('pynslcd.alias')) ++handlers.update(common.get_handlers('pynslcd.ether')) ++handlers.update(common.get_handlers('pynslcd.group')) ++handlers.update(common.get_handlers('pynslcd.host')) ++handlers.update(common.get_handlers('pynslcd.netgroup')) ++handlers.update(common.get_handlers('pynslcd.network')) ++handlers.update(common.get_handlers('pynslcd.passwd')) ++handlers.update(common.get_handlers('pynslcd.protocol')) ++handlers.update(common.get_handlers('pynslcd.rpc')) ++handlers.update(common.get_handlers('pynslcd.service')) ++handlers.update(common.get_handlers('pynslcd.shadow')) ++handlers.update(common.get_handlers('pynslcd.pam')) ++handlers.update(common.get_handlers('pynslcd.usermod')) + + + def acceptconnection(nslcd_serversocket, session): +diff --git a/pynslcd/rpc.py b/pynslcd/rpc.py +index 49d9c7c..e1ea4f5 100644 +--- a/pynslcd/rpc.py ++++ b/pynslcd/rpc.py +@@ -18,10 +18,10 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + # 02110-1301 USA + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/search.py b/pynslcd/search.py +index 39850d2..f017451 100644 +--- a/pynslcd/search.py ++++ b/pynslcd/search.py +@@ -24,7 +24,7 @@ import sys + import ldap + import ldap.ldapobject + +-import cfg ++from pynslcd import cfg + + + # global indicator that there was some error connection to an LDAP server +diff --git a/pynslcd/service.py b/pynslcd/service.py +index b0c53e3..96c2aaf 100644 +--- a/pynslcd/service.py ++++ b/pynslcd/service.py +@@ -20,10 +20,10 @@ + + import datetime + +-import cache +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/shadow.py b/pynslcd/shadow.py +index 59e1af6..3ed695b 100644 +--- a/pynslcd/shadow.py ++++ b/pynslcd/shadow.py +@@ -20,11 +20,11 @@ + + import logging + +-import cache +-import cfg +-import common +-import constants +-import search ++from pynslcd import cache ++from pynslcd import cfg ++from pynslcd import common ++from pynslcd import constants ++from pynslcd import search + + + attmap = common.Attributes( +diff --git a/pynslcd/usermod.py b/pynslcd/usermod.py +index 4e37ded..ffd651b 100644 +--- a/pynslcd/usermod.py ++++ b/pynslcd/usermod.py +@@ -26,10 +26,10 @@ import os.path + + import ldap + +-import cfg +-import constants +-import pam +-import passwd ++from pynslcd import cfg ++from pynslcd import constants ++from pynslcd import pam ++from pynslcd import passwd + + + def list_shells(): diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests.patch new file mode 100644 index 000000000000..5e13854b6cd1 --- /dev/null +++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests.patch @@ -0,0 +1,34 @@ +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1bbbcc2..4adf062 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -23,7 +23,7 @@ TESTS = test_dict test_set test_tio test_expr test_getpeercred test_cfg \ + test_pamcmds.sh test_manpages.sh test_clock \ + test_tio_timeout + if HAVE_PYTHON +- TESTS += test_pycompile.sh test_pylint.sh ++ TESTS += test_pycompile.sh + endif + if ENABLE_PYNSLCD + TESTS += test_pynslcd_cache.py test_doctest.sh +@@ -48,7 +48,6 @@ EXTRA_DIST = README nslcd-test.conf usernames.txt testenv.sh test_myldap.sh \ + test_nsscmds.sh test_ldapcmds.sh test_pamcmds.sh \ + test_pamcmds.expect test_manpages.sh \ + test_pycompile.sh test_doctest.sh \ +- test_pylint.sh pylint.rc \ + test_flake8.sh flake8.ini \ + test_pynslcd_cache.py \ + setup_slapd.sh config.ldif test.ldif +diff --git a/tests/test_doctest.sh b/tests/test_doctest.sh +index 5b3a13d..26c73e7 100755 +--- a/tests/test_doctest.sh ++++ b/tests/test_doctest.sh +@@ -38,7 +38,7 @@ find_python() { + fi + done + } +-interpreters=`find_python | sort -u` ++interpreters=${PYTHON} + + # if Python is missing, ignore + if [ -z "$interpreters" ] diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-use-mkstemp.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-use-mkstemp.patch new file mode 100644 index 000000000000..1803067f402b --- /dev/null +++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-use-mkstemp.patch @@ -0,0 +1,25 @@ +diff --git a/pynslcd/cache.py b/pynslcd/cache.py +index 0be3a71..b463d2e 100644 +--- a/pynslcd/cache.py ++++ b/pynslcd/cache.py +@@ -22,6 +22,7 @@ import datetime + import os + import sqlite3 + import sys ++import tempfile + + + # TODO: probably create a config table +@@ -192,10 +193,8 @@ _connection = None + def _get_connection(): + global _connection + if _connection is None: +- filename = '/tmp/pynslcd_cache.sqlite' +- dirname = os.path.dirname(filename) +- if not os.path.isdir(dirname): +- os.mkdir(dirname) ++ tmpfd, filename = tempfile.mkstemp(suffix=".sqlite", prefix="pynslcd_cache") ++ os.close(tmpfd) + connection = sqlite3.connect( + filename, detect_types=sqlite3.PARSE_DECLTYPES, + check_same_thread=False) diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild new file mode 100644 index 000000000000..bc76968a7184 --- /dev/null +++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=(python3_{6..8}) +inherit eutils prefix python-r1 autotools multilib multilib-minimal systemd s6 + +DESCRIPTION="NSS module for name lookups using LDAP" +HOMEPAGE="https://arthurdejong.org/nss-pam-ldapd/" +SRC_URI="https://arthurdejong.org/${PN}/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug kerberos +pam pynslcd sasl test +utils" +RESTRICT="!test? ( test )" + +COMMON_DEP=" + acct-group/nslcd + acct-user/nslcd + net-nds/openldap[${MULTILIB_USEDEP}] + sasl? ( dev-libs/cyrus-sasl[${MULTILIB_USEDEP}] ) + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] ) + sys-libs/pam[${MULTILIB_USEDEP}] + utils? ( ${PYTHON_DEPS} ) + pynslcd? ( + dev-python/python-ldap[${PYTHON_USEDEP}] + dev-python/python-daemon[${PYTHON_USEDEP}] + ) + !sys-auth/nss_ldap + !sys-auth/pam_ldap +" +RDEPEND="${COMMON_DEP}" +DEPEND="${COMMON_DEP} + test? ( + ${PYTHON_DEPS} + dev-python/pylint[${PYTHON_USEDEP}] + ) +" +BDEPEND=" + ${PYTHON_DEPS} + sys-devel/automake +" + +REQUIRED_USE=" + utils? ( ${PYTHON_REQUIRED_USE} ) + test? ( ${PYTHON_REQUIRED_USE} pynslcd ) +" + +PATCHES=( + "${FILESDIR}/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch" + "${FILESDIR}/nss-pam-ldapd-0.9.11-use-mkstemp.patch" + "${FILESDIR}/nss-pam-ldapd-0.9.11-relative-imports.patch" + "${FILESDIR}/nss-pam-ldapd-0.9.11-tests.patch" +) + +src_prepare() { + default + use utils && python_setup + touch pynslcd/__init__.py || die "Could not create __init__.py for pynslcd" + mv pynslcd/pynslcd.py pynslcd/main.py || die + + eautoreconf +} + +multilib_src_configure() { + local -a myconf=( + --disable-utils + --enable-warnings + --with-ldap-lib=openldap + --with-ldap-conf-file=/etc/nslcd.conf + --with-nslcd-pidfile=/run/nslcd/nslcd.pid + --with-nslcd-socket=/run/nslcd/socket + $(usex x86-fbsd '--with-nss-flavour=' '--with-nss-flavour=' 'freebsd' 'glibc') + $(use_enable pynslcd) + $(use_enable debug) + $(use_enable kerberos) + $(use_enable pam) + $(use_enable sasl) + ) + + # nss libraries always go in /lib on Gentoo + if multilib_is_native_abi ; then + myconf+=("--with-pam-seclib-dir=${EPREFIX}/$(get_libdir)/security") + myconf+=("--libdir=${EPREFIX}/$(get_libdir)") + else + myconf+=("--with-pam-seclib-dir=/$(get_libdir)/security") + myconf+=("--libdir=/$(get_libdir)") + fi + + ECONF_SOURCE="${S}" econf "${myconf[@]}" +} + +multilib_src_test() { + pushd "${BUILD_DIR}" >/dev/null || die + ln -s ../pynslcd/constants.py utils/constants.py || die + python_foreach_impl python_test + popd >/dev/null || die +} + +python_test() { + emake check +} + +multilib_src_install_all() { + local script + + newinitd "${FILESDIR}"/nslcd.init nslcd + s6_install_service nslcd "${FILESDIR}"/nslcd.s6 + + insinto /usr/share/nss-pam-ldapd + doins "${WORKDIR}/${P}/nslcd.conf" + + fperms o-r /etc/nslcd.conf + + if use utils; then + python_moduleinto nslcd + python_foreach_impl python_domodule utils/*.py + + for script in chsh getent; do + python_foreach_impl python_newscript utils/${script}.py ${script}.ldap + done + fi + if use pynslcd; then + rm -rf "${D}"/usr/share/pynslcd + python_moduleinto pynslcd + python_foreach_impl python_domodule pynslcd/*.py + python_scriptinto /usr/sbin + python_foreach_impl python_newscript pynslcd/main.py pynslcd + newinitd "${FILESDIR}"/pynslcd.init pynslcd + fi + + systemd_newtmpfilesd "${FILESDIR}"/nslcd-tmpfiles.conf nslcd.conf + systemd_newunit "${FILESDIR}"/nslcd.service nslcd.service +} + +multilib_src_install() { + emake DESTDIR="${D}" install + + if use pynslcd; then + python_moduleinto pynslcd + python_foreach_impl python_domodule pynslcd/*.py + fi +} + +pkg_postinst() { + echo + elog "For this to work you must configure /etc/nslcd.conf" + elog "This configuration is similar to pam_ldap's /etc/ldap.conf" + echo + elog "In order to use nss-pam-ldapd, nslcd needs to be running. You can" + elog "start it like this:" + elog " # /etc/init.d/nslcd start" + echo + elog "You can add it to the default runlevel like so:" + elog " # rc-update add nslcd default" + elog + elog "If you have >=sys-apps/openrc-0.16.3, you can also use s6" + elog "to supervise this service." + elog "To do this, emerge sys-apps/s6 then add nslcd-s6" + elog "default runlevel instead of nslcd." + elog + elog "If you are upgrading, keep in mind that /etc/nss-ldapd.conf" + elog " is now named /etc/nslcd.conf" + echo +} |