Module Name: src Committed By: kre Date: Mon Oct 14 08:15:43 UTC 2024
Modified Files: src/bin/sh: input.c var.c Log Message: Apologies for that commit message ... it should have been the same as for revision 1.124 of Makefile (and as below). (This change changes nothing). Reject nul characters in shell input. At the request of Thomas Klausner (wiz@) copy an idea from OpenBSD, and have the shell simply reject any (sh) input containing a \0 (nul) character. Previously nul characters were simply ignored (removed from the input before it was examined in any other way). Note this affects data read by the shell itself only, and has no impact on other utilities, including those that are built into the shell (so 'read' can still use -d '' to process output using \0 as the record separator). While I have tested that this works, there are so many places where a nul might appear, that I cannot possibly test them all (or even imagine all the possible places), so if this change causes any problems, let me know (if from a script, send me the script). To undo this change, simply comment out (or delete) the line CPPFLAGS+= -DREJECT_NULS from the Makefile, and build again. Eventually if this causes no problems, that option (conditional compilation) will probably just go away, and this change would be permanent. While the conditional compilation (on or off) persists, the NETBSD_SHELL variable value will contain the word REJECT_NULLS so you can easily verify if you are running a shell with this included or not. No pullups planned. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/bin/sh/input.c cvs rdiff -u -r1.85 -r1.86 src/bin/sh/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.