From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 6Mi+CI10RmZ+UAEAqHPOHw:P1 (envelope-from ) for ; Thu, 16 May 2024 23:03:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 6Mi+CI10RmZ+UAEAqHPOHw (envelope-from ) for ; Thu, 16 May 2024 23:03:09 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="WVKZJVg/"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715893389; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=T5F33nfKtE6ebjq3kWuAql7F+XF6JQR0uBHUoLvlkn4=; b=ovrmcWz9+gFZr1iHo7aQRN/FWBHhQpgAD+1obcZvw7ax1DdDGrfAewENAKQxfpYubW+Tmz 4/I7GQX/44HXb5hjyKhLxo8LQtZyMvI9SIWzDdK+JM48huek6QOvplZT8b7wxK58i3wo2r P0x+zjg/WwNIRsc2YFyOsxmDjUprJSAR+ORcuaSE3DWok0MyKMdhPEl357VYYZXAZMJTNR Y0PMkxZmwyyHXiF2uCgn4GIlzmZ2ylG2R1fzoFPoHhk7ZgAUNKGS009kwwdanIbcGIAss6 nCbz4IHn2vEHypVhu+Hmzo0FyOfg6BtgX3tc1lsrF4b1OuP8lX6J9ty5TEYn5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="WVKZJVg/"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715893389; a=rsa-sha256; cv=none; b=b9y9E9engE4HrFCUlTX1zqk7dv/J0jITUZ+oeeSuEE/8tjKfHwFn9j8nMwR/a+z5JZliYG TQ231Oj3t+oucJBTHqwmQ2tIjaGKWpfWZUMzXKAB7SYzRbX/gupK0fzaqFSY7RMDXiJADI SLLoyFMn2Ak6g7RiE5NqUFLEGcjQ2ZkUEnUSOrEGVhkxlDnBDjQWTK37PZqXop5p56SghY Sy6SkWorNUuFxblAEpFkiyYaFgqQ3nTYcMeP+qMgPKnH0itiSJiHrQn6IYB5xdGBT358KS LhuTrWAIsCPkBirhQ8lcrNDh4GSeBpSmVW6qNmSyH8abOTdp2OhiwpH8/cF0uw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DB6AF39B3F for ; Thu, 16 May 2024 23:03:08 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7iFh-000525-O7; Thu, 16 May 2024 17:03:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7iFg-00051L-1h for guix-patches@gnu.org; Thu, 16 May 2024 17:03:00 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7iFf-0002Va-M6 for guix-patches@gnu.org; Thu, 16 May 2024 17:02:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7iFi-00042D-1s for guix-patches@gnu.org; Thu, 16 May 2024 17:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70992] [PATCH] services: nscd: Enable =?UTF-8?Q?=E2=80=98passwd=E2=80=99?= and =?UTF-8?Q?=E2=80=98group=E2=80=99?= caches by default. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 May 2024 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70992 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70992@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171589334715481 (code B ref -1); Thu, 16 May 2024 21:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 May 2024 21:02:27 +0000 Received: from localhost ([127.0.0.1]:50988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7iF8-00041d-QJ for submit@debbugs.gnu.org; Thu, 16 May 2024 17:02:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:55710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7iF6-00041R-OV for submit@debbugs.gnu.org; Thu, 16 May 2024 17:02:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7iF3-0004po-Qq for guix-patches@gnu.org; Thu, 16 May 2024 17:02:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7iF2-0002Lt-IQ; Thu, 16 May 2024 17:02:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=T5F33nfKtE6ebjq3kWuAql7F+XF6JQR0uBHUoLvlkn4=; b=WVKZJVg/MB08LS LyE8T72bJU6KVlXa+AfmDFvSb/UT0CIWNTeLd33Gz8s2o7zoeuZJXtCrpliEIChV6ByfQmGujryVW 7udEvTBuq2cKN+c7ab4anNS8uaDA+/K8qYUJACcr7GcmhBMsAszbyW5u1icAVgt2UvlHZlil+qgXE 3lzEmX92eCWbrkArx21Emq98Mi52etBBRfRvbYDENcRs8BDl/9kTeoRHagc8uhUZduUqISqgcXtWy i0CGkYIPQSbxD3N6dK+0RulV0A2aEoHQwEbVjGc8X2CBk6RP2mZN0qbpZwWvu1QeoVNczaUeXv0md hQxSvEXOKEpamr1NFOaQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 May 2024 23:01:45 +0200 Message-ID: <7942e1351315694f0c6675a702f4153fd83cadc3.1715893079.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.27 X-Spam-Score: -6.27 X-Migadu-Queue-Id: DB6AF39B3F X-Migadu-Scanner: mx13.migadu.com X-TUID: bQ2iHJzm5ryY From: Ludovic Courtès This allows users to specify NSS plugins such as LDAP via the ‘name-services’ field of . Failing that, user code will dlopen whatever passwd/group plugins are listed in /etc/nsswitch.conf, which is likely to fail, typically because those are not in $LD_LIBRARY_PATH. * gnu/services/base.scm (%nscd-default-caches): Add ‘passwd’ and ‘group’ caches. Change-Id: I9c03346a1de2710685f7801eccd2e08007427f5d --- gnu/services/base.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) Hi! I realized by looking at ‘strace id’ that our nscd instance was replying negatively to passwd and group lookups (to my surprise). Turns out we need to explicitly enable caching of a database in nscd.conf if we want nscd to honor lookups for that database. We really need nscd to honor passwd/group lookups if we want to support NSS plugins like LDAP or sss. (Now I realize that this is something Jean-François et al. probably experienced with their OpenLDAP service at .) Thoughts? Ludo’. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 85160bd3abb..15f3807efcc 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1340,7 +1340,22 @@ (define %nscd-default-caches (positive-time-to-live (* 3600 24)) (negative-time-to-live 3600) (check-files? #t) ;check /etc/services changes - (persistent? #t)))) + (persistent? #t)) + + ;; Enable minimal caching of the user databases, not so much for + ;; caching but rather to allow that uses of NSS plugins like LDAP + ;; don't lead user processes to dlopen them (which is likely to fail + ;; due to them not being found in $LD_LIBRARY_PATH). + (nscd-cache (database 'passwd) + (positive-time-to-live 600) + (negative-time-to-live 20) + (check-files? #t) ;check /etc/passwd changes + (persistent? #f)) + (nscd-cache (database 'group) + (positive-time-to-live 600) + (negative-time-to-live 20) + (check-files? #t) ;check /etc/group changes + (persistent? #f)))) (define-deprecated %nscd-default-configuration #f base-commit: 58be9a79e2862d5fa9842d73f498ce2e5442b9ce -- 2.41.0