mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
In Buildroot there are multiple way to apply patches on a package [1]
- Adding `.patch` file in the package directory.
- Define `<pkg>_PATCH` variable with the location of the patch tar.gz.
It used to download Debian patches tarball.
- Implement custom patching logic with `PRE`/`POST` patches hooks.
To make the CycloneDX SBOM generation not dependant on downloading the
packages, the two last options have the downside of not appearing on the
generated SBOM.
The heirloom-mailx package is downloading a tarball from the Debian
mirror with the `<pkg>_PATCH` method [2].
To improve the tracking of the patched vulnerabilities for the
heirloom-mailx package this commit import the patches previously
downloaded with the `_PATCH` variable in the Buildroot tree. This allows
to add the `CVE:` trailer [3] on the patches that fix vulnerabilities to
better track which patch is fixing the vulnerability.
[1] https://buildroot.org/downloads/manual/manual.html#patch-policy
[2] http://snapshot.debian.org/archive/debian/20150815T155609Z/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
[3] 1167d0ff3d docs/manual: mention CVE trailer
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
58 lines
1.4 KiB
Diff
58 lines
1.4 KiB
Diff
From: Luk Claes <luk@debian.org>
|
|
Date: Sat, 4 Jul 2009 10:54:53 +0200
|
|
Subject: Don't reuse weak symbol optopt to fix FTBFS on mips*
|
|
|
|
Upstream: https://sources.debian.org/patches/heirloom-mailx/12.5-4/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch/
|
|
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
|
---
|
|
getopt.c | 10 +++++-----
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/getopt.c b/getopt.c
|
|
index 83ce628..82e983c 100644
|
|
--- a/getopt.c
|
|
+++ b/getopt.c
|
|
@@ -43,7 +43,7 @@ typedef int ssize_t;
|
|
char *optarg;
|
|
int optind = 1;
|
|
int opterr = 1;
|
|
-int optopt;
|
|
+int optoptc;
|
|
|
|
static void
|
|
error(const char *s, int c)
|
|
@@ -69,7 +69,7 @@ error(const char *s, int c)
|
|
*bp++ = *s++;
|
|
while (*msg)
|
|
*bp++ = *msg++;
|
|
- *bp++ = optopt;
|
|
+ *bp++ = optoptc;
|
|
*bp++ = '\n';
|
|
write(2, buf, bp - buf);
|
|
ac_free(buf);
|
|
@@ -101,13 +101,13 @@ getopt(int argc, char *const argv[], const char *optstring)
|
|
}
|
|
curp = &argv[optind][1];
|
|
}
|
|
- optopt = curp[0] & 0377;
|
|
+ optoptc = curp[0] & 0377;
|
|
while (optstring[0]) {
|
|
if (optstring[0] == ':') {
|
|
optstring++;
|
|
continue;
|
|
}
|
|
- if ((optstring[0] & 0377) == optopt) {
|
|
+ if ((optstring[0] & 0377) == optoptc) {
|
|
if (optstring[1] == ':') {
|
|
if (curp[1] != '\0') {
|
|
optarg = (char *)&curp[1];
|
|
@@ -127,7 +127,7 @@ getopt(int argc, char *const argv[], const char *optstring)
|
|
optind++;
|
|
optarg = 0;
|
|
}
|
|
- return optopt;
|
|
+ return optoptc;
|
|
}
|
|
optstring++;
|
|
}
|