-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add control socket and implement pfresolvectl #44
Conversation
Adds a control process and control socket to pfresolved, allowing it to be controlled from other programs. Also adds a new program called 'pfresolvectl' that utilizes this socket. It can be used to change the log level of pfresolved, reload the current configuration, or trigger pfresolved to write the hints file if configured. The implementation is based on 'control.c' from iked(8) and on ikectl(8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor issues. Let's put it in as it is.
@@ -1,6 +1,6 @@ | |||
.\" $OpenBSD$ | |||
.\" | |||
.\" Copyright (c) 2023 genua GmbH <[email protected]> | |||
.\" Copyright (c) 2024 genua GmbH <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright for the old year remains. Write 2023,2024.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2023 genua GmbH | |||
* Copyright (c) 2024 genua GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2023,2024
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2023 genua GmbH | |||
* Copyright (c) 2024 genua GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2023,2024
} | ||
|
||
while (!done) { | ||
if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block does nothing. If you don't need it, remove it. It can be copied from iked anytime. If you fill the stub in your next change, this is also fine.
@@ -74,7 +74,7 @@ forwarder_run(struct privsep *ps, struct privsep_proc *p, void *arg) | |||
struct pfresolved *env = ps->ps_env; | |||
int fd; | |||
|
|||
if (pledge("stdio dns inet rpath", NULL) == -1) | |||
if (pledge("stdio dns inet rpath recvfd", NULL) == -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot see where this pledge is needed. I guess there is a follow up change.
Adds a control process and control socket to pfresolved, allowing it to be controlled from other programs. Also adds a new program called 'pfresolvectl' that utilizes this socket. It can be used to change the log level of pfresolved, reload the current configuration, or trigger pfresolved to write the hints file if configured.
The implementation is based on 'control.c' from iked(8) and on ikectl(8).