Parses /etc/nsswitch.conf
Author: Raphael Pinson rap@gmai l.com hink
Nsswitch | Parses /etc/nsswitch.conf |
Reference | This lens tries to keep as close as possible to `man nsswitch.conf` where possible. |
Licence | This file is licensed under the LGPLv2+, like the rest of Augeas. |
Lens Usage | |
Configuration files | This lens applies to /etc/nsswitch.conf. |
USEFUL PRIMITIVES | |
comment | |
empty | |
sep_colon | The separator for database entries |
service | The service specification like `files’, `db’, or `nis’ |
reaction | The reaction on lookup result like `[NOTFOUND=return]’ TODO: Use case-insensitive regexps when ticket #147 is fixed. |
database | |
lns | |
filter |
This lens applies to /etc/nsswitch.conf. See filter.
let database = let database_kw = "aliases" | "automount" | "bootparams" | "ethers" | "group" | "hosts" | "netgroup" | "netmasks" | "networks" | "passwd" | "protocols" | "publickey" | "rpc" | "sendmailvars" | "services" | "shadow" in [ label "database" . store database_kw . sep_colon . (Build.opt_list (service|reaction) Sep.space) . Util.eol ]
let comment = Util.comment
let empty = Util.empty
The separator for database entries
let sep_colon = del /:[ \t]*/ ": "
The service specification like `files’, `db’, or `nis’
let service = [ label "service" . store Rx.word ]
The reaction on lookup result like `[NOTFOUND=return]’ TODO: Use case-insensitive regexps when ticket #147 is fixed.
let reaction = let status_kw = /[Ss][Uu][Cc][Cc][Ee][Ss][Ss]/ | /[Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd]/ | /[Uu][Nn][Aa][Vv][Aa][Ii][Ll]/ | /[Tt][Rr][Yy][Aa][Gg][Aa][Ii][Nn]/ in
let database = let database_kw = "aliases" | "automount" | "bootparams" | "ethers" | "group" | "hosts" | "netgroup" | "netmasks" | "networks" | "passwd" | "protocols" | "publickey" | "rpc" | "sendmailvars" | "services" | "shadow" in [ label "database" . store database_kw . sep_colon . (Build.opt_list (service|reaction) Sep.space) . Util.eol ]
let lns = ( empty | comment | database )*