From: Sarah Hoffmann Date: Thu, 5 Mar 2015 20:55:20 +0000 (+0100) Subject: switch remaining GRANTs to configurable web user X-Git-Tag: v2.4.0~26 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/9e3e7bf7916f7bd70aee92d0d106abf093be8651 switch remaining GRANTs to configurable web user fixes #252 --- diff --git a/data/country_name.sql b/data/country_name.sql index eb52cc5d..352337a7 100644 --- a/data/country_name.sql +++ b/data/country_name.sql @@ -295,7 +295,6 @@ CREATE INDEX idx_country_name_country_code ON country_name USING btree (country_ -- REVOKE ALL ON TABLE country_name FROM PUBLIC; -GRANT SELECT ON TABLE country_name TO "www-data"; -- diff --git a/data/gb_postcode_table.sql b/data/gb_postcode_table.sql index 7cd3f694..bee8a964 100644 --- a/data/gb_postcode_table.sql +++ b/data/gb_postcode_table.sql @@ -24,4 +24,3 @@ CREATE TABLE gb_postcode ( CONSTRAINT enforce_srid_geometry CHECK ((st_srid(geometry) = 4326)) ); -GRANT SELECT ON TABLE gb_postcode TO "www-data"; diff --git a/sql/tables.sql b/sql/tables.sql index b27f8e32..9126c629 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -53,6 +53,9 @@ GRANT INSERT ON new_query_log TO "{www-user}" ; GRANT UPDATE ON new_query_log TO "{www-user}" ; GRANT SELECT ON new_query_log TO "{www-user}" ; +GRANT SELECT ON TABLE country_name TO "{www-user}"; +GRANT SELECT ON TABLE gb_postcode TO "{www-user}"; + create view vw_search_query_log as SELECT substr(query, 1, 50) AS query, starttime, endtime - starttime AS duration, substr(useragent, 1, 20) as useragent, language, results, ipaddress FROM new_query_log WHERE type = 'search' ORDER BY starttime DESC; diff --git a/utils/specialphrases.php b/utils/specialphrases.php index 13480695..97b60dde 100755 --- a/utils/specialphrases.php +++ b/utils/specialphrases.php @@ -105,7 +105,7 @@ echo " tablespace ".CONST_Tablespace_Aux_Index; echo ";\n"; - echo "GRANT SELECT ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." TO \"www-data\";\n"; + echo "GRANT SELECT ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1]).' TO "'.CONST_Database_Web_User."\";\n"; }