#997911 lintian: bash-term-in-posix-shell false positive for '<<<' in quoted strings

#997911#5
Date:
2021-10-26 23:56:46 UTC
From:
To:
Hi,

src:nvidia-graphics-driver has this in its bug script:

    echo "<<<<<<<<<< $file >>>>>>>>>>"

which triggers a new lintian warning:

I: libcuda1: bash-term-in-posix-shell [usr/share/bug/libcuda1/script:126] '<<<'
I: libcuda1: bash-term-in-posix-shell [usr/share/bug/libcuda1/script:134] '<<<'


Andreas

#997911#10
Date:
2021-11-14 12:31:53 UTC
From:
To:
[...]

Hello,

The curly-braces check ("{foo,bar} instead of foo bar") also has some
false positives, afaik ${VARIABLE} is perfectly legal but trigggers a
warning:
I: exim4-base: bash-term-in-posix-shell [etc/cron.daily/exim4-base:62] '${HOSTNAME
The line number seems to be off, BTW:
ametzler@argenau:/tmp/EXIM4$ cat -n exim-4.95/debian/exim4-base/etc/cron.daily/exim4-base  | grep HOSTNAME
    38          if ! HOSTNAME=$(/usr/sbin/exim4 -be '${primary_hostname}'); then
    39                  HOSTNAME="$(hostname)"
    61                  | mail -s"${HOSTNAME} Daily e-mail activity report" \
    65                  | mail -s"${HOSTNAME} Daily e-mail activity report" \
    91        "${HOSTNAME}" "${E4BCD_PANICLOG_REPORT_TO}" "${HOSTNAME}" \

cu Andreas

#997911#15
Date:
2026-11-07 23:19:14 UTC
From:
To:
Hi

I was triaging through lintian tagged bugs and came across this. I
locally ran lintian (master branch from salsa) on nvidia-graphics-driver
and this false positive is not showing up anymore even though
debian/bug-script still has the following string:

     "<<<<<<<<<< $file >>>>>>>>>>"

UDD's lintian also doesn't show this false positive anymore:
https://udd.debian.org/lintian/?packages=nvidia-graphics-drivers

So I believe this bug can be closed.

#997911#20
Date:
2026-11-08 07:25:35 UTC
From:
To:
Thank you so much for trying to help. However, the analysis is wrong. I checked
the code in question which has no fix for this since 2021.

What "fixed" it was a seemingly incorrect fix for #999756 in https://salsa.debian.org/lintian/lintian/-/commit/2bb5c6a905
which starts to ignore things after `exec`. Sure enough, the bug-script has an "exec >&3" line here

https://salsa.debian.org/nvidia-team/nvidia-graphics-drivers/-/blob/550/debian/bug-script?ref_type=heads#L7

And hence the entire thing after that started to be ignored. If I make the following changes and run lintian again
I see the issue once again:

| $ git --no-pager diff
| diff --git a/lib/Lintian/Check/Shell/NonPosix/BashCentric.pm b/lib/Lintian/Check/Shell/NonPosix/BashCentric.pm
| index 024ea6a1f..ac66d68a2 100644
| --- a/lib/Lintian/Check/Shell/NonPosix/BashCentric.pm
| +++ b/lib/Lintian/Check/Shell/NonPosix/BashCentric.pm
| @@ -203,8 +203,8 @@ sub check_bash_centric {
|         $stashed = $EMPTY;
|
|         # see Bug#999756 and tclsh(1)
| -        last
| -          if $line =~ m{^ exec \s }x;
| +       # last
| +       #   if $line =~ m{^ exec \s }x;
|
|          my $pointer = $item->pointer($position);
|
| $ bin/lintian /tmp/h/libcuda1_550.163.01-6_amd64.deb --display-info
| E: libcuda1: alien-tag binary-file-built-without-LFS-support [usr/share/lintian/overrides/libcuda1:2]
| I: libcuda1: bash-term-in-posix-shell '<<<' [usr/share/bug/libcuda1/script:126]
| I: libcuda1: bash-term-in-posix-shell '<<<' [usr/share/bug/libcuda1/script:134]

There is aflplusplus package for instance which does not have `exec` and output this false-positive diagnostic.

https://udd.debian.org/lintian/?email1=&email2=&email3=&packages=aflplusplus&ignpackages=&format=html<_error=on<_warning=on<_information=on&lintian_tag=#all

aflplusplus	5.03c-1 (forky sid)	afl++/5.03c-1	information	bash-term-in-posix-shell	8	'<<<' [usr/bin/afl-whatsup:226]

So the bug is still present. Patches to fix that are welcome.

As for the false diagnostic of skipping everything after `exec` which is too-simplistic and becomes wrong, I've opened an MR https://salsa.debian.org/lintian/lintian/-/merge_requests/829
to fix that.

Thanks again,
Nilesh

#997911#25
Date:
2026-11-08 18:03:53 UTC
From:
To:
Thank you Nilesh for pointing in the right direction. I was able to
reproduce it and make a patch:
https://salsa.debian.org/lintian/lintian/-/merge_requests/830

Thank you!
Subin

#997911#28
Date:
2026-11-14 12:56:20 UTC
From:
To:
Hello,

Bug #997911 in lintian reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/lintian/lintian/-/commit/879e7c0b6233fbe0b8e32ca579e15d76d5732dc5
Make sure the same still works for expressions like `"$(a <<< b)"`
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/997911

#997911#35
Date:
2026-11-14 14:34:19 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
lintian, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 997911@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Nilesh Patra <nilesh@debian.org> (supplier of updated lintian package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 14 Nov 2026 13:57:11 +0100
Source: lintian
Architecture: source
Version: 2.144.0
Distribution: unstable
Urgency: medium
Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
Changed-By: Nilesh Patra <nilesh@debian.org>
Closes: 997911 1126769 1151963 1153525 1153831
Changes:
 lintian (2.144.0) unstable; urgency=medium
 .
   [ Nilesh Patra ]
   * Summary of tag changes:
     + Added:
       - orig-tarball-contains-ancient-file
   * Change severity of `no-dep5-copyright` to info (Closes: #1151963)
   * Distribution.pm: Do not error `distribution-and-changes-mismatch` for sid
     and unstable
   * tests(changes-distribution-mismatch-fp): Add test to check for
     `distribution-and-changes-mismatch` for sid v/s unstable
   * BashCentric.pm: Tighten check for `exec` to continue parsing
     on redirection execs (See: #997911)
   * tests(exec-exception): Add test to check against exec exception for
     bashism in scripts
   * tests(cruft-general-quilt): Drop check for `debian/.pc` as it is dropped
     by dpkg-source by default with dpkg version 1.23.12
   * tests: Adjust output with new groff version 1.25.0-2
   * ObsoleteSites.pm: Add exceptions file to not flag some obsolete links
     with valid subdomains (Closes: #1126769)
   * tests(obsolete-sites-fp): Add test to check for obsolete
     site exceptions (See: #1126769)
   * scripts/versioned-interpreters: Add `:any` for lua now that all versions
     have been marked `M-A: allowed`
 .
   [ Louis-Philippe Véronneau ]
   * Update lintian Maintainers
 .
   [ Rafael Laboissière ]
   * Add new check for ancient files in the orig tarball (Closes: #1153525)
   * tags(package-contains-ancient-file): Document the correct cut-off point
     for ancient files (Closes: #1153831)
 .
   [ Subin Siby ]
   * BashCentric.pm: Update regex to ignore <<< in "" string literals
     (Closes: #997911)
Checksums-Sha1:
 9091377444f351f62799281a925a970b9f9ab1bf 3721 lintian_2.144.0.dsc
 e9bbc8421bc342b06836f18c6c9a2307076c2599 2084176 lintian_2.144.0.tar.xz
 2fd2f89a69a3ea169c98f619873895e1226f2481 22161 lintian_2.144.0_amd64.buildinfo
Checksums-Sha256:
 80d54827359ece4a329aa78e00d3542752abf218bce70a850c8ace604d7c7f24 3721 lintian_2.144.0.dsc
 c7bc3ac4fc41ca3066d5543c092afcf03d98349f1d025abaae3513f13806f7cd 2084176 lintian_2.144.0.tar.xz
 1f5a358f47bed46d7e7df5284019237e9091a7591a8888edc1f6b66cd9e52125 22161 lintian_2.144.0_amd64.buildinfo
Files:
 65b779f72e9a1120f384d32ea18d9d87 3721 devel optional lintian_2.144.0.dsc
 9833c27d0a16f50461f2f15ec5d9aea5 2084176 devel optional lintian_2.144.0.tar.xz
 4056f0a780e7a09c32b27cf778e0ee06 22161 devel optional lintian_2.144.0_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iKQEARYKAEwWIQSglbZu4JAkvuai8HIqJ5BL1yQ+2gUCavhqnBsUgAAAAAAEAA5t
YW51MiwyLjUrMS4xMiwwLDMSHG5pbGVzaEBkZWJpYW4ub3JnAAoJEConkEvXJD7a
sZMA/ijgAedkkWlSvLMTxobVX7UmyAwplk81aDebh6jUyJVeAP9PUuAQKYzOh6vY
YhNjj/qLS3okLw3YJJhXzIDIePmQBQ==
=WMK4
-----END PGP SIGNATURE-----