diff options
author | Aleksejs Sestakovs <aleksejs.sestakovs@zabbix.com> | 2022-06-17 19:15:01 +0300 |
---|---|---|
committer | Aleksejs Sestakovs <aleksejs.sestakovs@zabbix.com> | 2022-06-17 19:16:21 +0300 |
commit | ade50d5843a31236097718ca2147446725582636 (patch) | |
tree | 9698a88650142032989909d418c5c4e93d74ca7f | |
parent | f057201f4b0a94e6ef7ebf84304774e29c1ae17e (diff) |
..F.....S. [ZBX-20994] fixed access limitation for Oracle DB to list tables accessible to the user
* commit '3090d6083697382eeb3ca7e6c43d0e431458f9a2':
.D........ [ZBX-20994] added changelog
..F.....S. [ZBX-20994] fixed access limitation for Oracle DB to list tables accessible to the user
(cherry picked from commit ed574b457ee53df58c9c44e5d595c3a18ecde8c1)
-rw-r--r-- | ChangeLog.d/bugfix/ZBX-20994 | 1 | ||||
-rw-r--r-- | src/libs/zbxdbhigh/db.c | 5 | ||||
-rw-r--r-- | ui/include/classes/db/OracleDbBackend.php | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ChangeLog.d/bugfix/ZBX-20994 b/ChangeLog.d/bugfix/ZBX-20994 new file mode 100644 index 00000000000..0f9ee209c2f --- /dev/null +++ b/ChangeLog.d/bugfix/ZBX-20994 @@ -0,0 +1 @@ +..F.....S. [ZBX-20994] fixed access limitation for Oracle DB to list tables accessible to the user (asestakovs) diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index f0481b3b6ad..10cc3f670c6 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -2025,9 +2025,8 @@ int DBtable_exists(const char *table_name) #elif defined(HAVE_ORACLE) result = DBselect( "select 1" - " from tab" - " where tabtype='TABLE'" - " and lower(tname)='%s'", + " from all_tables" + " where lower(table_name)='%s'", table_name_esc); #elif defined(HAVE_POSTGRESQL) result = DBselect( diff --git a/ui/include/classes/db/OracleDbBackend.php b/ui/include/classes/db/OracleDbBackend.php index 291e85d6737..bffdba41387 100644 --- a/ui/include/classes/db/OracleDbBackend.php +++ b/ui/include/classes/db/OracleDbBackend.php @@ -30,7 +30,7 @@ class OracleDbBackend extends DbBackend { * @return boolean */ protected function checkDbVersionTable() { - $table_exists = DBfetch(DBselect("SELECT table_name FROM user_tables WHERE table_name='DBVERSION'")); + $table_exists = DBfetch(DBselect("SELECT table_name FROM all_tables WHERE table_name='DBVERSION'")); if (!$table_exists) { $this->setError(_s('Unable to determine current Zabbix database version: %1$s.', |