]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Change password authentication method to database
authorKarel Kočí <cynerd@email.cz>
Tue, 28 Jul 2015 09:12:41 +0000 (11:12 +0200)
committerKarel Kočí <cynerd@email.cz>
Tue, 28 Jul 2015 09:12:41 +0000 (11:12 +0200)
.pgpass file has to be allowed in configuration. Using environment variable is more platform independent.

Makefile

index 77f0809bdcbcd6ff47613e73ce5ea92cafc7bb26..e08f4d2374419d54ff97782d56c17f48b44faeae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,9 +50,7 @@ initialize: all
 
 initdb: initialize_database
 initialize_database:
-       echo "$(CONF_DB_HOST):$(CONF_DB_PORT):$(CONF_DB_DATABASE):$(CONF_DB_USER):$(CONF_DB_PASSWORD)" > .pgpass
-       psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
-       $(RM) .pgpass
+       PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseinit.sql
 
 test: parse_kconfig
        scripts/test.py
@@ -79,9 +77,7 @@ clean_measure: cleandb
 
 cleandb: clean_database
 clean_database:
-       echo "$(CONF_DB_HOST):$(CONF_DB_PORT):$(CONF_DB_DATABASE):$(CONF_DB_USER):$(CONF_DB_PASSWORD)" > .pgpass
-       psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
-       rm -f .pgpass
+       PGPASSWORD="$(CONF_DB_PASSWORD)" psql -d "$(CONF_DB_DATABASE)" -h "$(CONF_DB_HOST)" -p "$(CONF_DB_PORT)" -f scripts/databaseclean.sql
 
 distclean: clean distclean_linux distclean_buildroot clean_measure