diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 16:24:49 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 16:24:49 -0500 |
| commit | a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7 (patch) | |
| tree | 0c52bbae1c242fbc296bd650fcd1167685f81492 /sys-apps/netplug | |
| parent | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (diff) | |
| download | baldeagleos-repo-a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7.tar.gz baldeagleos-repo-a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7.tar.xz baldeagleos-repo-a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7.zip | |
Adding metadata
Diffstat (limited to 'sys-apps/netplug')
| -rw-r--r-- | sys-apps/netplug/Manifest | 1 | ||||
| -rw-r--r-- | sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch | 37 | ||||
| -rw-r--r-- | sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch | 187 | ||||
| -rw-r--r-- | sys-apps/netplug/files/netplug-1.2.9.2-downandout.patch | 13 | ||||
| -rw-r--r-- | sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch | 65 | ||||
| -rw-r--r-- | sys-apps/netplug/files/netplug-2 | 43 | ||||
| -rw-r--r-- | sys-apps/netplug/metadata.xml | 5 | ||||
| -rw-r--r-- | sys-apps/netplug/netplug-1.2.9.2-r3.ebuild | 73 |
8 files changed, 0 insertions, 424 deletions
diff --git a/sys-apps/netplug/Manifest b/sys-apps/netplug/Manifest deleted file mode 100644 index 8c479883e9d4..000000000000 --- a/sys-apps/netplug/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST netplug-1.2.9.2.tar.bz2 22332 BLAKE2B 3a4232178e782417e30da3dc33361c4043d5ff9bb610c2f9a82281d395af470ddeab9cf12f91ef4a18f4fe6ff49f85b7015fecc7018b1b561e2e7f179d8d206b SHA512 b68a00eb8874ec7dd6aa9f7b7f529a6e1d9ecece4b798c8cee996b7f3534c556656f642de0ac4b2a6d06fbaf18e3bfaab00934a9292b95939a4935e673e9ca8c diff --git a/sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch b/sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch deleted file mode 100644 index de5cba2cb08d..000000000000 --- a/sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- netplug-1.2.9/main.c -+++ netplug-1.2.9/main.c -@@ -36,6 +36,10 @@ - - #include "netplug.h" - -+/* Support old kernels without wireless */ -+#ifndef IFLA_WIRELESS -+#define IFLA_WIRELESS (IFLA_MASTER + 1) -+#endif /* IFLA_WIRELESS */ - - int use_syslog; - static char *pid_file; -@@ -63,6 +67,14 @@ - - parse_rtattrs(attrs, IFLA_MAX, IFLA_RTA(info), len); - -+ /* Ignore wireless messages */ -+ if (attrs[IFLA_WIRELESS] != NULL -+ && hdr->nlmsg_type == RTM_NEWLINK -+ && info->ifi_change == 0) { -+ do_log(LOG_DEBUG, "Ignoring wireless netlink message"); -+ return 0; -+ } -+ - if (attrs[IFLA_IFNAME] == NULL) { - do_log(LOG_ERR, "No interface name"); - return -1; -@@ -71,7 +83,7 @@ - char *name = RTA_DATA(attrs[IFLA_IFNAME]); - - if (!if_match(name)) { -- do_log(LOG_INFO, "%s: ignoring event", name); -+ do_log(LOG_DEBUG, "%s: ignoring event", name); - return 0; - } - diff --git a/sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch b/sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch deleted file mode 100644 index 0a3b991a82bf..000000000000 --- a/sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch +++ /dev/null @@ -1,187 +0,0 @@ -This patch replaces the for_each_iface nested funtion with a macro so that we -don't have an executable stack and work correctly on NX capable hardware. -See http://www.gentoo.org/proj/en/hardened/gnu-stack.xml for more information. - -Patch by Diego Pettenò (flameeyes@gentoo.org) - -Index: netplug-1.2.9/if_info.c -=================================================================== ---- netplug-1.2.9.orig/if_info.c -+++ netplug-1.2.9/if_info.c -@@ -29,8 +29,7 @@ - - #include "netplug.h" - --#define INFOHASHSZ 16 /* must be a power of 2 */ --static struct if_info *if_info[INFOHASHSZ]; -+struct if_info *if_info[INFOHASHSZ]; - - static const char * - statename(enum ifstate s) -@@ -95,17 +94,6 @@ flags_str(char *buf, unsigned int fl) - return buf; - } - --void --for_each_iface(int (*func)(struct if_info *)) --{ -- for(int i = 0; i < INFOHASHSZ; i++) { -- for(struct if_info *info = if_info[i]; info != NULL; info = info->next) { -- if ((*func)(info)) -- return; -- } -- } --} -- - /* Reevaluate the state machine based on the current state and flag settings */ - void - ifsm_flagpoll(struct if_info *info) -@@ -284,6 +272,14 @@ ifsm_flagchange(struct if_info *info, un - info->lastchange = time(0); - } - -+int find_pid(struct if_info *i, pid_t pid, struct if_info **info) { -+ if (i->worker == pid) { -+ *info = i; -+ return 1; -+ } -+ return 0; -+} -+ - /* handle a script termination and update the state accordingly */ - void ifsm_scriptdone(pid_t pid, int exitstatus) - { -@@ -291,16 +287,8 @@ void ifsm_scriptdone(pid_t pid, int exit - struct if_info *info; - assert(WIFEXITED(exitstatus) || WIFSIGNALED(exitstatus)); - -- int find_pid(struct if_info *i) { -- if (i->worker == pid) { -- info = i; -- return 1; -- } -- return 0; -- } -- - info = NULL; -- for_each_iface(find_pid); -+ for_each_iface(find_pid, pid, &info); - - if (info == NULL) { - do_log(LOG_INFO, "Unexpected child %d exited with status %d", -Index: netplug-1.2.9/main.c -=================================================================== ---- netplug-1.2.9.orig/main.c -+++ netplug-1.2.9/main.c -@@ -164,6 +164,23 @@ child_handler(int sig, siginfo_t *info, - write(child_handler_pipe[1], &ce, sizeof(ce)); - } - -+int pollflags_state(struct if_info *info, int sockfd) { -+ struct ifreq ifr; -+ -+ if (!if_match(info->name)) -+ return 0; -+ -+ memcpy(ifr.ifr_name, info->name, sizeof(ifr.ifr_name)); -+ if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) -+ do_log(LOG_ERR, "%s: can't get flags: %m", info->name); -+ else { -+ ifsm_flagchange(info, ifr.ifr_flags); -+ ifsm_flagpoll(info); -+ } -+ -+ return 0; -+} -+ - /* Poll the existing interface state, so we can catch any state - changes for which we may not have neen a netlink message. */ - static void -@@ -180,28 +197,20 @@ poll_interfaces(void) - close_on_exec(sockfd); - } - -- int pollflags(struct if_info *info) { -- struct ifreq ifr; -- -- if (!if_match(info->name)) -- return 0; -- -- memcpy(ifr.ifr_name, info->name, sizeof(ifr.ifr_name)); -- if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) -- do_log(LOG_ERR, "%s: can't get flags: %m", info->name); -- else { -- ifsm_flagchange(info, ifr.ifr_flags); -- ifsm_flagpoll(info); -- } -- -- return 0; -- } -- -- for_each_iface(pollflags); -+ for_each_iface(pollflags_state, sockfd); - } - - int debug = 0; - -+/* Run over each of the interfaces we know and care about, and -+ make sure the state machine has done the appropriate thing -+ for their current state. */ -+int poll_flags_check(struct if_info *i) { -+ if (if_match(i->name)) -+ ifsm_flagpoll(i); -+ return 0; -+} -+ - int - main(int argc, char *argv[]) - { -@@ -331,17 +340,7 @@ main(int argc, char *argv[]) - { child_handler_pipe[0], POLLIN, 0 }, - }; - -- { -- /* Run over each of the interfaces we know and care about, and -- make sure the state machine has done the appropriate thing -- for their current state. */ -- int poll_flags(struct if_info *i) { -- if (if_match(i->name)) -- ifsm_flagpoll(i); -- return 0; -- } -- for_each_iface(poll_flags); -- } -+ for_each_iface(poll_flags_check); - - for(;;) { - int ret; -Index: netplug-1.2.9/netplug.h -=================================================================== ---- netplug-1.2.9.orig/netplug.h -+++ netplug-1.2.9/netplug.h -@@ -28,6 +28,9 @@ - - #define NP_SCRIPT NP_SCRIPT_DIR "/netplug" - -+#define INFOHASHSZ 16 /* must be a power of 2 */ -+extern struct if_info *if_info[INFOHASHSZ]; -+ - /* configuration */ - - void read_config(char *filename); -@@ -83,7 +86,14 @@ struct if_info *if_info_update_interface - struct rtattr *attrs[]); - int if_info_save_interface(struct nlmsghdr *hdr, void *arg); - void parse_rtattrs(struct rtattr *tb[], int max, struct rtattr *rta, int len); --void for_each_iface(int (*func)(struct if_info *)); -+ -+#define for_each_iface(func, ...) \ -+ for(int i = 0; i < INFOHASHSZ; i++) { \ -+ for(struct if_info *each_iface = if_info[i]; each_iface != NULL; each_iface = each_iface->next) { \ -+ if (func (each_iface, ##__VA_ARGS__)) \ -+ break; \ -+ } \ -+ } - - void ifsm_flagpoll(struct if_info *info); - void ifsm_flagchange(struct if_info *info, unsigned int newflags); diff --git a/sys-apps/netplug/files/netplug-1.2.9.2-downandout.patch b/sys-apps/netplug/files/netplug-1.2.9.2-downandout.patch deleted file mode 100644 index be164e58a440..000000000000 --- a/sys-apps/netplug/files/netplug-1.2.9.2-downandout.patch +++ /dev/null @@ -1,13 +0,0 @@ -https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652418 -https://bugs.gentoo.org/599400 - ---- a/if_info.c -+++ b/if_info.c -@@ -186,6 +186,7 @@ - if (newflags & IFF_UP) { - switch(info->state) { - case ST_DOWN: -+ case ST_DOWNANDOUT: - info->state = ST_INACTIVE; - break; - diff --git a/sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch b/sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch deleted file mode 100644 index 06e645c1dee9..000000000000 --- a/sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch +++ /dev/null @@ -1,65 +0,0 @@ -# Rework SIGCHLD handler to anticipate multiple children dying while the -# handler is being executed. -# -# Without the patch if multiple SIGCHLD signals are received while the signal -# handler is being executed, the first will be left in pending state and the -# extra discarded. Due to the children processing logic in netplugd, the ones -# which were missed will never be waited, left as zombies. -# -# Implementation of the signal handler is following suggested handling in -# https://www.gnu.org/software/libc/manual/html_node/Merged-Signals.html -# -# The patch strives to change only the children wait logic in the signal -# handler, it doesn't try to enhance write call error handling or the unsafe -# call to exit/do_log. Also the formatting is left as it was in the original -# code. - ---- a/main.c -+++ b/main.c -@@ -153,17 +153,29 @@ static int child_handler_pipe[2]; - static void - child_handler(int sig, siginfo_t *info, void *v) - { -- struct child_exit ce; -- int ret; -- ssize_t s = 0; -+ int old_errno = errno; - - assert(sig == SIGCHLD); - -- ce.pid = info->si_pid; -- ret = waitpid(info->si_pid, &ce.status, 0); -- if (ret == info->si_pid) -+ while (1) - { -- s = write(child_handler_pipe[1], &ce, sizeof(ce)); -+ pid_t pid; -+ int status; -+ -+ do -+ { -+ errno = 0; -+ pid = waitpid(WAIT_ANY, &status, WNOHANG); -+ } while (pid <= 0 && errno == EINTR); -+ -+ if (pid <= 0) -+ { -+ break; -+ } -+ -+ struct child_exit ce = { .pid = pid, .status = status }; -+ -+ ssize_t s = write(child_handler_pipe[1], &ce, sizeof(ce)); - - if (s == -1) - { -@@ -171,6 +183,9 @@ child_handler(int sig, siginfo_t *info, void *v) - exit(1); - } - } -+ -+ errno = old_errno; -+ return; - } - - /* Poll the existing interface state, so we can catch any state diff --git a/sys-apps/netplug/files/netplug-2 b/sys-apps/netplug/files/netplug-2 deleted file mode 100644 index 539f1465516a..000000000000 --- a/sys-apps/netplug/files/netplug-2 +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# -# Gentoo-specific netplug script -# -# This file gets called by netplug when it wants to bring an interface -# up or down. -# - -IFACE="$1" -ACTION="$2" - -EXEC="/etc/init.d/net.${IFACE}" - -case "${ACTION}" in - in) - ARGS="--quiet start" - ;; - out) - ARGS="--quiet stop" - ;; - probe) - # Do nothing as we should already be up - exit 0 - ;; - *) - echo "$0: wrong arguments" >&2 - echo "Call with <interface> <in|out|probe>" >&2 - exit 1 - ;; -esac - -export IN_BACKGROUND=true - -if [ -x "${EXEC}" ] -then - ${EXEC} ${ARGS} - exit 0 -else - logger -t netplug "Error: Couldn't configure ${IFACE}, no ${EXEC} !" - exit 1 -fi diff --git a/sys-apps/netplug/metadata.xml b/sys-apps/netplug/metadata.xml deleted file mode 100644 index 115e9d64a669..000000000000 --- a/sys-apps/netplug/metadata.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> -<pkgmetadata> - <!-- maintainer-needed --> -</pkgmetadata> diff --git a/sys-apps/netplug/netplug-1.2.9.2-r3.ebuild b/sys-apps/netplug/netplug-1.2.9.2-r3.ebuild deleted file mode 100644 index d96bca2b7d9d..000000000000 --- a/sys-apps/netplug/netplug-1.2.9.2-r3.ebuild +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit toolchain-funcs - -DESCRIPTION="Brings up/down ethernet ports automatically with cable detection" -HOMEPAGE="https://www.red-bean.com/~bos/" -SRC_URI="https://www.red-bean.com/~bos/netplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86" -IUSE="debug doc" - -DEPEND="doc? ( app-text/ghostscript-gpl - media-gfx/graphviz )" -RDEPEND="" - -PATCHES=( - # Remove nested functions, #116140 - "${FILESDIR}/${PN}-1.2.9-remove-nest.patch" - - # Ignore wireless events - "${FILESDIR}/${PN}-1.2.9-ignore-wireless.patch" - - # Fix DOWNANDOUT problem #599400 - "${FILESDIR}/${P}-downandout.patch" - - # Wait for multiple children in SIGCHLD handler #631316 - "${FILESDIR}/${P}-multi-waitpid-sigchld.patch" -) - -src_prepare() { - # Remove debug flags from CFLAGS - if ! use debug ; then - sed -i -e "s/ -ggdb3//" Makefile || die - fi - - # Remove -O3 and -Werror from CFLAGS - sed -i -e "s/ -O3//" -e "s/ -Werror//" Makefile || die - - default -} - -src_compile() { - tc-export CC - emake CC="${CC}" - - if use doc ; then - emake -C docs/ - fi -} - -src_install() { - into / - dosbin netplugd - doman man/man8/netplugd.8 - - dodir /etc/netplug.d - exeinto /etc/netplug.d - newexe "${FILESDIR}/netplug-2" netplug - - dodir /etc/netplug - echo "eth*" > "${ED}"/etc/netplug/netplugd.conf || die - - dodoc ChangeLog NEWS README TODO - - if use doc; then - dodoc docs/state-machine.ps - fi -} |
