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:   Wed, 14 Jul 2021 20:54:17 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Mikulas Patocka <mpatocka@...hat.com>
Cc:     Nico Schottelius <nico-linuxsetlocalversion@...ottelius.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] scripts/setlocalversion: fix a bug when LOCALVERSION
 is empty

On Tue, Jul 13, 2021 at 5:59 PM Mikulas Patocka <mpatocka@...hat.com> wrote:
>
>
>
> On Mon, 12 Jul 2021, Nico Schottelius wrote:
>
> >
> > Sorry to say, but I am not convinced by the patch.
> >
> > While yes, we might have changed the behaviour slightly, reading
> > something on the line of
> >
> > if [ -z ... ]
> >
> > is significantly more simple, elegant and easier to maintain, than
> > a rather atypical special case for setting a variable to empty,
> > using
> >
> > if [ "${LOCALVERSION+set}" != "set" ] ..
> >
> > *and* because it is so atypical, adding a long comment for it, too.
> >
> > Additonally, -z should be correct if the variable *is* truly empty. I
> > assume it actually isn't and contains whitespace, which is not the same
> > as being set and empty.
> >
> > Instead of re-adding complexity, could you consider changing the build
> > flow so that LOCALVERSION is either unset or empty?
> >
> > Nico
>
> I set LOCALVERSION to an empty string (with "export LOCALVERSION="). This
> prevented the kernel from adding a "+" sign to the kernel version. Since
> the commit 042da426f8eb, it no longer works and the kernel adds a "+" sign
> if LOCALVERSION is set and empty.
>
> If you don't like "if [ "${LOCALVERSION+set}" != "set" ]", then please
> provide some other way how to test if the variable is set.

if [ -z "${LOCALVERSION+set}" ]

is the alternative way I came up with, but
I am OK with your v3.


I will pick it up for -rc2.




-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ