freebsd-dev/lib/libc
Kyle Evans adeebf4cd4 regex(3): Interpret many escaped ordinary characters as EESCAPE
In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for
any character to be escaped, but "ORD_CHAR preceded by an unescaped
<backslash> character [gives undefined results]".

Historically, we've interpreted an escaped ordinary character as the
ordinary character itself. This becomes problematic when some extensions
give special meanings to an otherwise ordinary character
(e.g. GNU's \b, \s, \w), meaning we may have two different valid
interpretations of the same sequence.

To make this easier to deal with and given that the standard calls this
undefined, we should throw an error (EESCAPE) if we run into this scenario
to ease transition into a state where some escaped ordinaries are blessed
with a special meaning -- it will either error out or have extended
behavior, rather than have two entirely different versions of undefined
behavior that leave the consumer of regex(3) guessing as to what behavior
will be used or leaving them with false impressions.

This change bumps the symbol version of regcomp to FBSD_1.6 and provides the
old escape semantics for legacy applications, just in case one has an older
application that would immediately turn into a pumpkin because of an
extraneous escape that's embedded or otherwise critical to its operation.

This is the final piece needed before enhancing libregex with GNU extensions
and flipping the switch on bsdgrep.

[1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/

PR:		229925 (exp-run, courtesy of antoine)
Differential Revision:	https://reviews.freebsd.org/D10510
2020-07-29 23:21:56 +00:00
..
aarch64
amd64 amd64: sync up libc memcmp with the kernel version (r357309) 2020-01-30 19:57:05 +00:00
arm
capability libcasper(3): Document HISTORY within the manpages 2020-06-16 16:48:52 +00:00
compat-43
db Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
gdtoa Remove sparc64 specific parts of libc. 2020-02-26 18:55:09 +00:00
gen Don't imply that all action values can be OR'd. 2020-07-15 17:05:37 +00:00
gmon
i386
iconv Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
include Add pthread_getname_np() and pthread_setname_np() aliases for 2020-06-10 22:13:24 +00:00
inet
isc
locale Explain how to learn about possible recognized locale names 2020-06-27 20:55:47 +00:00
md
mips
nameser
net Add include missing from my last commit. 2020-06-21 23:47:27 +00:00
nls Fix race condition in catopen(3). 2020-03-19 06:33:06 +00:00
posix1e Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
powerpc
powerpc64 Fix r358688 -- Remember to actually save r3 before processing. 2020-03-11 23:34:44 +00:00
powerpcspe
quad Add casts and L suffixes to libc quad support, to work around various 2020-02-17 20:14:59 +00:00
regex regex(3): Interpret many escaped ordinary characters as EESCAPE 2020-07-29 23:21:56 +00:00
resolv
riscv Fix printf(3) output of long doubles on RISC-V 2020-06-29 19:30:35 +00:00
rpc Fix -Wvoid-pointer-to-enum-cast warnings. 2020-04-15 18:15:58 +00:00
secure Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
softfloat
stdio fgetln(3): Add a Caveats Section 2020-06-18 13:13:04 +00:00
stdlib Fix a typo: argments -> arguments 2020-05-19 11:05:27 +00:00
stdtime
string strtok(3): make it easier to find the RETURN VALUES section 2020-06-22 11:03:36 +00:00
sys [skip ci] document close_range(2) as async-signal-safe 2020-07-21 16:46:40 +00:00
tests Revert r351416 to let lib.libc.gen.getmntinfo_test.getmntinfo_test get more test 2020-07-13 18:19:02 +00:00
uuid
x86
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
yp
libc_nossp.ldscript
libc.ldscript
Makefile Revert that! 2020-07-19 23:56:19 +00:00
Makefile.depend
Makefile.depend.options
Versions.def