lucab / libsystemd-rs

A pure-Rust client library to work with systemd
https://crates.io/crates/libsystemd
Other
105 stars 19 forks source link

sysusers: add parsing logic #94

Closed lucab closed 2 years ago

lucab commented 2 years ago

This adds support for parsing entries from sysusers.d lines. Overall logic is organized around the 'nom' parser-combinator framework. It is now possible to roundtrip configuration entries, loading content from files as well as writing back data.

lucab commented 2 years ago

longer term I think we're going to need this parser to gracefully handle unknown features

I think you raised a fair point. Let's rework the parser here to log a warning and proceed on unrecognized line types.

lucab commented 2 years ago

Added one commit to detect&recover on unknown entry types, let me know if that meets your expectations now.

lucab commented 2 years ago

@cgwalters unless further comments, I'm going ahead and merging this.