Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/bin/sh
Module Name: src
Committed By: kre
Date: Thu Jul 3 03:54:40 UTC 2025
Modified Files:
src/bin/sh: miscbltin.c
Log Message:
Don't allow read to make use of the shell's internal '='
terminates var names feature (which exists so in things
like "external foo=bar" the shell can simply set the "variable"
"foo=bar" to "bar" and doesn't need to put \0 on top of the '=',
or copy the var name part elsewhere, and other similar internal
advantages) - in most cases either allowing the '=' is intended, (as
in the export example) or other checks make it impossible (${var} etc),
but nothing was checking the var names passed to the read command.
Fix that ... (side effect is that now if an invalid name is
given, it will be detected before anything is read, before a
prompt is written, rather than after the read, when the vars
are being set to the fields from the line read).
Don't bother doing this in SMALL shells, avoid the (small) extra
code bloat - SMALL shells can just treat being able to say
read a b=hello c (which means the same as read a b c)
as a harmless foible...
To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/miscbltin.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index