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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdWad4QnmXVr82isawC055GwDE5vbERdpYRR2KmD2rX1tQ@mail.gmail.com>
Date:   Tue, 1 Oct 2019 11:55:24 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     linux-kbuild <linux-kbuild@...r.kernel.org>,
        Michal Marek <michal.lkml@...kovi.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kbuild: add $(BASH) to run scripts with bash-extension

Hi Yamada-san,

On Sun, Aug 25, 2019 at 3:29 PM Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> CONFIG_SHELL falls back to sh when bash is not installed on the system,
> but nobody is testing such a case since bash is usually installed.
> That is, shell scripts invoked by CONFIG_SHELL are only tested with
> bash.
>
> It makes it difficult to test whether the hashbang #!/bin/sh is real.
> In fact, I saw some patches trying to add bash-extension to #!/bin/sh
> script.
>
> Besides, some shell scripts invoked by CONFIG_SHELL use bash-extension
> and #!/bin/bash is specified as the hashbang, while CONFIG_SHELL may
> not always be set to bash.
>
> Probably, the right thing to do is to introduce BASH that is bash by
> default, and always set CONFIG_SHELL to sh. Replace $(CONFIG_SHELL)
> with $(BASH) for #!/bin/bash scripts.
>
> If somebody tries to add bash-extension to a #!/bin/sh script, it will
> be caught by somebody because /bin/sh is a symlink to dash on some
> major distributions.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>

This is now commit 858805b336be1cab ("kbuild: add $(BASH) to run scripts
with bash-extension").

This commit has the strange side-effect of inserting the contents of a
localversion file in the build directory twice.

Steps to reproduce:

    src-dir$ echo src > localversion
    build-dir$ echo build > localversion
    build-dir$ make defconfig; make include/generated/utsrelease.h;
cat include/generated/utsrelease.h
    ...
    #define UTS_RELEASE "5.3.0-rc4buildbuildsrc+"

Building in the source directory is OK.

    src-dir$ make defconfig; make include/generated/utsrelease.h; cat
include/generated/utsrelease.h
    ...
    #define UTS_RELEASE "5.3.0-rc4src+"

Changing scripts/setlocalversion to use /bin/bash does not fix the issue.

Do you have a clue?
Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ