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

Bug#811092: texlive-binaries: bashism in mktexlsr ("…`…\"…\"…`…")



Package: texlive-binaries
Version: 2015.20150524.37493-7+b1
Severity: serious
Justification: Policy 10.4

(Note to others: this was pre-approved, don’t downgrade severity)

Hi Norbert, as discussed ahead of time per eMail, here’s the bugreport.

/usr/bin/mktexlsr lines 180 and 181 contain the following code:

       && test "x`sed '1s/M̲$//;1q' \"$db_file\"`" != "x$ls_R_magic" \
       && test "x`sed '1s/M̲$//;1q' \"$db_file\"`" != "x$old_ls_R_magic"; then

(where M̲ is ^M, i.e. ASCII CR)

It is unportable to use double quotes both inside and outside
of (deprecated) accent gravis-style command substitution, as
almost all common shells interpret it different from POSIX,
and historic system shells have been known to use either:

	echo "`echo \"foo\"`"

… can output either:
	foo
… or:
	"foo"

The correct fix here, if you cannot afford to lose either side
of double quotes (as in this case) is to use POSIX shell command
substitutions:

       && test "x$(sed '1s/M̲$//;1q' "$db_file")" != "x$ls_R_magic" \
       && test "x$(sed '1s/M̲$//;1q' "$db_file")" != "x$old_ls_R_magic"; then

Any pre-POSIX shell not supporting $(…) style command substitution
is likely to run into this bug in the first place, so this does not
negatively impact portability either.

(Fun fact: Policy 10.4 implies POSIX, but both bash and dash do
not behave like POSIX, only yash and mksh’s POSIX mode from R52
onwards do, so not using `…` style command substitution really
is the only way out – and the better way anyway.)

I’ve asked the Austin Group to change the POSIX standard to align
with what most shells do, but that does not make this construct
more portable of course, so you should do the change anyway.

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386, amd64

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)

Versions of packages texlive-binaries depends on:
ii  dpkg              1.18.4
ii  install-info      6.0.0.dfsg.1-4
ii  libc6             2.21-6
ii  libfontconfig1    2.11.0-6.3
ii  libfreetype6      2.6.1-0.1
ii  libgcc1           1:5.3.1-6
ii  libgmp10          2:6.1.0+dfsg-2
ii  libgraphite2-3    1.3.4-2
ii  libgs9            9.16~dfsg-2
ii  libharfbuzz-icu0  1.0.1-1+b2
ii  libharfbuzz0b     1.0.1-1+b2
ii  libice6           2:1.0.9-1+b1
ii  libicu55          55.1-7
ii  libkpathsea6      2015.20150524.37493-7+b1
ii  libmpfr4          3.1.3-2
ii  libpaper1         1.1.24+nmu4
ii  libpixman-1-0     0.33.6-1
ii  libpoppler57      0.38.0-2
ii  libpotrace0       1.13-2
ii  libptexenc1       2015.20150524.37493-7+b1
ii  libsm6            2:1.2.2-1+b1
ii  libstdc++6        5.3.1-6
ii  libsynctex1       2015.20150524.37493-7+b1
ii  libtexlua52       2015.20150524.37493-7+b1
ii  libx11-6          2:1.6.3-1
ii  libxaw7           2:1.0.13-1
ii  libxext6          2:1.3.3-1
ii  libxi6            2:1.7.5-1
ii  libxmu6           2:1.1.2-2
ii  libxpm4           1:3.5.11-1+b1
ii  libxt6            1:1.1.5-1
ii  libzzip-0-13      0.13.62-3
ii  perl              5.22.1-4
ii  t1utils           1.39-2
ii  tex-common        6.04
ii  zlib1g            1:1.2.8.dfsg-2+b1

Versions of packages texlive-binaries recommends:
ii  python        2.7.11-1
pn  ruby          <none>
ii  texlive-base  2015.20151225-1
ii  tk [wish]     8.6.0+9

texlive-binaries suggests no packages.

-- no debconf information


Reply to: