Nsswitch

Parses /etc/nsswitch.conf

Author: Raphael Pinson rap.nosp@m.hink@gmai.nosp@m.l.com

Summary
NsswitchParses /etc/nsswitch.conf
ReferenceThis lens tries to keep as close as possible to `man nsswitch.conf` where possible.
LicenceThis file is licensed under the LGPLv2+, like the rest of Augeas.
Lens Usage
Configuration filesThis lens applies to /etc/nsswitch.conf.
USEFUL PRIMITIVES
comment
empty
sep_colonThe separator for database entries
serviceThe service specification like `files’, `db’, or `nis’
reactionThe reaction on lookup result like `[NOTFOUND=return]’ TODO: Use case-insensitive regexps when ticket #147 is fixed.
database
lns
filter

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.  See filter.

USEFUL PRIMITIVES

comment

let comment = Util.comment

empty

let empty = Util.empty

sep_colon

let sep_colon = del /:[ \t]*/ ": "

The separator for database entries

service

let service = [ label "service" . store Rx.word ]

The service specification like `files’, `db’, or `nis’

reaction

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

The reaction on lookup result like `[NOTFOUND=return]’ TODO: Use case-insensitive regexps when ticket #147 is fixed.

database

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 ]

lns

let lns = (empty | comment database)*

filter

let comment = Util.comment
let empty = Util.empty
let sep_colon = del /:[ \t]*/ ": "
The separator for database entries
let service = [ label "service" . store Rx.word ]
The service specification like `files’, `db’, or `nis’
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
The reaction on lookup result like `[NOTFOUND=return]’ TODO: Use case-insensitive regexps when ticket #147 is fixed.
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)*
Close