CVSROOT: /cvs Module name: src Changes by: clau...@cvs.openbsd.org 2022/03/15 05:13:48
Modified files: usr.sbin/bgpd : parse.y Log message: Change how $macros are expanded in the config. Expand $macros not only at the start of a yacc token but also inside STRING elements. STRING elements are used e.g. for community specifications and it makes sense to allow $FOO:$BAR to correctly expand. There is no expansion of macros in quoted strings (both single and double quotes). Factor out the macro expand logic and with this introduce its own lookup buffer for the macro name. For expansion to work inside STRING the char after the makro name must be a character not allowed in macro names (not alpha-numerical or '_'). Add extra checks to set variables. Mainly restrict length of the name and also make sure it does not include not allowed characters. OK tb@