PostgreSQL Fix in db_setup.sh restarts postgresql daemon in any case #668

Closed
DePierre opened this Issue Apr 20, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@DePierre
Contributor

DePierre commented Apr 20, 2016

The fix for postgresql SSL configuration in the file db_setup.sh restarts the daemon even in the case when the user said "no" to the fix:

$ ./scripts/db_setup.sh init 

------------------------- OWTF Database Helper Script -------------------------
                    Helps in creation of user and database                     
-------------------------------------------------------------------------------

[+] Ensure that you have required values in /root/.owtf/db.cfg

Press Enter to continue
n
CREATE ROLE
CREATE DATABASE
Having SSL=true in postgres config causes many errors (psycopg2 problem)
Remove SSL=true from the PostgreSQL config?[Y/n]n
Restarting the postgresql service

https://github.com/owtf/owtf/blob/develop/scripts/db_setup.sh#L33 does not check the user input before restarting the daemon.

I would expect the script to do nothing if I answer "no", especially since restarting the daemon takes quite some time.

DoomTaper added a commit to DoomTaper/owtf that referenced this issue Apr 21, 2016

@viyatb viyatb closed this in 522f64b Apr 21, 2016

@DoomTaper DoomTaper referenced this issue Apr 21, 2016

Closed

Fixes #668 #672

1 of 4 tasks complete

DePierre added a commit to DePierre/owtf that referenced this issue Apr 21, 2016

[misc] Fixes #668, #669
- Now postgres service will restart only if user inputs "y"
- The fix uses `SHOW config_file;` to get the path for the
  postgres config file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment