]> git.pld-linux.org Git - packages/zabbix.git/blame - sqlite3_dbname.patch
- frontend-php R: webserver(alias)
[packages/zabbix.git] / sqlite3_dbname.patch
CommitLineData
7efbcfc2
JK
1diff -dur zabbix-3.2.0.orig/conf/zabbix_proxy.conf zabbix-3.2.0/conf/zabbix_proxy.conf
2--- zabbix-3.2.0.orig/conf/zabbix_proxy.conf 2016-10-01 17:44:08.000000000 +0200
3+++ zabbix-3.2.0/conf/zabbix_proxy.conf 2016-10-01 18:00:48.000000000 +0200
4@@ -126,6 +126,7 @@
5 ### Option: DBName
6 # Database name.
7 # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
8+# If provided name does not contain '/' or ':' (no a path or special type) a .db file in /var/lib/zabbix will be used.
9 # Warning: do not attempt to use the same database Zabbix server is using.
10 #
11 # Mandatory: yes
12diff -dur zabbix-3.2.0.orig/conf/zabbix_server.conf zabbix-3.2.0/conf/zabbix_server.conf
13--- zabbix-3.2.0.orig/conf/zabbix_server.conf 2016-10-01 17:44:08.000000000 +0200
14+++ zabbix-3.2.0/conf/zabbix_server.conf 2016-10-01 17:50:32.000000000 +0200
15@@ -79,6 +79,8 @@
16 ### Option: DBName
17 # Database name.
18 # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
19+# If provided name does not contain '/' or ':' (no a path or special
20+# type) a .db file in /var/lib/zabbix will be used.
21 #
22 # Mandatory: yes
23 # Default:
24diff -dur zabbix-3.2.0.orig/src/libs/zbxdb/db.c zabbix-3.2.0/src/libs/zbxdb/db.c
25--- zabbix-3.2.0.orig/src/libs/zbxdb/db.c 2016-09-13 14:20:56.000000000 +0200
26+++ zabbix-3.2.0/src/libs/zbxdb/db.c 2016-10-01 17:59:19.000000000 +0200
27@@ -295,6 +295,7 @@
28 DB_ROW row;
29 #elif defined(HAVE_SQLITE3)
30 char *p, *path = NULL;
31+ char dbname_buf[1024];
32 #endif
33
34 /* Allow executing statements during a connection initialization. Make sure to mark transaction as failed. */
35@@ -581,6 +582,11 @@
36 #elif defined(HAVE_SQLITE3)
37 ZBX_UNUSED(dbschema);
38
39+ if (!strchr(dbname, '/') && !strchr(dbname, ':')) {
40+ zbx_snprintf(dbname_buf, sizeof(dbname_buf), "/var/lib/zabbix/%s.db", dbname);
41+ dbname = dbname_buf;
42+ }
43+
44 #ifdef HAVE_FUNCTION_SQLITE3_OPEN_V2
45 if (SQLITE_OK != sqlite3_open_v2(dbname, &conn, SQLITE_OPEN_READWRITE, NULL))
46 #else
This page took 0.070373 seconds and 4 git commands to generate.