Package: bash
Version: 4.4-5
Severity: normal

Dear Maintainer,

If the read builtin
- is called with both -e and -u FD, and
- FD is a terminal
then it doesn't read from the specified file descriptor FD as documented, but 
it reads from the standard input instead.

For example:

## unexpected ('pipe' comes from echo)
$ exec 9</dev/tty
$ echo pipe | (read -eu9 x; echo "x is '$x'")
pipe
x is 'pipe'

## as expected
$ exec 9</etc/debian_version
$ echo pipe | (read -eu9 x; echo "x is '$x'")
x is '9.8'

## as expected ('hello' comes from me)
$ exec 9</dev/tty
$ echo pipe | (read -u9 x; echo "x is '$x'")
hello
x is 'hello'

-- System Information:
Debian Release: 9.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

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

Versions of packages bash depends on:
ii  base-files   9.9+deb9u8
ii  dash         0.5.8-2.4
ii  debianutils  4.8.1.1
ii  libc6        2.24-11+deb9u4
ii  libtinfo5    6.0+20161126-1+deb9u2

Versions of packages bash recommends:
pn  bash-completion  <none>

Versions of packages bash suggests:
pn  bash-doc  <none>

-- no debconf information

Reply via email to