Version in base suite: 59c-28 Base version: mksh_59c-28 Target version: mksh_59c-28+deb12u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/m/mksh/mksh_59c-28.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/m/mksh/mksh_59c-28+deb12u1.dsc changelog | 12 ++++++++ mksh.lintian-overrides | 6 ++-- mksh.postinst | 10 ++++-- mksh.prerm | 2 - patches/crash-nest-bashism.diff | 44 +++++++++++++++++++++++++++++ patches/dot-args-fix.diff | 35 +++++++++++++++++++++++ patches/metadata-update.diff | 51 ++++++++++++++++++++++++++++++++++ patches/series | 4 ++ patches/typeset-p-fix.diff | 60 ++++++++++++++++++++++++++++++++++++++++ 9 files changed, 217 insertions(+), 7 deletions(-) diff -Nru mksh-59c/debian/changelog mksh-59c/debian/changelog --- mksh-59c/debian/changelog 2023-04-28 21:34:20.000000000 +0000 +++ mksh-59c/debian/changelog 2024-04-03 12:19:25.000000000 +0000 @@ -1,3 +1,15 @@ +mksh (59c-28+deb12u1) bookworm; urgency=low + + * d/p/typeset-p-fix.diff, d/p/dot-args-fix.diff, + d/p/crash-nest-bashism.diff: cherry-pick upstream bugfixes + * d/p/metadata-update.diff: cherry-pick relevant documentation + changes and adjust user-visible version to indicate the + above fixes were applied + * fix paths missing wildcards in lintian overrides, postinst, prerm + * cherry-pick usrmerge /etc/shells change (Closes: #1063905) + + -- Thorsten Glaser Wed, 03 Apr 2024 14:19:25 +0200 + mksh (59c-28) unstable; urgency=medium * Revert 59c-27 changes as mksh is, surprisingly, still a key diff -Nru mksh-59c/debian/mksh.lintian-overrides mksh-59c/debian/mksh.lintian-overrides --- mksh-59c/debian/mksh.lintian-overrides 2023-04-28 21:00:04.000000000 +0000 +++ mksh-59c/debian/mksh.lintian-overrides 2024-04-03 11:25:50.000000000 +0000 @@ -17,8 +17,8 @@ # correct placement mksh: executable-in-usr-lib [usr/lib/diet/bin/mksh] mksh: executable-in-usr-lib [usr/lib/klibc/bin/mksh] -mksh: executable-in-usr-lib [usr/lib/*-linux-musl/bin/mksh] +mksh: executable-in-usr-lib [usr/lib/*-linux-musl*/bin/mksh] # these are to clean old add-shell(8) damage, not actually dereferenced -mksh: bin-sbin-mismatch usr/bin/mksh -> bin/mksh [postinst] -mksh: bin-sbin-mismatch usr/bin/mksh -> bin/mksh [prerm] +mksh: bin-sbin-mismatch usr/bin/mksh* -> bin/mksh* [postinst] +mksh: bin-sbin-mismatch usr/bin/mksh* -> bin/mksh* [prerm] diff -Nru mksh-59c/debian/mksh.postinst mksh-59c/debian/mksh.postinst --- mksh-59c/debian/mksh.postinst 2023-04-28 21:00:04.000000000 +0000 +++ mksh-59c/debian/mksh.postinst 2024-04-03 11:27:52.000000000 +0000 @@ -151,14 +151,18 @@ test -e /usr/bin/ksh || test -h /usr/bin/ksh || \ ln -s /bin/ksh /usr/bin/ksh + # determine usrmerge status + um=+ + test /usr/bin/mksh -ef /bin/mksh || um=- + # add us to /etc/shells and clean up old add-shell-caused damage # shellcheck disable=SC2046 mogrifyshells + /bin/mksh /bin/mksh-static \ - - /usr/bin/mksh /usr/bin/mksh-static \ - $(for x in \ + $um /usr/bin/mksh /usr/bin/mksh-static \ + - $(for x in \ /usr/lib/klibc/bin \ /usr/lib/diet/bin \ - /usr/lib/*-linux-musl/bin \ + /usr/lib/*-linux-musl*/bin \ ; do echo "$x/mksh" "$x/mksh-static"; done) ;; diff -Nru mksh-59c/debian/mksh.prerm mksh-59c/debian/mksh.prerm --- mksh-59c/debian/mksh.prerm 2023-04-28 21:00:04.000000000 +0000 +++ mksh-59c/debian/mksh.prerm 2024-04-03 11:26:33.000000000 +0000 @@ -140,7 +140,7 @@ $(for x in \ /usr/lib/klibc/bin \ /usr/lib/diet/bin \ - /usr/lib/*-linux-musl/bin \ + /usr/lib/*-linux-musl*/bin \ ; do echo "$x/mksh" "$x/mksh-static"; done) ;; diff -Nru mksh-59c/debian/patches/crash-nest-bashism.diff mksh-59c/debian/patches/crash-nest-bashism.diff --- mksh-59c/debian/patches/crash-nest-bashism.diff 1970-01-01 00:00:00.000000000 +0000 +++ mksh-59c/debian/patches/crash-nest-bashism.diff 2024-04-03 12:19:25.000000000 +0000 @@ -0,0 +1,44 @@ +Description: fix crash in $(…&>…) construction +Origin: commit:10064DCD4C310F8C650 + +--- a/check.t ++++ b/check.t +@@ -11361,11 +11361,11 @@ stdin: + echo tri >&3 + } + threeout &>foo +- echo === ++ echo === "$("$__progname" -c "echo $(: &>/dev/null) ok")" + cat foo + expected-stdout: + tri +- === ++ === ok + ras + dwa + --- +--- a/syn.c ++++ b/syn.c +@@ -223,17 +223,13 @@ synio(int cf) + iop->ioname = yylval.cp; + + if (iop->ioflag & IOBASH) { +- char *cp; +- + iop->ioflag &= ~IOBASH; + +- cp = alloc(sizeof(struct ioword) + 3U, ATEMP); +- yylval.iop = (void *)cp; +- cp += sizeof(struct ioword); +- yylval.iop->ioname = cp; +- *cp++ = CHAR; +- *cp++ = digits_lc[iop->unit]; +- *cp = EOS; ++ yylval.iop = alloc(sizeof(struct ioword), ATEMP); ++ yylval.iop->ioname = alloc(3U, ATEMP); ++ yylval.iop->ioname[0] = CHAR; ++ yylval.iop->ioname[1] = digits_lc[iop->unit]; ++ yylval.iop->ioname[2] = EOS; + yylval.iop->delim = NULL; + yylval.iop->heredoc = NULL; + yylval.iop->ioflag = IODUP | IOSYNIONEXT; diff -Nru mksh-59c/debian/patches/dot-args-fix.diff mksh-59c/debian/patches/dot-args-fix.diff --- mksh-59c/debian/patches/dot-args-fix.diff 1970-01-01 00:00:00.000000000 +0000 +++ mksh-59c/debian/patches/dot-args-fix.diff 2024-04-03 12:19:25.000000000 +0000 @@ -0,0 +1,35 @@ +Description: fix arguments to the dot command +Origin: commit:10065062FD520C74183 + +--- a/check.t ++++ b/check.t +@@ -10649,6 +10649,18 @@ stdin: + expected-stdout: + 1 0 . + --- ++name: dot-args ++description: ++ Ensure dot can take arguments ++file-setup: file 644 "t" ++ print -r -- "$#,${1-},${2-},${3-}" ++stdin: ++ "$__progname" -c '. ./t a b' ++ "$__progname" -c 'source t c d' ++expected-stdout: ++ 2,a,b, ++ 2,c,d, ++--- + name: alias-function-no-conflict + description: + make aliases not conflict with function definitions +--- a/main.c ++++ b/main.c +@@ -848,7 +848,7 @@ include(const char *name, const char **a + if (argv) { + e->loc->argv = argv; + e->loc->argc = 0; +- while (argv[e->loc->argc]) ++ while (argv[e->loc->argc + 1]) + ++e->loc->argc; + } + s = pushs(SFILE, ATEMP); diff -Nru mksh-59c/debian/patches/metadata-update.diff mksh-59c/debian/patches/metadata-update.diff --- mksh-59c/debian/patches/metadata-update.diff 1970-01-01 00:00:00.000000000 +0000 +++ mksh-59c/debian/patches/metadata-update.diff 2024-04-03 12:19:25.000000000 +0000 @@ -0,0 +1,51 @@ +Description: update FAQ and version + - cherry-pick a relevant FAQ change for future directions + - cherry-pick a FAQ statement regarding POSIX compliance + - assign a synthetic version number: upstream did not use + the 2023/04/xx range at all, so just bump the synthetic + date we already had by one +Author: mirabilos +Forwarded: not-needed + +--- a/check.t ++++ b/check.t +@@ -31,7 +31,7 @@ + # (2013/12/02 20:39:44) http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date + + expected-stdout: +- KSH R59 2023/04/28 ++ KSH R59 2023/04/29 + description: + Check base version of full shell + stdin: +--- a/mksh.faq ++++ b/mksh.faq +@@ -567,7 +567,7 @@ Title: How POSIX compliant is mksh? Also + the PUA; however, there is ambiguity if encountering those UTF-8-encoded, so + it changed for R60.) The Arithmetic expressions and CAVEATS + sections in mksh(1) contain more details about encoding and mapping.

+-

As of R60, utf8-mode maps “raw octets” to U-10000080‥U-100000FF, ++

As of R60, utf8-mode maps “raw octets” to U-001BBB80‥U-001BBBFF, + which is outside the UCS and therefore collision-free. There’s work underway + to make the shell support the full 21-bit UCS range for R60.

+

The following POSIX sh-compatible code toggles the +@@ -590,6 +590,8 @@ Title: How POSIX compliant is mksh? Also +

The shell is pretty close to POSIX, when run as lksh -o posix + under the "C" locale it is intended to match. It does not do everything + like other POSIX-compatible or ‑compliant shells, though.

++

Like pretty much all other POSIX-compatible shells, builtins are ++ independent of paths and always recognised in mksh.

+ ---- + ToC: function-local-scopes + Title: What differences in function-local scopes are there? +--- a/sh.h ++++ b/sh.h +@@ -235,7 +235,7 @@ + #define __SCCSID(x) __IDSTRING(sccsid,x) + #endif + +-#define MKSH_VERSION "R59 2023/04/28" ++#define MKSH_VERSION "R59 2023/04/29" + + /* shell types */ + typedef unsigned char kby; /* byte */ diff -Nru mksh-59c/debian/patches/series mksh-59c/debian/patches/series --- mksh-59c/debian/patches/series 2023-04-28 21:34:20.000000000 +0000 +++ mksh-59c/debian/patches/series 2024-04-03 12:05:03.000000000 +0000 @@ -1 +1,5 @@ debian-changes +typeset-p-fix.diff +dot-args-fix.diff +crash-nest-bashism.diff +metadata-update.diff diff -Nru mksh-59c/debian/patches/typeset-p-fix.diff mksh-59c/debian/patches/typeset-p-fix.diff --- mksh-59c/debian/patches/typeset-p-fix.diff 1970-01-01 00:00:00.000000000 +0000 +++ mksh-59c/debian/patches/typeset-p-fix.diff 2024-04-03 12:19:25.000000000 +0000 @@ -0,0 +1,60 @@ +Description: fix typeset -p confusion between empty and unset +Origin: commit:10065BC69BE555D6721 + +--- a/check.t ++++ b/check.t +@@ -8993,6 +8993,41 @@ expected-stdout: + <12345678910 345678920 + < . aẞ> 2) + --- ++name: typeset-unset ++description: ++ Check that typeset -p correctly distinguishes unset and empty ++stdin: ++ unset u ++ typeset -p u ++ echo 1 ${u-a} ${u:-b} . ++ x1=$(typeset -p u) ++ export u ++ typeset -p u ++ echo 2 ${u-a} ${u:-b} . ++ x2=$(typeset -p u) ++ u= ++ typeset -p u ++ echo 3 ${u-a} ${u:-b} . ++ x3=$(typeset -p u) ++ unset u ++ eval "$x1" ++ echo 4 ${u-a} ${u:-b} . ++ unset u ++ eval "$x2" ++ echo 5 ${u-a} ${u:-b} . ++ unset u ++ eval "$x3" ++ echo 6 ${u-a} ${u:-b} . ++expected-stdout: ++ 1 a b . ++ typeset -x u ++ 2 a b . ++ typeset -x u='' ++ 3 b . ++ 4 a b . ++ 5 a b . ++ 6 b . ++--- + name: utf8bom-1 + description: + Check that the UTF-8 Byte Order Mark is not ignored any more +--- a/var.c ++++ b/var.c +@@ -2313,8 +2313,8 @@ c_typeset_vardump(struct tbl *vp, kui fl + shf_puts(vp->name, shl_stdout); + if (any_set) + shprintf(Tf_SQlu, arrayindex(vp)); +- if ((!thing && !flag && pflag) || +- (thing == '-' && (vp->flag & ISSET))) { ++ if (((!thing && !flag && pflag) || thing == '-') && ++ (vp->flag & ISSET)) { + shf_putc('=', shl_stdout); + if (baseone) + shprintf(vp->val.u > 0xFF ? "16#%04X" :