Open guijan opened 11 months ago
i'm aware about TOCTTOU and its implications, but i figure the chances of proxychains.conf disappearing between the check and the usage are too small to be relevant. in all the years maintaining this program this theoretical issue not once surfaced in a practical issue report.
https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
There's no guarantee that the information
access()
returns is valid after it returns.This function should be removed and its caller should be reworked to use
open()
: https://github.com/rofl0r/proxychains-ng/blob/d5cc80ae1666facf079b58996d9061eb0ebe9964/src/common.c#L77-L81There's a 2nd usage of
access()
in the source code, but it's not a bug because there's no way to do what it does with file descriptors: https://github.com/rofl0r/proxychains-ng/blob/d5cc80ae1666facf079b58996d9061eb0ebe9964/src/main.c#L122-L129