From: Tim Harder Date: Mon, 25 Feb 2019 11:55:36 +0000 (-0600) Subject: user.eclass: avoid calling nscd if it doesn't exist X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=7a256457b840ea66345e7a00f6a90dbf05c27381;p=gentoo.git user.eclass: avoid calling nscd if it doesn't exist Signed-off-by: Tim Harder --- diff --git a/eclass/user.eclass b/eclass/user.eclass index 97e417a7be9d..f6a10a6bee28 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -88,8 +88,8 @@ egetent() { grep "${key}:\*:" /etc/${db} ;; *) - # ignore output if nscd doesn't exist, or we're not running as root - nscd -i "${db}" 2>/dev/null + # ignore nscd output if we're not running as root + type -p nscd >/dev/null && nscd -i "${db}" 2>/dev/null getent "${db}" "${key}" ;; esac