Skip to content
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

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Conversation

CaBeckmann
Copy link
Collaborator

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).

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).
Copy link
Contributor

@bluhm bluhm left a 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]>
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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.

@bluhm bluhm merged commit df00683 into master Mar 1, 2024
1 check passed
@bluhm bluhm deleted the pfresolvectl branch March 1, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants