From: Theodore Ts'o Date: Thu, 21 Mar 2019 01:58:52 +0000 (-0400) Subject: e2scrub,e2scrub_all: print a (more understandable) error if not run as root X-Git-Tag: v1.45.1-rc1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e97d4c46a4915d7c7d70e6ef9e66c9aea252213f;p=thirdparty%2Fe2fsprogs.git e2scrub,e2scrub_all: print a (more understandable) error if not run as root Signed-off-by: Theodore Ts'o --- diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in index 301574968..666d6485a 100644 --- a/scrub/e2scrub.in +++ b/scrub/e2scrub.in @@ -25,6 +25,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +if (( $EUID != 0 )); then + echo "e2scrub must be run as root" + exit 1 +fi + snap_size_mb=256 fstrim=0 reap=0 diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in index a53acbae5..31ebc7970 100644 --- a/scrub/e2scrub_all.in +++ b/scrub/e2scrub_all.in @@ -20,6 +20,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +if (( $EUID != 0 )); then + echo "e2scrub_all must be run as root" + exit 1 +fi + scrub_all=0 snap_size_mb=256 reap=0