Univention Bugzilla – Bug 53902
fix multiple small errors in univention.lib.fstab
Last modified: 2021-11-03 17:01:35 CET
1. Parsing a fstab without options is valid but out implementation raises an InvalidError (/ returns the raw string instead if an entry). >>> univention.lib.fstab.File()._File__parse('192.168.0.81:/home\t/home\tnfs\t\n') '192.168.0.81:/home\t/home\tnfs\t' >>> univention.lib.fstab.File()._File__parse('192.168.0.81:/home\t/home\tnfs\n') '192.168.0.81:/home\t/home\tnfs' 2. an invalid comment / entry is parsed as valid while `mount` ignores it: `mount: fstab: parse error at line 1 -- ignored` >>> univention.lib.fstab.File()._File__parse('192.168.0.81:/home\t/home\tnfs\tro#foo\n') univention.lib.fstab.Entry('192.168.0.81:/home', '/home', 'nfs', options='ro', freq=None, passno=None, comment='#foo') >>> univention.lib.fstab.File()._File__parse('192.168.0.81:/home\t/home\tnfs\tro\t#foo\n') univention.lib.fstab.Entry('192.168.0.81:/home', '/home', 'nfs', options='ro', freq=None, passno=None, comment='#foo') 3. a wrong str() representation is build if `passno=1` but `dump=None` or `dump=0`: >>> str(univention.lib.fstab.Entry('192.168.0.81:/home', '/home', 'nfs', ['ro'], dump=None, passno=1, comment=None)) '192.168.0.81:/home\t/home\tnfs\tro\t1' >>> str(univention.lib.fstab.Entry('192.168.0.81:/home', '/home', 'nfs', ['ro'], dump=0, passno=1, comment=None)) '192.168.0.81:/home\t/home\tnfs\tro\t1'
· Parsing a fstab line without options now generates a valid Entry with `defaults` options. · Fixed str representation of fstab Entry. Default values are completed when needed. · Added some tests for several detected edge cases. univention-lib.yaml 0cd113dfaa2f | Bug #53902: Fixed dump passno str() output for Entry univention-lib (9.0.11-8) f98c525c31f3 | Bug #53902: Modified unitests for lib.fstab 0cd113dfaa2f | Bug #53902: Fixed dump passno str() output for Entry
OK: all issues addressed OK: changes for the unit tests OK: YAML
<https://errata.software-univention.de/#/?erratum=5.0x142>