Date: Thu, 7 Sep 2023 20:28:48 GMT From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: a781134d4967 - stable/14 - nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). Message-ID: <202309072028.387KSmrr064680@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <des@FreeBSD.org> AuthorDate: 2023-08-31 07:49:41 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309072028.387KSmrr064680>