Repository navigation
Conversation
| } else { | ||
| WLOG("Bootstrap source address '%s' is not a valid IP literal", source_addr); | ||
| // otherwise treat it as a device/interface name | ||
| ares_set_local_dev(channel, source_addr); |
There was a problem hiding this comment.
Does this work? The ares docs say:
If SO_BINDTODEVICE is not supported or the setsocktop call fails (probably because of permissions), the error is silently ignored.
main.c daemon()izes before dns_poller_init which is the caller of this function dropping root will break this and running on a non-linux system will also not work but will no longer show a warning.
There was a problem hiding this comment.
I tested it without daemonizing and dropping root, it works.
|
This is fine by me. |
|
This is trivial enough to do if you need it but I don't like this patch in that it's a niche use case and it introduces a flag that is fundamentally incompatible with daemonizing, which is something that is generally a very good idea to do for security. |
|
I don't get it, if a user doesn't use bind to device, daemonizing and dropping root would still work, this doesn't hurt anybody. If a user do use it, we can still secure it by simply not start the program by root, and use capabilities to allow it to bind to device, which is better and modern practice. BTW, daemonizing is not related to security, dropping root is. |
|
Sorry. I'll add something for this but will make it invalid to try to use options that won't work together. |
solves #209
basically adds a single line of code, ares already has the facility to bind device, curl side doesn't need any change since the api takes address or interface name.