summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/drbd
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/drbd')
-rw-r--r--meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch48
-rw-r--r--meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch96
-rw-r--r--meta-networking/recipes-support/drbd/drbd-utils_9.22.0.bb (renamed from meta-networking/recipes-support/drbd/drbd-utils_9.20.2.bb)9
-rw-r--r--meta-networking/recipes-support/drbd/drbd_9.2.1.bb (renamed from meta-networking/recipes-support/drbd/drbd_9.0.24-1.bb)4
4 files changed, 151 insertions, 6 deletions
diff --git a/meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch b/meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch
new file mode 100644
index 000000000..2841d0fea
--- /dev/null
+++ b/meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch
@@ -0,0 +1,48 @@
1From 5adae6737e919d957a08df437951ccb6996f9882 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 21 Dec 2022 19:16:03 -0800
4Subject: [PATCH 1/2] replace off64_t with off_t
5
6off_t is already 64-bits when _FILE_OFFSET_BITS=64
7using off_t also makes it portable on musl systems
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 user/v9/drbdadm_main.c | 10 +++++-----
13 1 file changed, 5 insertions(+), 5 deletions(-)
14
15diff --git a/user/v9/drbdadm_main.c b/user/v9/drbdadm_main.c
16index 91e9507d..2030946c 100644
17--- a/user/v9/drbdadm_main.c
18+++ b/user/v9/drbdadm_main.c
19@@ -1264,11 +1264,11 @@ static int adm_resource(const struct cfg_ctx *ctx)
20 return ex;
21 }
22
23-static off64_t read_drbd_dev_size(int minor)
24+static off_t read_drbd_dev_size(int minor)
25 {
26 char *path;
27 FILE *file;
28- off64_t val;
29+ off_t val;
30 int r;
31
32 m_asprintf(&path, "/sys/block/drbd%d/size", minor);
33@@ -1289,9 +1289,9 @@ int adm_resize(const struct cfg_ctx *ctx)
34 char *argv[MAX_ARGS];
35 struct d_option *opt;
36 bool is_resize = !strcmp(ctx->cmd->name, "resize");
37- off64_t old_size = -1;
38- off64_t target_size = 0;
39- off64_t new_size;
40+ off_t old_size = -1;
41+ off_t target_size = 0;
42+ off_t new_size;
43 int argc = 0;
44 int silent;
45 int ex;
46--
472.39.0
48
diff --git a/meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch b/meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch
new file mode 100644
index 000000000..45f7d6d41
--- /dev/null
+++ b/meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch
@@ -0,0 +1,96 @@
1From b70e5bf5bfa5fa2c2fffe08bcf300da1d3583602 Mon Sep 17 00:00:00 2001
2From: Lars Ellenberg <lars.ellenberg@linbit.com>
3Date: Wed, 9 Nov 2022 11:01:54 +0100
4Subject: [PATCH 2/2] drbdadm: drop use of GLOB_MAGCHAR, use strchr heuristic only
5
6Fixup for
72022-09-05 4a1b5900 drbdadm: allow files from an expanded include glob to vanish
8
9When using the `include` statement, if the glob did not match any file,
10there is nothing to do, silently ignore. Unless it was no glob, but a literal,
11which we would expect to exist.
12
13Also, there is a race between expanding a glob and accessing the file.
14That also should not happen for literals, though.
15
16Since we still had the heuristic anyways, because apparently |GLOB_MAGCHAR
17does not happen for GLOB_NOMATCH returns, and there exist non-GNU libc that
18don't (and likely won't) implement that extension, just forget about
19(gl_flags & GLOB_MAGCHAR) but use the incomplete strchr heuristic only.
20
21Sourced From Alpine: https://git.alpinelinux.org/aports/tree/main/drbd-utils/drop_use_of_GLOB_MAGCHAR.patch
22
23Upstream-Status: Pending
24Signed-off-by: Khem Raj <raj.khem@gmail.com>
25---
26 user/v9/drbdadm_parser.c | 35 ++++++++++++++++++++---------------
27 1 file changed, 20 insertions(+), 15 deletions(-)
28
29diff --git a/user/v9/drbdadm_parser.c b/user/v9/drbdadm_parser.c
30index b2f6ed8a..9a0a775d 100644
31--- a/user/v9/drbdadm_parser.c
32+++ b/user/v9/drbdadm_parser.c
33@@ -1947,14 +1947,29 @@ void include_stmt(char *str)
34 size_t i;
35 int r;
36
37- cwd = pushd_to_current_config_file_unless_stdin();
38-
39- /* """
40+ /*
41+ * If the glob did not match any file,
42+ * there is nothing to do, silently ignore.
43+ * Unless it was no glob, but a literal,
44+ * which we would expect to exist.
45+ *
46+ * """
47 * As a GNU extension, pglob->gl_flags is set to the
48 * flags specified, ored with GLOB_MAGCHAR if any
49 * metacharacters were found.
50 * """
51+ *
52+ * But apparently |GLOB_MAGCHAR does not happen for GLOB_NOMATCH returns,
53+ * at least not consistently :-(
54+ * Also, there exist non-GNU libc
55+ * So we have this incomplete strchr heuristic anyways.
56 */
57+ bool contains_glob_magic_char =
58+ strchr(str, '*') ||
59+ strchr(str, '?') ||
60+ strchr(str, '[');
61+
62+ cwd = pushd_to_current_config_file_unless_stdin();
63 r = glob(str, 0, NULL, &glob_buf);
64 if (r == 0) {
65 for (i=0; i<glob_buf.gl_pathc; i++) {
66@@ -1965,7 +1980,7 @@ void include_stmt(char *str)
67 if (f) {
68 include_file(f, strdup(glob_buf.gl_pathv[i]));
69 fclose(f);
70- } else if (errno == ENOENT && glob_buf.gl_flags & GLOB_MAGCHAR) {
71+ } else if (errno == ENOENT && contains_glob_magic_char) {
72 /* Noisily ignore race between glob expansion
73 * and actual open. */
74 err("%s:%d: include file vanished after glob expansion '%s'.\n",
75@@ -1979,17 +1994,7 @@ void include_stmt(char *str)
76 }
77 globfree(&glob_buf);
78 } else if (r == GLOB_NOMATCH) {
79- /*
80- * If the glob did not match any file,
81- * there is nothing to do, silently ignore.
82- * Unless it was no glob, but a literal,
83- * which we would expect to exist.
84- * Apparently |GLOB_MAGCHAR does not happen for GLOB_NOMATCH returns,
85- * at least not consistently :-(
86- * So we have this strchr heuristic anyways.
87- */
88- /* if (!(glob_buf.gl_flags & GLOB_MAGCHAR)) { */
89- if (!strchr(str, '?') && !strchr(str, '*') && !strchr(str, '[')) {
90+ if (!contains_glob_magic_char) {
91 err("%s:%d: Failed to open include file '%s'.\n",
92 config_save, line, str);
93 config_valid = 0;
94--
952.39.0
96
diff --git a/meta-networking/recipes-support/drbd/drbd-utils_9.20.2.bb b/meta-networking/recipes-support/drbd/drbd-utils_9.22.0.bb
index deaab641e..89bf52916 100644
--- a/meta-networking/recipes-support/drbd/drbd-utils_9.20.2.bb
+++ b/meta-networking/recipes-support/drbd/drbd-utils_9.22.0.bb
@@ -8,14 +8,15 @@ SECTION = "admin"
8LICENSE = "GPL-2.0-or-later" 8LICENSE = "GPL-2.0-or-later"
9LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018" 9LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
10 10
11SRC_URI = "git://github.com/LINBIT/drbd-utils;name=drbd-utils;branch=${PV};protocol=https \ 11SRC_URI = "git://github.com/LINBIT/drbd-utils;name=drbd-utils;branch=master;protocol=https \
12 git://github.com/LINBIT/drbd-headers;name=drbd-headers;destsuffix=git/drbd-headers;branch=master;protocol=https \ 12 git://github.com/LINBIT/drbd-headers;name=drbd-headers;destsuffix=git/drbd-headers;branch=master;protocol=https \
13 file://0001-drbdmon-add-LDFLAGS-when-linking.patch \ 13 file://0001-drbdmon-add-LDFLAGS-when-linking.patch \
14 file://0001-replace-off64_t-with-off_t.patch \
14 ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','file://0001-drbd-utils-support-usrmerge.patch','',d)} \ 15 ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','file://0001-drbd-utils-support-usrmerge.patch','',d)} \
15 " 16 "
16 17SRC_URI:append:libc-musl = " file://0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch "
17SRCREV_drbd-utils = "087ee6b4961ca154d76e4211223b03149373bed8" 18SRCREV_drbd-utils = "409097fe02187f83790b88ac3e0d94f3c167adab"
18SRCREV_drbd-headers = "f1529aa84e9d2f66c96ad283a1bbb708aabf03f7" 19SRCREV_drbd-headers = "9a0f151fa0085f57910a2dcbbd658d6069554f62"
19 20
20SRCREV_FORMAT = "drbd-utils_drbd-headers" 21SRCREV_FORMAT = "drbd-utils_drbd-headers"
21 22
diff --git a/meta-networking/recipes-support/drbd/drbd_9.0.24-1.bb b/meta-networking/recipes-support/drbd/drbd_9.2.1.bb
index 0766f7f4b..48ce2abf0 100644
--- a/meta-networking/recipes-support/drbd/drbd_9.0.24-1.bb
+++ b/meta-networking/recipes-support/drbd/drbd_9.2.1.bb
@@ -8,10 +8,10 @@ LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018" 8LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
9DEPENDS = "virtual/kernel" 9DEPENDS = "virtual/kernel"
10 10
11SRC_URI = "http://www.linbit.com/downloads/drbd/9.0/drbd-${PV}.tar.gz \ 11SRC_URI = "https://pkg.linbit.com//downloads/drbd/9/${BP}.tar.gz \
12 file://check_existence_of_modules_before_installing.patch \ 12 file://check_existence_of_modules_before_installing.patch \
13 " 13 "
14SRC_URI[sha256sum] = "14970459f55bc465503b88b24d1a266b2ace0d69fe3cb387005b8477cd6475ed" 14SRC_URI[sha256sum] = "f59ee795188f21d4a62c5319c371ebad65ab3fb9b55e5212c3f1dd558978a843"
15 15
16inherit module 16inherit module
17 17