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

[BUG] destroy removes potentially mounted directories #662

Open
gahr opened this issue Jan 7, 2024 · 1 comment · May be fixed by #667
Open

[BUG] destroy removes potentially mounted directories #662

gahr opened this issue Jan 7, 2024 · 1 comment · May be fixed by #667
Labels
bug Something isn't working

Comments

@gahr
Copy link

gahr commented Jan 7, 2024

[MANDATORY] Describe the bug [MANDATORY]
Normally, bastille stop would unmount any filesystems listed in the jail's fstab file, via jail -r. However, it is possible for the umount to fail (e.g., under a busy filesystem condition or under #659).

A subsequent bastille destroy (or a single bastille destroy force) doesn't double checks if any entries in fstab are still mounted, and proceeds to remove the whole jail directory.

I think bastille destroy should try harder not to remove files it doesn't own and error out if any filesystems are still mounted inside the jail dir.

[MANDATORY] Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output)
0.10.20231125
14.0-RELEASE-p3
14.0-RELEASE-p3
14.0-RELEASE-p4

[MANDATORY] How did you install bastille? (port/pkg/git)
pkg

[optional] Steps to reproduce?
Add a nullfs mount to a bastille jail. Make it fail to umount on bastille stop. Run bastille destroy. The target directory of the mount is now empty.

[optional] Expected behavior
bastille destroy refuses to destroy a jail directory that contains mounted file systems.

@gahr gahr added the bug Something isn't working label Jan 7, 2024
@gahr gahr linked a pull request Jan 22, 2024 that will close this issue
@gzetzsche
Copy link

I ran into this as well. Checking for mounted filesystems before destruction would be much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants