From nobody Thu Sep 07 20:28:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RhW6S6R5Fz4ssqq; Thu, 7 Sep 2023 20:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RhW6S4kCzz4Zbk; Thu, 7 Sep 2023 20:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694118528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cep6kGD5HkmYKQR6lG2qppttM/x6s1DqkNgq9omfu88=; b=ToWnohX1DFr2GXJj+PrCvblMlZvmaMX/tzFWjh4s5clE2tbWNa4AIS4i1aWAo5tQzFlmqw Pitrqha/dRgU4fECxHeIKYMZF2Iv9uMnz3vtJIU0hHfQJu+rJdqhSQ23ASfL/M9P2KOOcg QicZ8+skxiGZZYbDCzjv0rtA21QeRA60SNodGQFohVvk8giQ/JDMylH1Dz5/LT30PioTzq kX0PRpOoJYRz4kAsn+4cnf8vLzpD8rGGfjoF5/zhsrsRVkyf4Wh0ro2BVWMa+2Znb9D7vv DEDvXt9pyhE+RSIpmLbcVUqj9GbAcZ8vhGw0k2XdMkUxr4Bmt3RUS58NoSqtOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694118528; a=rsa-sha256; cv=none; b=rvDpu3W9gDQcB6VWCEA6P0Rw55r187o/Tz0plnKwLpczRIb/4KtxmROBPGnNWWH5Q9dHUS O5qdpshXJpvSVYPsggHiiwMXifrCO344WzwKsJRkttgq9hCaZjIY+7DCR6FuX5FhL0lkwV cwQMPW85yq+qn1dqt8QMYRTLcV1fQYVaBsIKcnklQF0rgBTzsfWfJ9MCGcMJWG/knS1Sf7 PBR7TkwgEYbpTHkbhuRvhfIhNdmOo/YaWGGhBAKDvjSLPI6M5IHgr+3YhQujezxCuF//5a nDRZwuCndeDTUAITC7O+LoEUYI/Ja5oHv8tLSo4isuYHEiU3tCjzH0L/GN4C9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694118528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cep6kGD5HkmYKQR6lG2qppttM/x6s1DqkNgq9omfu88=; b=g7RKs0tKhX3L0WdozrG6ZTkPWR8PuSAVGfr8duFi+PPM0kILbHkMEL7ck9OQCzJOSFURLC yjYR5wg5JV6/X8C7DKtGqOAH8H9tKFhglhYJuIqAU59LYJFF3cZU7y3q/1tHEKINSFU+Vg h3GwhgbONMzIjopxDSOnK5erKt/opx/0lBRVfVyP4eQ7LE+j36d95Fv7wuRcUw5Sh6HFH/ y0Uq/kBOBIe/y/UwGdljNarbeEfn85Qcd68wZFBOR13llH2pJPrrzL3ILSN2cYFs+Ckz7y DILxG/1f9uwtrbb/QweSSdItMvDh3fqPK11TOcREMlNPpFiqsaAIHu8Fcy9GoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RhW6S3B4Rz1CcX; Thu, 7 Sep 2023 20:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 387KSmvp064683; Thu, 7 Sep 2023 20:28:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 387KSmrr064680; Thu, 7 Sep 2023 20:28:48 GMT (envelope-from git) Date: Thu, 7 Sep 2023 20:28:48 GMT Message-Id: <202309072028.387KSmrr064680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a781134d4967 - stable/14 - nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a781134d4967f25f7685f59c7361131f1c39831a Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a781134d4967f25f7685f59c7361131f1c39831a commit a781134d4967f25f7685f59c7361131f1c39831a Author: Dag-Erling Smørgrav AuthorDate: 2023-08-31 07:49:41 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-09-07 20:28:30 +0000 nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). These aren't really needed, since TACACS+ does not support enumeration, but providing placeholders keeps nsdispatch() from complaining that they're missing. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41658 (cherry picked from commit 56b74a2d856c4d65a4b5c72d1352067b6b469d3b) Approved by: re (gjb) --- lib/nss_tacplus/nss_tacplus.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/nss_tacplus/nss_tacplus.c b/lib/nss_tacplus/nss_tacplus.c index e18ffe2315ce..238d7bf301ad 100644 --- a/lib/nss_tacplus/nss_tacplus.c +++ b/lib/nss_tacplus/nss_tacplus.c @@ -271,12 +271,43 @@ nss_tacplus_getpwnam_r(void *retval, void *mdata __unused, va_list ap) return (ret); } +static int +nss_tacplus_setpwent(void *retval __unused, void *mdata __unused, + va_list ap __unused) +{ + return (NS_SUCCESS); +} + +static int +nss_tacplus_getpwent_r(void *retval, void *mdata __unused, va_list ap) +{ + struct passwd *pwd __unused = va_arg(ap, struct passwd *); + char *buffer __unused = va_arg(ap, char *); + size_t bufsize __unused = va_arg(ap, size_t); + int *result = va_arg(ap, int *); + + *(void **)retval = NULL; + *result = 0; + return (NS_SUCCESS); + +} + +static int +nss_tacplus_endpwent(void *retval __unused, void *mdata __unused, + va_list ap __unused) +{ + return (NS_SUCCESS); +} + ns_mtab * nss_module_register(const char *name __unused, unsigned int *plen, nss_module_unregister_fn *unreg) { static ns_mtab mtab[] = { { "passwd", "getpwnam_r", &nss_tacplus_getpwnam_r, NULL }, + { "passwd", "setpwent", &nss_tacplus_setpwent, NULL }, + { "passwd", "getpwent_r", &nss_tacplus_getpwent_r, NULL }, + { "passwd", "endpwent", &nss_tacplus_endpwent, NULL }, }; *plen = nitems(mtab);