From 0f798c48edfdd5376ef9ac9cd0c4b7d9281380da Mon Sep 17 00:00:00 2001 From: Eivind Eklund Date: Wed, 19 Jun 2002 19:22:18 +0000 Subject: [PATCH] Make locate.updatedb tell about the security risk when it is run as root. --- usr.bin/locate/locate/updatedb.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index 361e72d6de3..b9bf69899ca 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -28,6 +28,11 @@ # # $FreeBSD$ +if [ "$(id -u)" = "0" ]; then + echo ">>> WARNING" 1>&2 + echo ">>> Executing updatedb as root. This WILL reveal all filenames" 1>&2 + echo ">>> on your machine to all login users, which is a security risk." 1>&2 +fi : ${LOCATE_CONFIG="/etc/locate.rc"} if [ -f "$LOCATE_CONFIG" -a -r "$LOCATE_CONFIG" ]; then . $LOCATE_CONFIG