(************************************************************************
* Group: ENTRIES
*************************************************************************)
-
+(* Common for entry and nisdefault *)
+let common = [ label "lastchange_date" . store integer? . colon ]
+ . [ label "minage_days" . store integer? . colon ]
+ . [ label "maxage_days" . store integer? . colon ]
+ . [ label "warn_days" . store integer? . colon ]
+ . [ label "inactive_days" . store integer? . colon ]
+ . [ label "expire_date" . store integer? . colon ]
+ . [ label "flag" . store integer? ]
+
(* View: entry *)
-let entry = [ key word
- . colon
- . [ label "password" . sto_to_col? . colon ]
- . [ label "lastchange_date" . store integer? . colon ]
- . [ label "minage_days" . store integer? . colon ]
- . [ label "maxage_days" . store integer? . colon ]
- . [ label "warn_days" . store integer? . colon ]
- . [ label "inactive_days" . store integer? . colon ]
- . [ label "expire_date" . store integer? . colon ]
- . [ label "flag" . store integer? ]
- . eol ]
+let entry = [ key word
+ . colon
+ . [ label "password" . sto_to_col? . colon ]
+ . common
+ . eol ]
+
+let nisdefault =
+ let overrides =
+ colon
+ . [ label "password" . store word? . colon ]
+ . common in
+ [ dels "+" . label "@nisdefault" . overrides? . eol ]
(************************************************************************
* LENS
*************************************************************************)
-let lns = (comment|empty|entry) *
+let lns = (comment|empty|entry|nisdefault) *
let filter
= incl "/etc/shadow"