Hrm, this depends a little on how much verification we want to do. We can either say "this config file parses, we're good" or we can say "we can actually apply all the settings in the config file". I'm leaning towards the former, which indicates this is a bug, but maybe others think it's the latter in which case we should improve the docs.
Should a new option (such as --parse-config) be added for the more minimal step of parsing only and --verify-config left as is to preserve compatibility? Or is it okay to change the behavior of --verify-config directly?
I am not running a relay, and I'm about to start one, and I want to know if it will work,
I am running a relay, and I'm about to change the config, and I want to know if it will work
We can bind to ports in case 1), but not case 2).
I think we should add a new option --parse-config that just does an options_verify().
Of course, the risk is that it will succeed, and then when it gets to options_act(), it will fail because it suddenly finds out it can't do what it wanted to do.
But for --verify-config, the risk is that it will fail unnecessarily, because it could do the things if only it were the existing tor process.
I'd like someone else to review this next, and check it against CI.
They can decide if we need unit test scripts for --parse-config and --verify-config.
Thanks for the patch! The code looks good. Like teor, I wonder if tests are needed.
Right now I'm not sure whether the originally reported problem still exists. I can't seem to get a "permission denied" error when setting SOCKSPort 88 on the command line with --verify-config on master, even though I do get that error without the --verify-config option.
Trac: Status: needs_review to needs_information Priority: High to Low
No one I've asked seems to be able to reproduce this on a modern tor. There's some evidence that such a bug might have existed back before 0.2.0, but it seems like it's gone in supported releases.
rl1987, thanks again for working on this patch. I'm sorry it turns out to be unnecessary.
Trac: Status: needs_information to closed Resolution: N/Ato worksforme