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

init: fix mount flags for files (e.g., /etc/localtime) #1041

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

weiren2
Copy link
Contributor

@weiren2 weiren2 commented Nov 7, 2023

Fixes #1029.

Mount points may have additional flags (e.g., nodev, nosuid) to check for. However, the function get_locked_mount_flags exits immediately and returns an empty flag if the mount point is a file (e.g., /etc/localtime). If the original mount point is a file and it has any "locked" flags, then the file will fail to bind mount as read-only without those "locked" flags (in rootless mode).

I don't think it is necessary to exclude files when checking the mount flags. This PR removed that checking and updated the variable names to reflect the change.

 - Removed the checking of file or directory.
 - Updated variable names to reflect the changes.
@weiren2 weiren2 changed the title init: Fix mount flags for files (e.g., /etc/localtime) init: fix mount flags for files (e.g., /etc/localtime) Nov 7, 2023
@89luca89
Copy link
Owner

Thanks! :)

@89luca89 89luca89 merged commit 52b82d3 into 89luca89:main Nov 19, 2023
15 checks passed
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.

[Error] /etc/localtime failed to bind mount during distrobox-init
2 participants