From 7b2661ba214ffb4e8f625deaa6d261ab9d0b7900 Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Wed, 13 Aug 2014 16:59:26 -0500 Subject: [PATCH] Omaha #3049 - entire data directory cannot be removed because it is mounted The script does still verify that the variable reference to the data directory is set. Thus, the root directory could only be removed as a result of malicious intent. A user could intentionally not set the data directory and remove the verification check or the user could intentionally set the data directory to the root location. Former-commit-id: 429aec5855f6f73655b1239aaa03bc1d0ad99aa4 [formerly 6a5deba786d9360cf1f6c6396ffcf64aef752de9] [formerly 604c5a4d10e2529d39f982efa14cf9bbfe7a3867 [formerly efe867dc134027eb7cdf393473476fcc4ec0f6f8]] Former-commit-id: 604c5a4d10e2529d39f982efa14cf9bbfe7a3867 Former-commit-id: f767ff98e13c2f2bf58a3b7d7c4dc6a74619ae02 --- .../postgresql9.3-upgrade/initialize_database.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/deltaScripts/14.4.1/DR3049/postgresql9.3-upgrade/initialize_database.sh b/deltaScripts/14.4.1/DR3049/postgresql9.3-upgrade/initialize_database.sh index f30fdbc38e..6f07eeb250 100644 --- a/deltaScripts/14.4.1/DR3049/postgresql9.3-upgrade/initialize_database.sh +++ b/deltaScripts/14.4.1/DR3049/postgresql9.3-upgrade/initialize_database.sh @@ -162,16 +162,10 @@ do done # purge the existing data directory -if [ -d ${AWIPS2_DATA_DIRECTORY} ]; then - rm -rf ${AWIPS2_DATA_DIRECTORY} - if [ $? -ne 0 ]; then - exit 1 - fi -fi -mkdir ${AWIPS2_DATA_DIRECTORY} +rm -rf ${AWIPS2_DATA_DIRECTORY}/* if [ $? -ne 0 ]; then - exit 1 -fi + exit 1 +fi init_db