Tor shouldn't call expand_filename on filenames specified on the command line
The Unix shell is responsible for expanding ~/...
in filenames specified on command lines. This allows users and scripts to quote that so it won't be expanded.
Unfortunately, Tor expands ~/...
in filenames specified on its command line itself.
rransom@ceres:~/tmp$ mkdir '~'
rransom@ceres:~/tmp$ touch '~/my-screwily-named-torrc'
rransom@ceres:~/tmp$ /usr/sbin/tor -f '~/my-screwily-named-torrc'
Dec 04 16:19:51.190 [notice] Tor v0.2.3.8-alpha (git-da15c0cbd6638af3). This is experimental software. Do not rely on it for strong anonymity. (Running on Linux x86_64)
Dec 04 16:19:51.192 [warn] Unable to open configuration file "/home/rransom/my-screwily-named-torrc".
Dec 04 16:19:51.192 [err] Reading config failed--see warnings above.
(That wasn't supposed to work, but it wasn't supposed to fail that way, either.)