Re: [PATCH] policycoreutils/fixfiles: Use parallel relabeling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 16, 2022 at 6:49 PM Petr Lautrbach <plautrba@xxxxxxxxxx> wrote:
> Commit 93902fc8340f ("setfiles/restorecon: support parallel relabeling")
> implemented support for parallel relabeling in setfiles. This is
> available for fixfiles now.
>
> Signed-off-by: Petr Lautrbach <plautrba@xxxxxxxxxx>
> ---
>  policycoreutils/scripts/fixfiles   | 33 +++++++++++++++++-------------
>  policycoreutils/scripts/fixfiles.8 | 17 +++++++++------
>  2 files changed, 30 insertions(+), 20 deletions(-)
>
> diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
> index 6fb12e0451a9..33db1d3bfb61 100755
> --- a/policycoreutils/scripts/fixfiles
> +++ b/policycoreutils/scripts/fixfiles
[...]
> @@ -330,7 +331,8 @@ case "$1" in
>         > /.autorelabel || exit $?
>         [ -z "$FORCEFLAG" ] || echo -n "$FORCEFLAG " >> /.autorelabel
>         [ -z "$BOOTTIME" ] || echo -N $BOOTTIME >> /.autorelabel
> -       [ -z "$BIND_MOUNT_FILESYSTEMS" ] || echo "-M" >> /.autorelabel
> +       [ -z "$BIND_MOUNT_FILESYSTEMS" ] || echo "-M " >> /.autorelabel

I believe you need -n here? Although the line above also doesn't have
it... I guess the contents get the whitespace squashed in the end
anyway? Still, would be nice to clean up all these lines to use a
consistent pattern. I'd prefer:

echo -n "$SOMETHING "
(or in case of the variable containing an argument:)
echo -n "-X $XXX "

> +       [ -z "$THREADS" ] || echo -n "$THREADS " >> /.autorelabel
>         # Force full relabel if SELinux is not enabled
>         selinuxenabled || echo -F > /.autorelabel
>         echo "System will relabel on next boot"
[...]

--
Ondrej Mosnacek
Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux