mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
Controller can unmount foreign mounts; protect the primary drive.
The /api/disks/unmount endpoint only removed entries from fstab.yaml and asked the reconciler to unmount, but the reconciler deliberately never unmounts paths it has not claimed. Foreign mounts (udisks2 desktop automounts, manual mounts) therefore could not be unmounted from the UI, failing with a confusing "check journalctl" error. - Fall back to a direct umount(8) when a reconcile leaves the requested mount point live. - Reject unmounting the primary WROLPi drive (/media/wrolpi) with a clear 400, normalized to catch path traversal. - Require the normalized mount point to be strictly under /media/ before any direct umount, since the fallback runs as root. - Show "System" instead of an Unmount button for /media/wrolpi in both the React UI and the Controller's simplified UI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e819fedfa4
commit
9d6eb0873e
4 changed files with 93 additions and 12 deletions
|
|
@ -633,7 +633,7 @@ function SmartDetailsModal({drive, open, onClose}) {
|
|||
|
||||
|
||||
// Protected mount points that should not be unmounted
|
||||
const PROTECTED_MOUNTS = ['/', '/boot', '/boot/firmware'];
|
||||
const PROTECTED_MOUNTS = ['/', '/boot', '/boot/firmware', '/media/wrolpi'];
|
||||
|
||||
// Helper to format disk size
|
||||
const formatSize = (size) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue