Skip to content

Commit

Permalink
Always chmod home dir on startup
Browse files Browse the repository at this point in the history
Helps to prevent and retrospectively address issues like
thelounge/thelounge-deb#72

Obviously some sysadmins may want the directory to be world-readable,
but presently, that isn't safe.

This commit could be omitted or later reverted if sensitive data
protection is ensured through other means - e.g. with patches for
existing files, and an emphasis at review time to catch over-exposure in
the future ✌
  • Loading branch information
awfulcooking committed Sep 5, 2021
1 parent 535ac7c commit f5947dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/command-line/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ program
function initalizeConfig() {
if (!fs.existsSync(Helper.getConfigPath())) {
fs.mkdirSync(Helper.getHomePath(), {recursive: true});
fs.chmodSync(Helper.getHomePath(), "0700");
fs.copyFileSync(
path.resolve(path.join(__dirname, "..", "..", "defaults", "config.js")),
Helper.getConfigPath()
);
log.info(`Configuration file created at ${colors.green(Helper.getConfigPath())}.`);
}

fs.chmodSync(Helper.getHomePath(), "0700");
fs.mkdirSync(Helper.getUsersPath(), {recursive: true});
}

0 comments on commit f5947dd

Please sign in to comment.