1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix bugs related to 'uname -d' in the 'uname' builtin (#251)

This commit fixes a bug in the ksh uname builtin's -d option that could
change the output of -o (I was only able to reproduce this on Linux):
    $ builtin uname
    $ uname -o
    GNU/Linux
    $ uname -d
    (none)
    $ uname -o
    (none)
I identified this patch from ksh2020 as a fix for this bug:
<https://github.com/att/ast/pull/1187>
The linked patch was meant to fix a crash in 'uname -d', although I've
had no luck reproducing it: <https://github.com/att/ast/issues/1184>

src/lib/libcmd/uname.c:
- Pass correct buffer to getdomainname() while executing uname -d.

src/cmd/ksh93/tests/builtins.sh:
- Add a regression test for the reported 'uname -d' crash.
- Add a regression test for the output of 'uname -o' after 'uname -d'.
- To handle potential crashes when running the regression tests in older
  versions of ksh, fork the command substitutions that run 'uname -d'.
This commit is contained in:
Johnothan King 2021-04-04 14:18:43 -07:00 committed by GitHub
parent ca2443b58c
commit 56913f8c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 2 deletions

8
NEWS
View file

@ -3,6 +3,14 @@ For full details, see the git log at: https://github.com/ksh93/ksh
Any uppercase BUG_* names are modernish shell bug IDs.
2021-04-03:
- Fixed a bug that caused the uname builtin's -d option to change the output
of the -o option.
- Fixed a possible crash that could occur when showing the domain name
with the uname builtin's -d option.
2021-03-31:
- Fixed a bug that caused 'cd -' to ignore the current value of $OLDPWD