Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1062944
| From | Thorsten Glaser <tg@mirbsd.de> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed |
| Date | 2021-06-24 16:00 +0200 |
| Message-ID | <Cty3E-3IB-7@gated-at.bofh.it> (permalink) |
| References | <Ctujn-1ph-1@gated-at.bofh.it> <Ctu9I-1m3-5@gated-at.bofh.it> <Ctujn-1ph-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
retitle 990265 mksh: output error is not checked for some builtins when stdout is closed
# notabug
close 990265
thanks
Vincent Lefevre dixit:
>Like with ksh93, output error is not checked for some builtins
>(at least pwd and ulimit), e.g. after closing stdout.
>
>$ exec >&-
>$ for i in echo pwd print ulimit; do echo "[$i]" >&2; $i; echo $? >&2; done
You have just left POSIX land:
At program start-up, three streams are predefined and need not be
opened explicitly: standard input (for reading conventional input),
standard output (for writing conventional output), and standard error
(for writing diagnostic output). When opened, the standard error
stream is not fully buffered; the standard input and standard output
streams are fully buffered if and only if the stream can be
determined not to refer to an interactive device.
At the start of those commands, stdout is closed, so you violate that
constraint. Note POSIX is not just demands on the implementation but
also on the user, for example, it specifically permits extensions where
the behaviour is otherwise unspecified, i.e. which could not happen in
a conforming user.
Compare the second paragraph of https://mywiki.wooledge.org/FileDescriptor
and we’ve had a number of issues over the years, first reported by Jerker
Bäck, with closed stdout and stderr in various utilities finding that this
is not support{ed,able} at all.
>Note also that for pwd, POSIX[*] says:
>
> If an error is detected, output shall not be written to standard
Pretty sure closed stdout is not an what they had in mind for that
utility.
>Note: Debian bug for ksh93:
Cc’ing; I can’t decide for aweeraman, but this is not a bug in mksh.
bye,
//mirabilos
--
Gestern Nacht ist mein IRC-Netzwerk explodiert. Ich hatte nicht damit
gerechnet, darum bin ich blutverschmiert… wer konnte ahnen, daß SIE so
reagier’n… gestern Nacht ist mein IRC-Netzwerk explodiert~~~
(as of 2021-06-15 The MirOS Project temporarily reconvenes on OFTC)
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bug#990265: mksh: output error is not checked for some builtins Vincent Lefevre <vincent@vinc17.net> - 2021-06-24 12:00 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Thorsten Glaser <tg@mirbsd.de> - 2021-06-24 16:00 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Vincent Lefevre <vincent@vinc17.net> - 2021-06-24 16:30 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Vincent Lefevre <vincent@vinc17.net> - 2021-06-24 16:40 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Thorsten Glaser <tg@mirbsd.de> - 2021-06-24 17:20 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Anuradha Weeraman <anuradha@debian.org> - 2021-06-27 18:20 +0200
Bug#990264: Bug#990265: Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Thorsten Glaser <tg@mirbsd.de> - 2021-06-27 19:40 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Vincent Lefevre <vincent@vinc17.net> - 2021-06-27 23:30 +0200
Bug#990264: Bug#990265: mksh: output error is not checked for some builtins when stdout is closed Thorsten Glaser <tg@mirbsd.de> - 2021-06-27 23:50 +0200
Bug#990265: utilities and write errors mirabilos <tg+ml@mirbsd.org> - 2021-06-30 03:00 +0200
Bug#990265: utilities and write errors Vincent Lefevre <vincent-opgr@vinc17.net> - 2021-06-30 03:30 +0200
Bug#990265: utilities and write errors Thorsten Glaser <tg@mirbsd.de> - 2021-06-30 04:10 +0200
csiph-web