Package: base-files
Version: 9.2
Severity: normal
Tags: patch
In testing /usr/bin/mesg is provided by util-linux instead of sysvinit-utils.
Its changed behaviour with respect to exit codes needs to be accounted for in
/usr/share/base-files/dot.profile.
When displaying of messages is set to no and also when being set to no,
util-linux' mesg exits 0 but 1. Since "mesg n" is the last command being run
for root's login-shells, the first exit code the user "sees" is 1 - which is
plain wrong.
Another example is ssh'ing into a stretch machine with e.g. "bash -lex
somecommand" where "somecommand" will never be executed due to the error-exit
triggered by the "failed" invocation of mesg.
A possible workaround is to change "mesg n" to s.th. along the lines of
-------8<------------
(
mesg n
err=$?
[ $err -gt 1 ] && exit $err
:
)
-------8<------------
This way, mesg's exit 1 gets masked by the empty statement ":" which returns
zero.
If the mesg call fails with, say 127 becaus the binary is missing, exit 127
gets triggered which exits the sub-shell - and only the sub-shell, not the
login shell - and the empty statement ":" which would return zero gets skipped
and code 127 gets propagated to the login shell.
Daniel
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'testing-proposed-updates'), (500,
'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.0.0-2-amd64 (SMP w/6 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)
Versions of packages base-files depends on:
ii gawk [awk] 1:4.1.1+dfsg-1
ii mawk [awk] 1.3.3-17
base-files recommends no packages.
base-files suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]