summaryrefslogtreecommitdiff
path: root/net-dns/inadyn
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-08-07 12:37:21 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-08-07 12:37:21 +0100
commitb8c7370a682e4e29cda623222d17a790c01c3642 (patch)
treef6caa14689bd00a5760eadaa381ff41e50ef3c1b /net-dns/inadyn
parent8a4997a7e2d1e36c089d4d76935b5a902d98d3d0 (diff)
gentoo auto-resync : 07:08:2024 - 12:37:20
Diffstat (limited to 'net-dns/inadyn')
-rw-r--r--net-dns/inadyn/Manifest3
-rw-r--r--net-dns/inadyn/files/inadyn-2.12.0-musl.patch217
-rw-r--r--net-dns/inadyn/inadyn-2.12.0-r1.ebuild2
3 files changed, 221 insertions, 1 deletions
diff --git a/net-dns/inadyn/Manifest b/net-dns/inadyn/Manifest
index 52bb30fb6c1f..f172fe19eaf9 100644
--- a/net-dns/inadyn/Manifest
+++ b/net-dns/inadyn/Manifest
@@ -1,6 +1,7 @@
+AUX inadyn-2.12.0-musl.patch 6309 BLAKE2B 4a5059eb508a419bd89a376517aef364304143c081eec431960e780db4be7b94643d13504bf88213dd31fd7d5faca2250fbae0f739e5199045996b80b45ec9f6 SHA512 29ca951fca1115b7cb1c39093879821821aab57482af48114a01620324b973140eea9094516794e6f0d935d881413bec9e84af69785afb2fb80a8116bd45146d
AUX inadyn.confd 158 BLAKE2B 246e1620c4e86ae2181cdee7ae4a14d9139a96476c159a2bd1b57bb3c10b8696f39e232da0efdef89a3473d138c72ba523ae866a248ba38213a1cab6127b5128 SHA512 0806329acf13e83f6806e1c36a0cf7bff4c4cfd480e10f602ff0e3dfddfcf99bb912460d1bb6c5ef84036d42fb3ccd5ff11e7ac99e1f8db2d82d84b5acf20d2f
AUX inadyn.initd 618 BLAKE2B 14dbddb55e21194ddad9fbbd8470a84964f06a30a560375ee2b4916ca3522cf366a5e793eef7edbee272ab117e55ebf20a5ab574c24c8d8561937168cb70bdcb SHA512 fe5d77d54f4f56900e7e54d920530b2023401207ffc43955ebdbf8edf9d8b0a323ec10df7620bc3751c6ee7bf1c25047ef6d7226b3b29d276f70d511665ce45e
AUX inadyn.tmpfilesd 75 BLAKE2B f09b58e347524f2bb42dbab273a6ca86e2a46bd15082fd54bbf2523a75e97f204a1539c6acde658e2fc4e377cf3801fd5c1a393e7f91ccca847f86aca139c1f1 SHA512 53f3a24f2bd3ed9a236294223199cb9717a009550222d32f704c0b98b6b91c94943440a47ed3dfcd528591cf7e00b29ded02b6245eeb5887282fbffe169e1414
DIST inadyn-2.12.0.tar.xz 341904 BLAKE2B 2bb1e8f16784c41cb2810c3ed2a52ef12823277082b33a9436a330caad4b4f76034ab3e7f9fefb4dffc0fbf5968f4fb60967f784ce3682f165666c8c0744fcc9 SHA512 309ad6deca4831cbbfb4f4c0b4fcc1ba69fd46a47dc329b20b5e74acdcaf32e7bef435abdc89d2924b576d166095b61bdb7a74cc698a805659c47e7d6a4fe907
-EBUILD inadyn-2.12.0-r1.ebuild 1689 BLAKE2B f97e96f7ef1e68ccb963730798ae1e67ee322b5805f32db2f3d6391b6719cdaf6def1a6be85c7c7f3610d7ec172dd5c4b4e336db222a5063f1b0c4f79e3eeac0 SHA512 96bcdf93fdd1a252a975194fd924340fc0e7955bdf8d946515ce4268a312a66c22852f4c6298d75b43446b4f8fc60ea687549397655ae3ed78a9d809ebf11215
+EBUILD inadyn-2.12.0-r1.ebuild 1740 BLAKE2B 41db45ac22e67e5dfa4da53e8d6835f3ad56413c57a98b838108dec7d79e99f1161356ed39f0f893d576ae3f4fd5e5e8d65098863f13ad1739a5c20fe6920202 SHA512 aa22c606002637557b2ffcbe59a78bc90d64d3926b85f21eddd2c38087adee8dfbaf0211774aa18d91c7b3be94505d3c9d2d5e0e79f8305d980a4e9c79eb97d7
MISC metadata.xml 993 BLAKE2B 362846a13e02a33b0219fa4c21f7e4d39886089b16a0eb2d5891abbf3f6c1945f42750126d54b8271caa381770dedf458f18117ece52f7058c494838d5625540 SHA512 7bb3ba6f732c1bde413bd52a50f22c93ca1e5f59cbdee12e106cc33b4175982c55cb587f48a691d603d46ae268ab9bf37fbb816cab514e895c7386c6d5cc4267
diff --git a/net-dns/inadyn/files/inadyn-2.12.0-musl.patch b/net-dns/inadyn/files/inadyn-2.12.0-musl.patch
new file mode 100644
index 000000000000..3a9ecc8cbcf9
--- /dev/null
+++ b/net-dns/inadyn/files/inadyn-2.12.0-musl.patch
@@ -0,0 +1,217 @@
+From b9edfbfb94b3582cf32dfc04e0dd867ecef2ba92 Mon Sep 17 00:00:00 2001
+From: Joachim Wiberg <troglobit@gmail.com>
+Date: Sat, 3 Aug 2024 13:25:39 +0200
+Subject: [PATCH] Refactor mkpath() to drop all uses of strdupa()
+
+Fixes #488
+
+Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
+---
+ include/Makefile.am | 2 +-
+ include/compat.h | 4 ++--
+ include/strdupa.h | 52 -----------------------------------------
+ src/makepath.c | 56 ++++++++++++++++++++++++++++++---------------
+ src/os.c | 2 +-
+ 5 files changed, 42 insertions(+), 74 deletions(-)
+ delete mode 100644 include/strdupa.h
+
+diff --git a/include/Makefile.am b/include/Makefile.am
+index 4e112c16..31534b8a 100644
+--- a/include/Makefile.am
++++ b/include/Makefile.am
+@@ -5,4 +5,4 @@ noinst_HEADERS = base64.h md5.h sha1.h \
+ jsmn.h json.h log.h \
+ md5.h os.h plugin.h \
+ queue.h sha1.h ssl.h \
+- strdupa.h tcp.h
++ tcp.h
+diff --git a/include/compat.h b/include/compat.h
+index 35f2edf7..3eb1b1e8 100644
+--- a/include/compat.h
++++ b/include/compat.h
+@@ -29,14 +29,14 @@
+ #include <unistd.h>
+ #include <sys/param.h> /* MAX(), isset(), setbit(), TRUE, FALSE, et consortes. :-) */
+ #include <sys/types.h>
+-#include "strdupa.h"
+
+ /* From The Practice of Programming, by Kernighan and Pike */
+ #ifndef NELEMS
+ #define NELEMS(array) (sizeof(array) / sizeof(array[0]))
+ #endif
+
+-int mkpath (char *dir, mode_t mode);
++int mkpath (const char *dir, mode_t mode);
++int makepath (const char *dir);
+
+ #ifndef pidfile
+ int pidfile (const char *basename);
+diff --git a/include/strdupa.h b/include/strdupa.h
+deleted file mode 100644
+index ccd177e8..00000000
+--- a/include/strdupa.h
++++ /dev/null
+@@ -1,52 +0,0 @@
+-/* ==========================================================================
+- * strdupa.h - Re-implementation of glibc strdupa.
+- * --------------------------------------------------------------------------
+- * Copyright (c) 2009 William Ahern
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining a
+- * copy of this software and associated documentation files (the
+- * "Software"), to deal in the Software without restriction, including
+- * without limitation the rights to use, copy, modify, merge, publish,
+- * distribute, sublicense, and/or sell copies of the Software, and to permit
+- * persons to whom the Software is furnished to do so, subject to the
+- * following conditions:
+- *
+- * The above copyright notice and this permission notice shall be included
+- * in all copies or substantial portions of the Software.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+- * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+- * USE OR OTHER DEALINGS IN THE SOFTWARE.
+- * ==========================================================================
+- */
+-#ifndef LITE_STRDUPA_H
+-#define LITE_STRDUPA_H
+-
+-#if !defined(HAVE_STRDUPA)
+-#if defined(strdupa)
+-#define HAVE_STRDUPA 1
+-#endif
+-#endif
+-
+-#if !HAVE_STRDUPA
+-#if defined(__GNUC__)
+-#include <stddef.h> /* size_t */
+-#include <string.h> /* memcpy(3) strlen(3) */
+-
+-#define strdupa(src) (__extension__ ({ \
+- size_t len_ = strlen(src); \
+- char *dst_ = __builtin_alloca(len_ + 1); \
+- dst_[len_] = '\0'; \
+- (char *)memcpy(dst_, src, len_); \
+-}))
+-
+-#else /* If not GCC, e.g. Clang */
+-#error strdupa() may use an unsupported GNU C API, please forward any fix to maintainer, cheers!
+-#endif /* __GNUC__ */
+-#endif /* !HAVE_STRDUPA */
+-
+-#endif /* LITE_STRDUPA_H */
+diff --git a/src/makepath.c b/src/makepath.c
+index 5235c19d..9774c737 100644
+--- a/src/makepath.c
++++ b/src/makepath.c
+@@ -1,6 +1,6 @@
+ /* mkpath() -- Create all components leading up to a given directory
+ *
+- * Copyright (c) 2013-2021 Joachim Wiberg <troglobit@gmail.com>
++ * Copyright (c) 2013-2024 Joachim Wiberg <troglobit@gmail.com>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+@@ -16,11 +16,35 @@
+ */
+
+ #include <errno.h>
+-#include <libgen.h>
+-#include <sys/stat.h>
+-#include <sys/types.h>
++#include <string.h> /* strdup(), strrchr() */
++#include <stdlib.h> /* free() */
++#include <sys/stat.h> /* mkdir() */
++
+ #include "compat.h"
+
++/* Recursively create directories */
++static int _mkpath(char *dir, mode_t mode)
++{
++ char *slash;
++
++ if (!mkdir(dir, mode) || errno == EEXIST)
++ return 0;
++
++ if (errno != ENOENT)
++ return -1;
++
++ slash = strrchr(dir, '/');
++ if (!slash)
++ return -1;
++
++ *slash = 0;
++ if (_mkpath(dir, mode) == -1)
++ return -1;
++
++ *slash = '/';
++ return mkdir(dir, mode);
++}
++
+ /**
+ * mkpath - Like makepath() but takes a mode_t argument
+ * @dir: Directory to created, relative or absolute
+@@ -29,21 +53,24 @@
+ * Returns:
+ * POSIX OK(0) on success, otherwise -1 with @errno set.
+ */
+-int mkpath(char *dir, mode_t mode)
++int mkpath(const char *dir, mode_t mode)
+ {
+- struct stat sb;
++ char *_dir;
++ int rc;
+
+ if (!dir) {
+ errno = EINVAL;
+ return 1;
+ }
+
+- if (!stat(dir, &sb))
+- return 0;
++ _dir = strdup(dir);
++ if (!_dir)
++ return -1;
+
+- mkpath(dirname(strdupa(dir)), mode);
++ rc = _mkpath(_dir, mode);
++ free(_dir);
+
+- return mkdir(dir, mode);
++ return rc;
+ }
+
+ /**
+@@ -56,14 +83,7 @@ int mkpath(char *dir, mode_t mode)
+ * fails allocating temporary memory. For other error codes see the
+ * mkdir() syscall description.
+ */
+-int makepath(char *dir)
++int makepath(const char *dir)
+ {
+ return mkpath(dir, 0777);
+ }
+-
+-/**
+- * Local Variables:
+- * indent-tabs-mode: t
+- * c-file-style: "linux"
+- * End:
+- */
+diff --git a/src/os.c b/src/os.c
+index bc85b1d7..2b169062 100644
+--- a/src/os.c
++++ b/src/os.c
+@@ -266,7 +266,7 @@ int os_check_perms(void)
+ }
+ }
+
+- pidfile_dir = dirname(strdupa(pidfn));
++ pidfile_dir = dirname(pidfn);
+ if (access(pidfile_dir, F_OK)) {
+ if (mkpath(pidfile_dir, 0755) && errno != EEXIST)
+ logit(LOG_ERR, "No write permission to %s, aborting.", pidfile_dir);
diff --git a/net-dns/inadyn/inadyn-2.12.0-r1.ebuild b/net-dns/inadyn/inadyn-2.12.0-r1.ebuild
index d95e11c356fd..36e4bd48984f 100644
--- a/net-dns/inadyn/inadyn-2.12.0-r1.ebuild
+++ b/net-dns/inadyn/inadyn-2.12.0-r1.ebuild
@@ -29,6 +29,8 @@ DEPEND="
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"
+PATCHES=( "${FILESDIR}/${PN}-2.12.0-musl.patch" )
+
src_configure() {
# Tests would need a custom config file in homedir per configure help?
local myeconfargs=(