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

fix control socket listener (didn't chdir /) #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafork
Copy link

@rafork rafork commented Apr 9, 2021

When a control socket is in use, the process inherits and retains the existing current working directory. This is a problem when it happens to be in the file system of a removeable storage device like a USB stick. Later, when the user tries to umount the removeable storage, it fails because an ssh process is still using it as a current working directory. The ssh process has to be identified and terminated before the removeable storage can be umounted. This patch changes daemon(1, 1) in the control_persist_detach() function to daemon(0, 1) so that daemon() will chdir /.

@djmdjm
Copy link
Contributor

djmdjm commented Sep 3, 2021

the problem here is that the user may have specified cwd-relative files for particular things that are needed later (e.g. Unix domain socket forwardings) and these will break if the directory changes

@rafork
Copy link
Author

rafork commented Sep 3, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants