Reconciler: uid/gid and ntfsfix for NTFS secondary mounts.

QA on 10.0.0.8 (mount-issues.md findings 2 and 3) showed the reconciler
path missed both NTFS accommodations that mount_drive() and
add_fstab_entry() already have: secondary NTFS drives mounted owned by
root (writable only via ntfs-3g's permissive default), and a dirty NTFS
volume would fail to mount at boot with no cleanup attempted.

Inject uid/gid for ntfs/ntfs3 in the reconciler, and run ntfsfix -d in
SubprocessMountExecutor before NTFS mounts (translating UUID=/LABEL=
specs to /dev/disk/by-* paths, which ntfsfix needs).  Also return an
error MountResult instead of raising when a binary is missing, per the
executor protocol.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-06 16:52:11 -06:00
parent 9f2d9ed82b
commit 910503b641
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 102 additions and 3 deletions

View file

@ -242,6 +242,17 @@ class TestUidGidInjection:
assert "uid=2000" in opts
assert "gid=2000" in opts
def test_injects_uid_gid_for_ntfs(self, tmp_path):
"""ntfs/ntfs3 have no POSIX permissions either; secondary NTFS drives
must mount owned by the wrolpi user like exfat/vfat do."""
fstab = FstabFile(mounts=[_entry(fstype="ntfs")])
rec, fake = make_reconciler(tmp_path, fstab=fstab,
wrolpi_uid=2000, wrolpi_gid=2000)
rec.apply()
opts = fake.mount_calls[0].options
assert "uid=2000" in opts
assert "gid=2000" in opts
def test_does_not_double_inject_if_user_already_supplied(self, tmp_path):
fstab = FstabFile(mounts=[_entry(fstype="vfat",
options="defaults,uid=1234,gid=1234")])