2021-09-29 19:22:58 |
David Mandelberg |
description |
If I'm reading the code right, https://git.launchpad.net/dkimpy-milter/tree/dkimpy_milter/config.py?id=b4da312ea7a6ca46c2e572547e3114a15d74e602#n339 says the UMask is an int, https://git.launchpad.net/dkimpy-milter/tree/dkimpy_milter/config.py?id=b4da312ea7a6ca46c2e572547e3114a15d74e602#n432 uses python's int constructor to parse the string, and https://git.launchpad.net/dkimpy-milter/tree/dkimpy_milter/util.py?id=b4da312ea7a6ca46c2e572547e3114a15d74e602#n89 sets the umask without any conversion. According to https://docs.python.org/3/library/functions.html#int, the default is base 10. int('010') is 10, not 8.
Would it be possible to either specify base=0, so that the config file can use 0o as a prefix for octal, or set base=8 for UMask? (I'm guessing most people will assume that UMask octal if it's not otherwise specified.) |
If I'm reading the code right, https://git.launchpad.net/dkimpy-milter/tree/dkimpy_milter/config.py?id=b4da312ea7a6ca46c2e572547e3114a15d74e602#n339 says the UMask is an int, https://git.launchpad.net/dkimpy-milter/tree/dkimpy_milter/config.py?id=b4da312ea7a6ca46c2e572547e3114a15d74e602#n432 uses python's int constructor to parse the string, and https://git.launchpad.net/dkimpy-milter/tree/dkimpy_milter/util.py?id=b4da312ea7a6ca46c2e572547e3114a15d74e602#n89 sets the umask without any conversion. According to https://docs.python.org/3/library/functions.html#int, the default is base 10. int('010') is 10, not 8.
Would it be possible to either specify base=0, so that the config file can use 0o as a prefix for octal, or set base=8 for UMask? (I'm guessing most people will assume that UMask is octal if it's not otherwise specified.) |
|