commit:     7a256457b840ea66345e7a00f6a90dbf05c27381
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 25 11:55:36 2019 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Feb 25 12:07:20 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a256457

user.eclass: avoid calling nscd if it doesn't exist

Signed-off-by: Tim Harder <radhermit <AT> gentoo.org>

 eclass/user.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/user.eclass b/eclass/user.eclass
index 97e417a7be9..f6a10a6bee2 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

Reply via email to