Package: debianutils
Version: 4.6
Severity: important
Tags: patch

Dear Maintainer,

With debian-utils 4.6 the add-shell utility now uses a grep '^' construct to 
copy /etc/shells to a temporary file.
This construct fails if grep does not find at least one match, which can happen 
if /etc/shells is empty. 
In this case add-shell errors out with a (in context) bogus error message.

This behaviour is a change from previous versions which used 'awk' for the same 
purpose.

Judging by the rest of the code, an empty /etc/shells (and hence empty 
tmeporary file) should not otherwise prevent add-shell from working correctly.

Since the package already relies on 'cat' for the subsequent error message, why 
not simply use 'cat' for the copying stage as well? (Or, indeed, why not use 
cp?)

----

This particular bug can be triggered by bootstrapping tools (e.g.: brickstrap) 
or by manually creating an empty /etc/shells to provoke it.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages debianutils depends on:
ii  libc6           2.21-7
ii  sensible-utils  0.0.9

debianutils recommends no packages.

debianutils suggests no packages.

-- no debconf information

Reply via email to