shadowsocks: Fix shadowsocks not able to start

Shadowsocks is unable to read its own configuration file because it
doesn't have read permissions to the file.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[jvalleroy: Add comment about security concerns]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati authored and James Valleroy committed 2020-02-24 18:42:30 -05:00
1 parent 61545d1b8d
commit 976668d89b
1 file changed
+4 -1
+4 -1
View File
@@ -60,7 +60,10 @@ def subcommand_merge_config(arguments):
new_config.update(config)
new_config = json.dumps(new_config, indent=4, sort_keys=True)
old_umask = os.umask(0o027)
# XXX: Config file with password is world-readable. This is the
# same as the default config file, but find a way to avoid this.
# See https://salsa.debian.org/freedombox-team/plinth/-/merge_requests/1724
old_umask = os.umask(0o022)
try:
open(SHADOWSOCKS_CONFIG, 'w').write(new_config)
finally: