[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #5409 [Tor]: Warn if we're on Windows, and the user ends a line accepting a directory path with a backslash?
#5409: Warn if we're on Windows, and the user ends a line accepting a directory
path with a backslash?
---------------------------+------------------------------
Reporter: Sebastian | Owner:
Type: defect | Status: new
Priority: normal | Milestone: Tor: unspecified
Component: Tor | Version:
Resolution: | Keywords: tor-client
Actual Points: | Parent ID:
Points: |
---------------------------+------------------------------
Comment (by netogallo):
I gave a look to the code and noticed that first parsing is done line by
line with "config_get_lines" which uses the function
"parse_config_line_from_str_verbose". The function
"parse_config_line_from_str_verbose" is responsible for handling the line
continuations but knows nothing about what the setting is (it only splits
into key and value). Much later the function "config_assign_value" from
confparse.c figures out the type of each value.
Currently it is hard to display a warning since "config_assign_value"
can't know if the line is a continuation (ie. ends with \) and
"parse_config_line_from_str_verbose" can't know if the value is a
filename. So possible fixes w/o a radical change in architechture are:
1) Add a flag to the "config_line_t" struct that indicates wether the line
has a continuation and show the warning if the value is a file.
2) Store also store the raw value in the the "config_line_t" struct so we
can do additional checks.
3) Re-structure the whole parsing ...
I am in favor of (2) but have never contributed any code to Tor.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5409#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs