Добавление 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,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 -