]>
Commit | Line | Data |
---|---|---|
4ffaba52 JK |
1 | diff -dur -x '*~' -x '*.orig' -x '*.rej' zabbix-3.4.4.orig/conf/zabbix_proxy.conf zabbix-3.4.4/conf/zabbix_proxy.conf |
2 | --- zabbix-3.4.4.orig/conf/zabbix_proxy.conf 2017-12-14 13:15:25.000000000 +0100 | |
3 | +++ zabbix-3.4.4/conf/zabbix_proxy.conf 2017-12-14 13:15:42.000000000 +0100 | |
4 | @@ -152,6 +152,7 @@ | |
7efbcfc2 JK |
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 | |
4ffaba52 JK |
12 | diff -dur -x '*~' -x '*.orig' -x '*.rej' zabbix-3.4.4.orig/src/libs/zbxdb/db.c zabbix-3.4.4/src/libs/zbxdb/db.c |
13 | --- zabbix-3.4.4.orig/src/libs/zbxdb/db.c 2017-11-09 11:37:31.000000000 +0100 | |
14 | +++ zabbix-3.4.4/src/libs/zbxdb/db.c 2017-12-14 13:16:29.000000000 +0100 | |
15 | @@ -294,6 +294,7 @@ | |
7efbcfc2 JK |
16 | DB_ROW row; |
17 | #elif defined(HAVE_SQLITE3) | |
18 | char *p, *path = NULL; | |
19 | + char dbname_buf[1024]; | |
20 | #endif | |
21 | ||
4ffaba52 JK |
22 | #ifndef HAVE_MYSQL |
23 | @@ -608,6 +609,10 @@ | |
24 | ZBX_UNUSED(password); | |
7efbcfc2 | 25 | ZBX_UNUSED(dbschema); |
4ffaba52 | 26 | ZBX_UNUSED(port); |
7efbcfc2 JK |
27 | + if (!strchr(dbname, '/') && !strchr(dbname, ':')) { |
28 | + zbx_snprintf(dbname_buf, sizeof(dbname_buf), "/var/lib/zabbix/%s.db", dbname); | |
29 | + dbname = dbname_buf; | |
30 | + } | |
7efbcfc2 JK |
31 | #ifdef HAVE_FUNCTION_SQLITE3_OPEN_V2 |
32 | if (SQLITE_OK != sqlite3_open_v2(dbname, &conn, SQLITE_OPEN_READWRITE, NULL)) | |
33 | #else |