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

lenses/fstab.aug: Allow individual mount options to be empty #849

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rwmjones
Copy link
Contributor

@rwmjones rwmjones commented Feb 4, 2025

Mount allows mount-option fields to be empty (I think it ignores them), but augeas gave an error. Allow this to be parsed, preserving the empty option on write.

Example:
/dev/mapper/vg00-vartmp /var/tmp xfs rw,,nodev,nosuid,noexec,relatime 0 0

Fixes: https://issues.redhat.com/browse/RHEL-77279
Fixes: #832
Signed-off-by: Richard W.M. Jones [email protected]

@rwmjones rwmjones marked this pull request as draft February 4, 2025 12:01
This can be a list, but there's no evidence in the manual that
vfstype=value is permitted, it's just a simple list of strings.

Signed-off-by: Richard W.M. Jones <[email protected]>
Mount allows mount-option fields to be empty (I think it ignores
them), but augeas gave an error.  Allow this to be parsed.  This does
not preserve the empty option on write, but that should not change the
meaning of the entry.

Example:
  /dev/mapper/vg00-vartmp /var/tmp xfs rw,,nodev,nosuid,noexec,relatime 0 0

Fixes: https://issues.redhat.com/browse/RHEL-77279
Fixes: hercules-team#832
Signed-off-by: Richard W.M. Jones <[email protected]>
@rwmjones rwmjones force-pushed the fix-fstab-empty-mntopts branch from d6cd9b0 to fd361c7 Compare February 6, 2025 10:59
@rwmjones rwmjones marked this pull request as ready for review February 6, 2025 11:00
@rwmjones
Copy link
Contributor Author

rwmjones commented Feb 6, 2025

I don't like the full solution here. I think commit 5246ef0 was a hack, not a good fix for that problem. This adds something like another hack on top of that commit.

I would prefer a solution where we allow option fields in the list to be empty, which would be a generalisation of both this PR & commit 5246ef0. However I could not work out how to actually express that as an Augeas lens, just getting lots of ambiguous parsing problems that I was unable to fix.

@rwmjones rwmjones changed the title WIP: lenses/fstab.aug: Allow individual mount options to be empty lenses/fstab.aug: Allow individual mount options to be empty Feb 7, 2025
@georgehansper
Copy link
Member

I'll have a look at this

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.

cannot parse /etc/fstab with trailing "," in the fs_mntops field
2 participants