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

Out-of-chroot pidfile handling? #69

Open
hhartzer opened this issue May 31, 2024 · 4 comments
Open

Out-of-chroot pidfile handling? #69

hhartzer opened this issue May 31, 2024 · 4 comments

Comments

@hhartzer
Copy link
Contributor

Is it possible to handle PID files out of a chroot? This may be beyond darkhttpd in general, but it'd be kind of a cool thing to support.

We could hold an open file descriptor on the PID file before chroot, but I'm not sure it's possible to unlink with just the file descriptor.

@emikulic
Copy link
Owner

emikulic commented Jun 1, 2024

You could open a file descriptor for the parent directory of the pidfile before chroot and then use unlinkat.

I'm not sure if this is a good idea security-wise. IIUC you can subvert a chroot by chdiring to the outside of it, i.e. using that open fd.

@hhartzer
Copy link
Contributor Author

hhartzer commented Jun 2, 2024

That's an interesting idea. I'll have to think on that.

@emikulic
Copy link
Owner

emikulic commented Jun 2, 2024

I think doing this might be a bit over the top. Is there other software that does this, and evaluated the security aspects of doing so?

@hhartzer
Copy link
Contributor Author

hhartzer commented Jun 3, 2024

It might be, for sure. Not as far as I know, but there could be some. More of a thought. I can close this out if you like.

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

No branches or pull requests

2 participants