ScriptTiger / Hosts-BL

Simple tool to handle hosts file black lists that can remove comments, remove duplicates, compress to 9 domains per line, add IPv6 entries, as well as can convert black lists to multiple other black list formats compatible with other software.
https://scripttiger.github.io/more/
MIT License
53 stars 4 forks source link

Output file created with incorrect permissions #3

Closed philipderrin closed 2 years ago

philipderrin commented 2 years ago

When running on Linux, the output file is created with owner write-only, global read-only permissions:

--w----r-- 1 philip philip 3473311 Jun 26 15:16 blocklist.conf

This is because the mode argument to os.WriteFile is 644 (01204). It should be 0644.

ScriptTiger commented 2 years ago

Good catch, @philipderrin! I've just updated this repository, as well as a few others where I made the same mistake. I also published a new release to go with it. I definitely know better, so apologies again, and thanks for pointing that out! While I do use Linux for a great many things, I mostly develop for and on Windows and hadn't yet tested anything on Linux. Windows doesn't honor permissions in the same way, so I hadn't even noticed that. Thanks again!