[sr-dev] git:master:71191715: kamctl: do not set privileges on drouting tables without id for pgsql

Daniel-Constantin Mierla miconda at gmail.com
Fri Sep 29 18:23:13 CEST 2017


Module: kamailio
Branch: master
Commit: 711917153a4be290fd7e405c2c5578fe42ef9aff
URL: https://github.com/kamailio/kamailio/commit/711917153a4be290fd7e405c2c5578fe42ef9aff

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-09-29T18:21:53+02:00

kamctl: do not set privileges on drouting tables without id for pgsql

- reported by #1256

---

Modified: utils/kamctl/kamdbctl.pgsql

---

Diff:  https://github.com/kamailio/kamailio/commit/711917153a4be290fd7e405c2c5578fe42ef9aff.diff
Patch: https://github.com/kamailio/kamailio/commit/711917153a4be290fd7e405c2c5578fe42ef9aff.patch

---

diff --git a/utils/kamctl/kamdbctl.pgsql b/utils/kamctl/kamdbctl.pgsql
index 059b6faa82..c41354ffc6 100644
--- a/utils/kamctl/kamdbctl.pgsql
+++ b/utils/kamctl/kamdbctl.pgsql
@@ -241,9 +241,9 @@ done
 for TABLE in $EXTRA_TABLES; do
 	sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE $TABLE TO $DBRWUSER;"
 	sql_query "$1" "GRANT SELECT ON TABLE $TABLE TO $DBROUSER;"
-	if [ $TABLE != "route_tree" ] ; then
+	if [ $TABLE != "route_tree" ] && [ $TABLE != "dr_gateways" ] && [ $TABLE != "dr_rules" ] ; then
 		sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE "$TABLE"_id_seq TO $DBRWUSER;"
-	    sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
+		sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
 	fi
 	if [ $? -ne 0 ] ; then
 		merr "Grant privileges to extra tables failed!"




More information about the sr-dev mailing list