From 52e9b5efde5cdc7368331537a7b98b17f5633cc6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen <pmatilai@redhat.com> Date: Fri, 11 Nov 2016 13:42:47 +0200 Subject: [PATCH 4/6] Ensure that file trigger conditions are paths. --- build/parseScript.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/parseScript.c b/build/parseScript.c index 0063422..20fcdcc 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -402,6 +402,12 @@ int parseScript(rpmSpec spec, int parsePart) /* get the index right. */ if (tag == RPMTAG_TRIGGERSCRIPTS || tag == RPMTAG_FILETRIGGERSCRIPTS || tag == RPMTAG_TRANSFILETRIGGERSCRIPTS) { + if (tag != RPMTAG_TRIGGERSCRIPTS && *reqargs != '/') { + rpmlog(RPMLOG_ERR, + _("line %d: file trigger condition must begin with '/': %s"), + spec->lineNum, reqargs); + goto exit; + } if (progArgc > 1) { rpmlog(RPMLOG_ERR, _("line %d: interpreter arguments not allowed in triggers: %s\n"), -- 2.10.2