Browse code

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

- reported by #1256

Daniel-Constantin Mierla authored on 29/09/2017 16:21:53
Showing 1 changed files
... ...
@@ -241,9 +241,9 @@ done
241 241
 for TABLE in $EXTRA_TABLES; do
242 242
 	sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE $TABLE TO $DBRWUSER;"
243 243
 	sql_query "$1" "GRANT SELECT ON TABLE $TABLE TO $DBROUSER;"
244
-	if [ $TABLE != "route_tree" ] ; then
244
+	if [ $TABLE != "route_tree" ] && [ $TABLE != "dr_gateways" ] && [ $TABLE != "dr_rules" ] ; then
245 245
 		sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE "$TABLE"_id_seq TO $DBRWUSER;"
246
-	    sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
246
+		sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
247 247
 	fi
248 248
 	if [ $? -ne 0 ] ; then
249 249
 		merr "Grant privileges to extra tables failed!"