dperson / torproxy

GNU Affero General Public License v3.0
515 stars 144 forks source link

Tor environment variable do not get written to configuration file #26

Closed rdigiorgio closed 5 years ago

rdigiorgio commented 5 years ago

I do not understand everything inside the startup script, but "TOR_" prefixed environment variables dot not get written to /etc/tor/torrc file.

Problem seems to be coming from this line: https://github.com/dperson/torproxy/blob/ace1b2723cbc337d74672e58abfce833ce8f541e/torproxy.sh#L131

After execution, on TOR_MaxCircuitDirtiness=60, name variable equals "_MaxCircuitDirtiness", which is, I think, not the expected behaviour, as the script then gets to the "continue" command, ignoring this environment variable

rdigiorgio commented 5 years ago

It seems that the line should be replaced with: name="$(cut -c5- <<< ${env%%=*})"

dperson commented 5 years ago

Thanks, I've merged the fix now.