user.eclass: avoid calling nscd if it doesn't exist
authorTim Harder <radhermit@gentoo.org>
Mon, 25 Feb 2019 11:55:36 +0000 (05:55 -0600)
committerTim Harder <radhermit@gentoo.org>
Mon, 25 Feb 2019 12:07:20 +0000 (06:07 -0600)
Signed-off-by: Tim Harder <radhermit@gentoo.org>
eclass/user.eclass

index 97e417a7be9de6b7eec1712a844aef739edb8ff6..f6a10a6bee2816eba4fe209e5b38115ac76c0d84 100644 (file)
@@ -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