Bug#990266: posh: output error is not checked for pwd

2021-07-05 Thread Vincent Lefevre
On 2021-06-24 11:54:40 +0200, Vincent Lefevre wrote:
> Like with ksh, output error is not checked for pwd (and maybe some
> other builtins, but echo is OK), e.g. after closing stdout.
> 
> $ exec >&-
> $ for i in echo pwd; do echo "[$i]" >&2; $i; echo $? >&2; done
> [echo]
> 1
> [pwd]
> 0

Since a closed stdout is unspecified behavior in POSIX (though there
is no reason to handle it like another error here), here's a testcase
with a full FS:

$ pwd > /dev/full
$ echo $?
0

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#990266: posh: output error is not checked for pwd

2021-06-24 Thread Vincent Lefevre
Package: posh
Version: 0.14.1
Severity: normal

Like with ksh, output error is not checked for pwd (and maybe some
other builtins, but echo is OK), e.g. after closing stdout.

$ exec >&-
$ for i in echo pwd; do echo "[$i]" >&2; $i; echo $? >&2; done
[echo]
1
[pwd]
0

Note also that for pwd, POSIX[*] says:

  If an error is detected, output shall not be written to standard
  output, a diagnostic message shall be written to standard error,
  and the exit status is not zero.

so that one would expect a diagnostic message (and I think that
one should also get one for the other builtins).

[*] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html

-- System Information:
Debian Release: 11.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-security'), (500, 
'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-7-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages posh depends on:
ii  debconf [debconf-2.0]  1.5.77
ii  libc6  2.31-12

posh recommends no packages.

posh suggests no packages.

-- debconf information:
  posh/sh: false

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)