Skip to content

Commit

Permalink
Back porting to 1.9.x: Locally Exposed Database Credentials - TRUNK-3936
Browse files Browse the repository at this point in the history
author:h3llborn
  • Loading branch information
dkayiwa committed Sep 12, 2013
1 parent b80eb73 commit 0f81346
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -1609,6 +1609,21 @@ public void executing(ChangeSet changeSet, int numChangeSetsToRun) {
"Auto generated by OpenMRS initialization wizard");
wizardModel.workLog.add("Saved runtime properties file " + getRuntimePropertiesFile());

/*
* Fix file readability permissions:
* first revoke read permission from everyone, then set read permissions for only the user
* there is no function to set specific readability for only one user
* and revoke everyone else's, therefore this is the only way to accomplish this.
*/
wizardModel.workLog.add("Adjusting file posix properties to user readonly");
if (getRuntimePropertiesFile().setReadable(false, false)
&& getRuntimePropertiesFile().setReadable(true))
wizardModel.workLog
.add("Successfully adjusted RuntimePropertiesFile to disallow world to read it");
else
wizardModel.workLog
.add("Unable to adjust RuntimePropertiesFile to disallow world to read it");

// don't need to catch errors here because we tested it at the beginning of the wizard
}
finally {
Expand Down

0 comments on commit 0f81346

Please sign in to comment.