[FS#1151] Poor choice of sed delimiter in $(SED_SCRIPT)
LEDE Bugs
lede-bugs at lists.infradead.org
Thu Nov 9 00:41:39 PST 2017
The following task has a new comment added:
FS#1151 - Poor choice of sed delimiter in $(SED_SCRIPT)
User who did this - Mathias Kresin (mkresin)
----------
> Poor choice of sed delimiter in $(SED_SCRIPT)
Sure, can be seen this way. I would rather call it a matter of quoting delimiters in variable values.
Would you please send a tested patch which does the following:
--- a/include/version.mk
+++ b/include/version.mk
@@ -106,7 +106,7 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
-e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
-e 's,%A,$(ARCH_PACKAGES),g' \
-e 's,%t,$(VERSION_TAINTS),g' \
- -e 's,%M,$(VERSION_MANUFACTURER),g' \
+ -e 's,%M,$(subst $(comma),\$(comma),$(VERSION_MANUFACTURER)),g' \
-e 's,%m,$(VERSION_MANUFACTURER_URL),g' \
-e 's,%u,$(VERSION_HOME_URL),g' \
-e 's,%b,$(VERSION_BUG_URL),g' \
IMHO we should sanitize most of the variables values. For example, an comma is valid in URLs as well.
----------
More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=1151#comment3809
More information about the lede-bugs
mailing list