From 9cd080be89db78f3172c062c5d95603a6b6964d7 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 9 Sep 2011 00:45:49 -0400 Subject: [PATCH] getspent: Pay attention to NSS_NONLOCAL_IGNORE Signed-off-by: Anders Kaseorg --- nonlocal-shadow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nonlocal-shadow.c b/nonlocal-shadow.c index ab8f442..386230c 100644 --- a/nonlocal-shadow.c +++ b/nonlocal-shadow.c @@ -113,6 +113,11 @@ _nss_nonlocal_getspent_r(struct spwd *pwd, char *buffer, size_t buflen, int *errnop) { enum nss_status status; + + char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV); + if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0') + return NSS_STATUS_UNAVAIL; + if (spent_nip == NULL) { status = _nss_nonlocal_setspent(0); if (status != NSS_STATUS_SUCCESS) -- 2.44.0