[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #19661 [Core Tor/Tor]: tor refuses to use /dev/null as a config file
#19661: tor refuses to use /dev/null as a config file
-------------------------------------------------+-------------------------
Reporter: weasel | Owner:
| cypherpunks
Type: defect | Status:
| needs_review
Priority: Medium | Milestone: Tor:
| 0.3.0.x-final
Component: Core Tor/Tor | Version: Tor:
| 0.2.8.5-rc
Severity: Normal | Resolution:
Keywords: easy, lorax, integration, review- | Actual Points:
group-14 |
Parent ID: | Points: .1
Reviewer: nickm | Sponsor:
-------------------------------------------------+-------------------------
Comment (by nickm):
I think it would be much better to stop using file_status() whenever we
don't absolutely have to do so. That's for a couple of reasons:
* The st_size field is not reliable on S_IFCHR devices, so anything
that distinguishes between FN_EMPTY and FN_FILE will get the wrong answer.
* Generally, when we want to see whether we can read a file, it's
better to just try to read the file and see what happens. To do otherwise
invites race conditions. The only time when it makes sense to have a
separate "does this file exist" check is when we *aren't* going to open
the file.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19661#comment:17>
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