Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[release/0.20] alpine: avoid wiping out writable host mounts under /home, etc #2244

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

AkihiroSuda
Copy link
Member

Cherry-pick (clean):

  • Fix parsing ssh keys as block string
  • Create a mount script instead of editing /etc/fstab
  • Make lima-init.sh yaml parsing more robust

A host directory could be wiped out when all the following conditions are met:

  • The directory is mounted to Lima via virtiofs or 9p (reverse-sshfs is not affected)
  • The mount is writable
  • The mount point in the guest is under one of: /etc /home /root /usr/local /var/lib
  • The guest OS is Alpine Linux

Fix #2221
Fix rancher-sandbox/rancher-desktop#6582

The escaping is needed to print the string with quotes, but would break the umount command.

jandubois and others added 3 commits March 11, 2024 20:31
* Fix parsing ssh keys as block string
* Create a mount script instead of editing /etc/fstab
* Make lima-init.sh yaml parsing more robust

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
(cherry picked from commit 9a10748)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
A host directory could be wiped out when all the following conditions are met:
- The directory is mounted to Lima via virtiofs or 9p (reverse-sshfs is not affected)
- The mount is writable
- The mount point in the guest is under one of: /etc /home /root /usr/local /var/lib
- The guest OS is Alpine Linux

Fix issue 2221
Fix rancher-sandbox/rancher-desktop issue 6582

Co-authored-by: Jan Dubois <jan.dubois@suse.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 795ada2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
The escaping is needed to print the string with quotes, but would break
the umount command.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
(cherry picked from commit a782327)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda AkihiroSuda added this to the v0.20.2 milestone Mar 12, 2024
@AkihiroSuda AkihiroSuda merged commit b14a40c into lima-vm:release/0.20 Mar 12, 2024
43 of 44 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants