Skip to content

Commit

Permalink
Explicitly protect automatic macros from being redefined and undefined
Browse files Browse the repository at this point in the history
All current automatic macros are named in a way that do not pass the
name check in validName(), but that's kinda implicit. Specifically
test for ME_AUTO along with ME_BUILTIN.

No functional change due to the implicit protection from the naming.

(cherry picked from commit b88f43b)
  • Loading branch information
pmatilai authored and dmnks committed Jun 7, 2022
1 parent da4e779 commit 703e9af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpmio/macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ validName(MacroBuf mb, const char *name, size_t namelen, const char *action)
}

mep = findEntry(mb->mc, name, namelen, NULL);
if (mep && (*mep)->flags & ME_BUILTIN) {
if (mep && (*mep)->flags & (ME_BUILTIN|ME_AUTO)) {
mbErr(mb, 1, _("Macro %%%s is a built-in (%s)\n"), name, action);
goto exit;
}
Expand Down

0 comments on commit 703e9af

Please sign in to comment.