lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Mar 2019 12:36:38 +0100
From:   Lukas Czerner <lczerner@...hat.com>
To:     Theodore Ts'o <tytso@....edu>
Cc:     Ext4 Developers List <linux-ext4@...r.kernel.org>,
        darrick.wong@...cle.com
Subject: Re: [PATCH 9/9] e2scrub,e2scrub_all: print a (more understandable)
 error if not run as root

On Wed, Mar 20, 2019 at 10:02:18PM -0400, Theodore Ts'o wrote:
> Signed-off-by: Theodore Ts'o <tytso@....edu>
> ---
>  scrub/e2scrub.in     | 5 +++++
>  scrub/e2scrub_all.in | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> 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

EUID is bashism and might not be available in a different shell. But I
am sure we're using a lot of those and we have "#!/bin/bash".

It's just somehting to consider, because I am not sure if we say
anywhere that those scripts will require bash. Personally I do not care
too much, but I am using bash exclusively :)

-Lukas

> +    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 cad232987..a02ffe226 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
> -- 
> 2.19.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ