Добавление ebuild из старого оверлея

This commit is contained in:
imax-ua
2024-04-09 15:52:53 +00:00
parent dadbb93565
commit 9daff4138f
35 changed files with 2053 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
AUX zabbix-agent-3.0.30-mysql8.patch 608 BLAKE2B 56e2cb893269cdeefbc6ca7c40e73b9af2012e4075d997369c516253211d6de6266a1f565ecbf39cd4520fe76f65968d43320ea8e5b2cd59d2a0eb9f8febc9f4 SHA512 13e95e0f3fd1aff4f2546ce5b3cb48c59e117984192a2574d799ca062ce763982d2984e5fa94b49f077aaebbbb3442a06a0d9982a38a21f5ea739fd0fed87148
AUX zabbix-agent-3.0.30-security-disable-PidFile.patch 1378 BLAKE2B c1efdfd0b223987c9d9bf1a3f7731f0bdfeb42d1641bbf4387d70ece757f5cb2fb88bafb87f6938a5efbec091f73d5fde0450e8aa0edc3143d589df5efbe5d19 SHA512 854b198b980e4b58dc6149e285bfa6361ab2a10b83a6d8f07b46754316d6764669e68da8018b402b59317ed95b50a13d25f68f28c4c33d76f0ef1e8dedc8da99
AUX zabbix-agent-3.0.31-fix-cve-2020-15803.patch 3081 BLAKE2B 269b3efedf4f2f4c5365f2119ae166a0bee673841ab0eeae1f3e6311d7015fd35b11330a62c705a567775429319bd440adff48f92c689d35104893eab82a86ec SHA512 950dfe3311dc74fc9068b1c51d22f2a9b2ff20c9011e551151b1aed8212ab26cd5ec369317ec5ad9b52193f59d5f79298205996dd9f2aec48608759769c63c85
AUX zabbix-agent-4.0.18-modulepathfix.patch 330 BLAKE2B 99b3f1082e220ff842e4c4c86e8fcf57666443dd1e124412f167548ab886352077e1f0548e49cf77f28a51d20cc37dc980448eb87c9e7814ac73dcbfe43388e0 SHA512 75330dddde2f47553ac6a6f71d6f2383ab34c0d64ac5dbe45dd31707d8797d1400215d698072df3a0f0eaf862f00509791a6a0eaa43a0f686657d885c03465b5
AUX zabbix-agentd.init 507 BLAKE2B 6d5f0e631639e766d6857304d205acbdf4d07b59deb43be2735d8caf1b3d9d156dfc3c54236b435383d0182869b8f5eb6cb45499a6dac010f5ea497f4533f80b SHA512 7dbdb94dee4bef1c5771ea02169b7f4d0a21e9d2c4ce44db1376562309e1a24455beb16e65a4bb049a1e713cb51bf38ed39ba48da5cf3c8969b6860bcbe74fc5
AUX zabbix-agentd.tmpfiles 35 BLAKE2B 98e917ef03bd6dc5d73e5cbdb140c7e115c7593d5cebf2df9bf3d15713b16c6a44b165a3f68fd36a9119163144a2761457d16ce318bd094ed76ae6040c8b09df SHA512 3c63a2791e6ac77cb3144eb47a275cc8748f5c8943a076052300d6964994b95b18d60f504584fdcb683739dc514261402895e3f30ae2fbdb218acbc42c3d72df
DIST zabbix-agent-5.2.1.tar.gz 19869170 BLAKE2B 6f1a22533606eb875e2d2263e29d9882252cf7024c78071a2fe3ec97b691e26497ef8e9dbf032a0c3dbe84c525a46b601baaa2ac3cf30eb05c37062cdd77105c SHA512 74d0407d85e477be2c504f37c8118406acd3cd06d02f72f197d6c8917e3230eab21c328a883860d5ffed2980c8a27d42ba46ec80cd67878ca1771b2db1868db2
EBUILD zabbix-agent-5.2.1.ebuild 2707 BLAKE2B c204ea54f9dca6b4e4da3dd596ad1938c0cc936c609fdba974a2490d4d902c71d2e1ac78007b65f30d53f0a4ac902775e1e71f40e03c2cd19b7519a260dc1414 SHA512 83cc2727859c33dd91c855d77e0a27bc536b742ec1689a6ff75ee4dbcfb43b8f628160afa7c5176712dc1b204fc81d196e5309192b7460fb7dd22b16153d77e0

View File

@@ -0,0 +1,17 @@
diff --git a/src/libs/zbxdb/db.c b/src/libs/zbxdb/db.c
index a65b9c4..e011c51 100644
--- a/src/libs/zbxdb/db.c
+++ b/src/libs/zbxdb/db.c
@@ -285,7 +285,11 @@ int zbx_db_connect(char *host, char *user, char *password, char *dbname, char *d
#if defined(HAVE_IBM_DB2)
char *connect = NULL;
#elif defined(HAVE_MYSQL)
- my_bool mysql_reconnect = 1;
+#if LIBMYSQL_VERSION_ID >= 80000 /* my_bool type is removed in MySQL 8.0 */
+ bool mysql_reconnect = 1;
+#else
+ my_bool mysql_reconnect = 1;
+#endif
#elif defined(HAVE_ORACLE)
char *connect = NULL;
sword err = OCI_SUCCESS;

View File

@@ -0,0 +1,49 @@
diff --git a/conf/zabbix_agentd.conf b/conf/zabbix_agentd.conf
index b73bd45..c10daca 100644
--- a/conf/zabbix_agentd.conf
+++ b/conf/zabbix_agentd.conf
@@ -5,6 +5,7 @@
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/conf/zabbix_proxy.conf b/conf/zabbix_proxy.conf
index 082f14e..de0284d 100644
--- a/conf/zabbix_proxy.conf
+++ b/conf/zabbix_proxy.conf
@@ -109,6 +109,7 @@ LogFile=/tmp/zabbix_proxy.log
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/conf/zabbix_server.conf b/conf/zabbix_server.conf
index 9f754ca..3999196 100644
--- a/conf/zabbix_server.conf
+++ b/conf/zabbix_server.conf
@@ -62,6 +62,7 @@ LogFile=/tmp/zabbix_server.log
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/src/libs/zbxnix/pid.c b/src/libs/zbxnix/pid.c
index baa8415..04c7e0c 100644
--- a/src/libs/zbxnix/pid.c
+++ b/src/libs/zbxnix/pid.c
@@ -26,6 +26,8 @@ static int fdpid = -1;
int create_pid_file(const char *pidfile)
{
+ return SUCCEED;
+
int fd;
zbx_stat_t buf;
struct flock fl;

View File

@@ -0,0 +1,83 @@
diff --git a/frontends/php/include/classes/screens/CScreenUrl.php b/frontends/php/include/classes/screens/CScreenUrl.php
index e35c5f1..1df396e 100644
--- a/frontends/php/include/classes/screens/CScreenUrl.php
+++ b/frontends/php/include/classes/screens/CScreenUrl.php
@@ -29,18 +29,10 @@ class CScreenUrl extends CScreenBase {
public function get() {
// prevent from resolving macros in configuration page
if ($this->mode != SCREEN_MODE_PREVIEW && $this->mode != SCREEN_MODE_SLIDESHOW) {
- return $this->getOutput(
- CHtmlUrlValidator::validate($this->screenitem['url'], false)
- ? new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'],
- 'auto')
- : makeMessageBox(false, [[
- 'type' => 'error',
- 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
- ]]
- )
- );
+ return $this->getOutput($this->prepareElement());
}
- elseif ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && $this->hostid == 0) {
+
+ if ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && $this->hostid == 0) {
return $this->getOutput((new CTableInfo())->setNoDataMessage(_('No host selected.')));
}
@@ -54,14 +46,28 @@ class CScreenUrl extends CScreenBase {
$this->screenitem['url'] = $url ? $url : $this->screenitem['url'];
- return $this->getOutput(
- CHtmlUrlValidator::validate($this->screenitem['url'], false)
- ? new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'], 'auto')
- : makeMessageBox(false, [[
- 'type' => 'error',
- 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
- ]]
- )
- );
+ return $this->getOutput($this->prepareElement());
+ }
+
+ /**
+ * @return CTag
+ */
+ public function prepareElement() {
+ if (CHtmlUrlValidator::validate($this->screenitem['url'], false)) {
+ $item = new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'],
+ 'auto'
+ );
+
+ if (ZBX_IFRAME_SANDBOX !== false) {
+ $item->setAttribute('sandbox', ZBX_IFRAME_SANDBOX);
+ }
+
+ return $item;
+ }
+
+ return makeMessageBox(false, [[
+ 'type' => 'error',
+ 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
+ ]]);
}
}
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index a67a625..c6a437c 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -1284,6 +1284,14 @@ if (function_exists('bcscale')) {
bcscale(7);
}
+/**
+ * The sandbox attribute enables an extra set of restrictions for the content in the iframe. Default is set to empty
+ * string, which means all restrictions are applied. To disable, set to FALSE. To set a specific set of restrictions,
+ * write a custom string.
+ * https://www.w3.org/TR/2010/WD-html5-20100624/the-iframe-element.html#attr-iframe-sandbox
+ */
+define('ZBX_IFRAME_SANDBOX', '');
+
// HTTP headers
/*
* Value of HTTP X-Frame-options header.

View File

@@ -0,0 +1,11 @@
--- zabbix-4.0.1/configure 2018-10-29 10:36:05.000000000 -0700
+++ zfx/configure 2018-11-07 16:59:28.015968345 -0800
@@ -12510,7 +12510,7 @@
CURL_SSL_CERT_LOCATION="${datadir}/zabbix/ssl/certs"
CURL_SSL_KEY_LOCATION="${datadir}/zabbix/ssl/keys"
-LOAD_MODULE_PATH="${libdir}/modules"
+LOAD_MODULE_PATH="${libdir}/zabbix"

View File

@@ -0,0 +1,20 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/zabbix_agentd"
command_args="--foreground --config /etc/zabbix/zabbix_agentd.conf"
command_background="true"
command_user="zabbix:zabbix"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
provide zabbix-agent
use zabbix-server
}
start_pre() {
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
}

View File

@@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix -

View File

@@ -0,0 +1,131 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
# needed to make webapp-config dep optional
WEBAPP_OPTIONAL="yes"
inherit flag-o-matic user toolchain-funcs
DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
HOMEPAGE="https://www.zabbix.com/"
MY_P=${P/_/}
MY_PV=${PV/_/}
SRC_URI="http://mirror.imax.name/src/zabbix/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
WEBAPP_MANUAL_SLOT="yes"
KEYWORDS="amd64 x86"
IUSE="+agent java curl ipv6 libxml2 ssh ssl snmp static"
REQUIRED_USE="|| ( agent )
static? ( !snmp )"
COMMON_DEPEND="
curl? ( net-misc/curl )
libxml2? ( dev-libs/libxml2 )
snmp? ( net-analyzer/net-snmp )
ssh? ( net-libs/libssh2 )
ssl? ( dev-libs/openssl:=[-bindist] )
"
DEPEND="${COMMON_DEPEND}
static? (
curl? ( net-misc/curl[static-libs] )
libxml2? ( dev-libs/libxml2[static-libs] )
ssh? ( net-libs/libssh2 )
)
"
BDEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
"${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
)
S=${WORKDIR}/${MY_P}
pkg_setup() {
enewgroup zabbix
enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
}
src_prepare() {
default
}
src_configure() {
econf \
$(use_enable agent) \
$(use_enable ipv6) \
$(use_enable static) \
$(use_with curl libcurl) \
$(use_with libxml2) \
$(use_with snmp net-snmp) \
$(use_with ssh ssh2) \
$(use_with ssl openssl)
}
src_compile() {
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
fi
}
src_install() {
local dirs=(
/etc/zabbix
/var/log/zabbix
)
for dir in "${dirs[@]}"; do
dodir "${dir}"
keepdir "${dir}"
done
if use agent; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_agentd.conf
fperms 0640 /etc/zabbix/zabbix_agentd.conf
fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
dosbin src/zabbix_agent/zabbix_agentd
dobin \
src/zabbix_sender/zabbix_sender \
src/zabbix_get/zabbix_get
fi
fowners root:zabbix /etc/zabbix
fowners zabbix:zabbix \
/var/log/zabbix
fperms 0750 \
/etc/zabbix \
/var/log/zabbix
dodoc README INSTALL NEWS ChangeLog \
conf/zabbix_agentd.conf \
conf/zabbix_agentd/userparameter_examples.conf \
conf/zabbix_agentd/userparameter_mysql.conf \
}
pkg_postinst() {
elog "--"
elog
elog "You may need to add these lines to /etc/services:"
elog
elog "zabbix-agent 10050/tcp Zabbix Agent"
elog "zabbix-agent 10050/udp Zabbix Agent"
elog "zabbix-trapper 10051/tcp Zabbix Trapper"
elog "zabbix-trapper 10051/udp Zabbix Trapper"
elog
}