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 LGPL v2+, 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
database_kwThe database specification like `passwd’, `shadow’, or `hosts’
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 LGPL v2+, 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

database_kw

let database_kw = Rx.word

The database specification like `passwd’, `shadow’, or `hosts’

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 let action_kw = /[Rr][Ee][Tt][Uu][Rr][Nn]/ | /[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]/ in let negate = [ Util.del_str "!" . label "negate" ] in let reaction_entry = [ label "status" . negate? . store status_kw . Util.del_str "=" . [ label "action" . store action_kw ] ] in Util.del_str "[" . [ label "reaction" . (Build.opt_list reaction_entry Sep.space) ] . Util.del_str "]"

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

database

let database = [ label "database" . store database_kw . sep_colon . (Build.opt_list (service|reaction) Sep.space) . Util.comment_or_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 database_kw = Rx.word
The database specification like `passwd’, `shadow’, or `hosts’
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 let action_kw = /[Rr][Ee][Tt][Uu][Rr][Nn]/ | /[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee]/ in let negate = [ Util.del_str "!" . label "negate" ] in let reaction_entry = [ label "status" . negate? . store status_kw . Util.del_str "=" . [ label "action" . store action_kw ] ] in Util.del_str "[" . [ label "reaction" . (Build.opt_list reaction_entry Sep.space) ] . Util.del_str "]"
The reaction on lookup result like `[NOTFOUND=return]’ TODO: Use case-insensitive regexps when ticket #147 is fixed.
let database = [ label "database" . store database_kw . sep_colon . (Build.opt_list (service|reaction) Sep.space) . Util.comment_or_eol ]
let lns = ( empty | comment | database )*
Close