From 7d5b15461add22e4978a035dc9cdd9ea13a4686f 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: 6df6ea2fe8fe15b860c9a2ce1ea075b16b2bbb2f [formerly 9787e4f1d84f186abc9b4564124a74dd7688fc80] [formerly 429aec5855f6f73655b1239aaa03bc1d0ad99aa4] [formerly 429aec5855f6f73655b1239aaa03bc1d0ad99aa4 [formerly 6a5deba786d9360cf1f6c6396ffcf64aef752de9]] [formerly 604c5a4d10e2529d39f982efa14cf9bbfe7a3867 [formerly 429aec5855f6f73655b1239aaa03bc1d0ad99aa4 [formerly 6a5deba786d9360cf1f6c6396ffcf64aef752de9] [formerly 604c5a4d10e2529d39f982efa14cf9bbfe7a3867 [formerly efe867dc134027eb7cdf393473476fcc4ec0f6f8]]]] Former-commit-id: 604c5a4d10e2529d39f982efa14cf9bbfe7a3867 Former-commit-id: e47ba7d5d3fcdd36d4757a37622d3f0be3a9e21d [formerly 6d7ea917ed50ecb988065c87a7a98f7629d02567] [formerly 7b2661ba214ffb4e8f625deaa6d261ab9d0b7900 [formerly f767ff98e13c2f2bf58a3b7d7c4dc6a74619ae02]] Former-commit-id: 7b2661ba214ffb4e8f625deaa6d261ab9d0b7900 Former-commit-id: 416e6a376db5a2b5163b68e2b27bc67cd318a2af --- .../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