PATH:
usr
/
share
/
augeas
/
lenses
/
dist
(* Module: Ldif Parses the LDAP Data Interchange Format (LDIF) Author: Dominic Cleal <dcleal@redhat.com> About: Reference This lens tries to keep as close as possible to RFC2849 <http://tools.ietf.org/html/rfc2849> and OpenLDAP's ldif(5) About: Licence This file is licensed under the LGPLv2+, like the rest of Augeas. *) module Ldif = autoload xfm (************************************************************************ * Group: USEFUL PRIMITIVES ************************************************************************) (* View: comment *) let comment = Util.comment_generic /#[ \t]*/ "# " (* View: empty Map empty lines, including empty comments *) let empty = [ del /#?[ \t]*\n/ "\n" ] (* View: eol Only eol, don't include whitespace *) let eol = Util.del_str "\n" (* View: sep_colon The separator for attributes and values *) let sep_colon = del /:[ \t]*/ ": " (* View: sep_base64 The separator for attributes and base64 encoded values *) let sep_base64 = del /::[ \t]*/ ":: " (* View: sep_url The separator for attributes and URL-sourced values *) let sep_url = del /:<[ \t]*/ ":< " (* Variable: ldapoid_re Format of an LDAP OID from RFC 2251 *) let ldapoid_re = /[0-9][0-9\.]*/ (* View: sep_modspec Separator between modify operations *) let sep_modspec = Util.del_str "-" . eol (************************************************************************ * Group: BASIC ATTRIBUTES ************************************************************************) (* Different types of values, all permitting continuation where the next line begins with whitespace *) let attr_safe_string = let line = /[^ \t\n:<][^\n]*/ in let lines = line . (/\n[ \t]+[^ \t\n][^\n]*/)* in sep_colon . store lines let attr_base64_string = let line = /[a-zA-Z0-9=+]+/ in let lines = line . (/\n[ \t]+/ . line)* in sep_base64 . [ label "@base64" . store lines ] let attr_url_string = let line = /[^ \t\n][^\n]*/ in let lines = line . (/\n[ \t]+/ . line)* in sep_url . [ label "@url" . store lines ] let attr_intflag = sep_colon . store /0|1/ (* View: attr_version version-spec = "version:" FILL version-number *) let attr_version = Build.key_value_line "version" sep_colon (store /[0-9]+/) (* View: attr_dn dn-spec = "dn:" (FILL distinguishedName / ":" FILL base64-distinguishedName) *) let attr_dn = del /dn/i "dn" . ( attr_safe_string | attr_base64_string ) . eol (* View: attr_type AttributeType = ldap-oid / (ALPHA *(attr-type-chars)) *) let attr_type = ldapoid_re | /[a-zA-Z][a-zA-Z0-9-]*/ - /dn/i - /changeType/i - /include/i (* View: attr_option options = option / (option ";" options) *) let attr_option = Util.del_str ";" . [ label "@option" . store /[a-zA-Z0-9-]+/ ] (* View: attr_description Attribute name, possibly with options *) let attr_description = key attr_type . attr_option* (* View: attr_val_spec Generic attribute with a value *) let attr_val_spec = [ attr_description . ( attr_safe_string | attr_base64_string | attr_url_string ) . eol ] (* View: attr_changetype Parameters: t:regexp - value of changeType *) let attr_changetype (t:regexp) = key /changeType/i . sep_colon . store t . eol (* View: attr_modspec *) let attr_modspec = key /add|delete|replace/ . sep_colon . store attr_type . attr_option* . eol (* View: attr_dn_value Parses an attribute line with a DN on the RHS Parameters: k:regexp - match attribute name as key *) let attr_dn_value (k:regexp) = [ key k . ( attr_safe_string | attr_base64_string ) . eol ] (* View: sep_line *) let sep_line = empty | comment (* View: attr_include OpenLDAP extension, must be separated by blank lines *) let attr_include = eol . [ key "include" . sep_colon . store /[^ \t\n][^\n]*/ . eol . comment* . eol ] (* View: sep_record *) let sep_record = ( sep_line | attr_include )* (************************************************************************ * Group: LDIF CONTENT RECORDS ************************************************************************) (* View: ldif_attrval_record ldif-attrval-record = dn-spec SEP 1*attrval-spec *) let ldif_attrval_record = [ seq "record" . attr_dn . ( sep_line* . attr_val_spec )+ ] (* View: ldif_content ldif-content = version-spec 1*(1*SEP ldif-attrval-record) *) let ldif_content = [ label "@content" . ( sep_record . attr_version )? . ( sep_record . ldif_attrval_record )+ . sep_record ] (************************************************************************ * Group: LDIF CHANGE RECORDS ************************************************************************) (* View: change_add change-add = "add" SEP 1*attrval-spec *) let change_add = [ attr_changetype "add" ] . ( sep_line* . attr_val_spec )+ (* View: change_delete change-delete = "add" SEP 1*attrval-spec *) let change_delete = [ attr_changetype "delete" ] (* View: change_modspec change-modspec = add/delete/replace: AttributeDesc SEP *attrval-spec "-" *) let change_modspec = attr_modspec . ( sep_line* . attr_val_spec )* (* View: change_modify change-modify = "modify" SEP *mod-spec *) let change_modify = [ attr_changetype "modify" ] . ( sep_line* . [ change_modspec . sep_line* . sep_modspec ] )+ (* View: change_modrdn ("modrdn" / "moddn") SEP newrdn/newsuperior/deleteoldrdn *) let change_modrdn = let attr_deleteoldrdn = [ key "deleteoldrdn" . attr_intflag . eol ] in let attrs_modrdn = attr_dn_value "newrdn" | attr_dn_value "newsuperior" | attr_deleteoldrdn in [ attr_changetype /modr?dn/ ] . ( sep_line | attrs_modrdn )* . attrs_modrdn (* View: change_record changerecord = "changetype:" FILL (changeadd/delete/modify/moddn) *) let change_record = ( change_add | change_delete | change_modify | change_modrdn) (* View: change_control "control:" FILL ldap-oid 0*1(1*SPACE ("true" / "false")) 0*1(value-spec) *) let change_control = let attr_criticality = [ Util.del_ws_spc . label "criticality" . store /true|false/ ] in let attr_ctrlvalue = [ label "value" . (attr_safe_string | attr_base64_string | attr_url_string ) ] in [ key "control" . sep_colon . store ldapoid_re . attr_criticality? . attr_ctrlvalue? . eol ] (* View: ldif_change_record ldif-change-record = dn-spec SEP *control changerecord *) let ldif_change_record = [ seq "record" . attr_dn . ( ( sep_line | change_control )* . change_control )? . sep_line* . change_record ] (* View: ldif_changes ldif-changes = version-spec 1*(1*SEP ldif-change-record) *) let ldif_changes = [ label "@changes" . ( sep_record . attr_version )? . ( sep_record . ldif_change_record )+ . sep_record ] (************************************************************************ * Group: LENS ************************************************************************) (* View: lns *) let lns = sep_record | ldif_content | ldif_changes let filter = incl "/etc/openldap/schema/*.ldif" let xfm = transform lns filter
[+]
..
[-] mailscanner.aug
[edit]
[-] access.aug
[edit]
[-] gshadow.aug
[edit]
[-] activemq_conf.aug
[edit]
[-] gtkbookmarks.aug
[edit]
[-] activemq_xml.aug
[edit]
[-] hostname.aug
[edit]
[-] afs_cellalias.aug
[edit]
[-] mcollective.aug
[edit]
[-] aliases.aug
[edit]
[-] mdadm_conf.aug
[edit]
[-] anacron.aug
[edit]
[-] memcached.aug
[edit]
[-] approx.aug
[edit]
[-] group.aug
[edit]
[-] phpvars.aug
[edit]
[-] apt_update_manager.aug
[edit]
[-] grub.aug
[edit]
[-] puppet.aug
[edit]
[-] aptcacherngsecurity.aug
[edit]
[-] mongodbserver.aug
[edit]
[-] aptconf.aug
[edit]
[-] host_conf.aug
[edit]
[-] aptpreferences.aug
[edit]
[-] hosts.aug
[edit]
[-] aptsources.aug
[edit]
[-] hosts_access.aug
[edit]
[-] authorized_keys.aug
[edit]
[-] htpasswd.aug
[edit]
[-] automaster.aug
[edit]
[-] jettyrealm.aug
[edit]
[-] automounter.aug
[edit]
[-] mke2fs.aug
[edit]
[-] avahi.aug
[edit]
[-] jaas.aug
[edit]
[-] backuppchosts.aug
[edit]
[-] modprobe.aug
[edit]
[-] bbhosts.aug
[edit]
[-] jmxaccess.aug
[edit]
[-] bootconf.aug
[edit]
[-] modules.aug
[edit]
[-] build.aug
[edit]
[-] jmxpassword.aug
[edit]
[-] cachefilesd.aug
[edit]
[-] modules_conf.aug
[edit]
[-] carbon.aug
[edit]
[-] json.aug
[edit]
[-] cgconfig.aug
[edit]
[-] nagiosobjects.aug
[edit]
[-] cgrules.aug
[edit]
[-] kdump.aug
[edit]
[-] channels.aug
[edit]
[-] monit.aug
[edit]
[-] chrony.aug
[edit]
[-] multipath.aug
[edit]
[-] clamav.aug
[edit]
[-] keepalived.aug
[edit]
[-] cobblermodules.aug
[edit]
[-] known_hosts.aug
[edit]
[-] cobblersettings.aug
[edit]
[-] koji.aug
[edit]
[-] collectd.aug
[edit]
[-] mysql.aug
[edit]
[-] cpanel.aug
[edit]
[-] nagioscfg.aug
[edit]
[-] cron.aug
[edit]
[-] krb5.aug
[edit]
[-] crypttab.aug
[edit]
[-] netmasks.aug
[edit]
[-] cups.aug
[edit]
[-] ldif.aug
[edit]
[-] cyrus_imapd.aug
[edit]
[-] networkmanager.aug
[edit]
[-] darkice.aug
[edit]
[-] networks.aug
[edit]
[-] debctrl.aug
[edit]
[-] nrpe.aug
[edit]
[-] desktop.aug
[edit]
[-] ldso.aug
[edit]
[-] device_map.aug
[edit]
[-] lightdm.aug
[edit]
[-] dhclient.aug
[edit]
[-] nginx.aug
[edit]
[-] dhcpd.aug
[edit]
[-] limits.aug
[edit]
[-] dhcpd_140.aug
[edit]
[-] login_defs.aug
[edit]
[-] dns_zone.aug
[edit]
[-] ntpd.aug
[edit]
[-] dnsmasq.aug
[edit]
[-] nsswitch.aug
[edit]
[-] dovecot.aug
[edit]
[-] ntp.aug
[edit]
[-] dpkg.aug
[edit]
[-] odbc.aug
[edit]
[-] dput.aug
[edit]
[-] openshift_http.aug
[edit]
[-] erlang.aug
[edit]
[-] openshift_config.aug
[edit]
[-] ethers.aug
[edit]
[-] pamconf.aug
[edit]
[-] exports.aug
[edit]
[-] logrotate.aug
[edit]
[-] fai_diskconfig.aug
[edit]
[-] openvpn.aug
[edit]
[-] fonts.aug
[edit]
[-] pagekite.aug
[edit]
[-] fstab.aug
[edit]
[-] pam.aug
[edit]
[-] fuse.aug
[edit]
[-] passwd.aug
[edit]
[-] gdm.aug
[edit]
[-] httpd.aug
[edit]
[-] postfix_access.aug
[edit]
[-] inetd.aug
[edit]
[-] pbuilder.aug
[edit]
[-] inifile.aug
[edit]
[-] pg_hba.aug
[edit]
[-] inittab.aug
[edit]
[-] pgbouncer.aug
[edit]
[-] inputrc.aug
[edit]
[-] logwatch.aug
[edit]
[-] interfaces.aug
[edit]
[-] lokkit.aug
[edit]
[-] iproute2.aug
[edit]
[-] mailscanner_rules.aug
[edit]
[-] iptables.aug
[edit]
[-] php.aug
[edit]
[-] iscsid.aug
[edit]
[-] lvm.aug
[edit]
[-] util.aug
[edit]
[-] openshift_quickstarts.aug
[edit]
[-] xinetd.aug
[edit]
[-] postfix_main.aug
[edit]
[-] xendconfsxp.aug
[edit]
[-] postfix_master.aug
[edit]
[-] vfstab.aug
[edit]
[-] postfix_sasl_smtpd.aug
[edit]
[-] vmware_config.aug
[edit]
[-] postfix_transport.aug
[edit]
[-] xml.aug
[edit]
[-] postfix_virtual.aug
[edit]
[-] xorg.aug
[edit]
[-] postgresql.aug
[edit]
[-] xymon.aug
[edit]
[-] properties.aug
[edit]
[-] xymon_alerting.aug
[edit]
[-] protocols.aug
[edit]
[-] yum.aug
[edit]
[-] puppet_auth.aug
[edit]
[-] puppetfile.aug
[edit]
[-] vsftpd.aug
[edit]
[-] puppetfileserver.aug
[edit]
[-] anaconda.aug
[edit]
[-] pylonspaste.aug
[edit]
[-] pythonpaste.aug
[edit]
[-] qpid.aug
[edit]
[-] quote.aug
[edit]
[-] rabbitmq.aug
[edit]
[-] redis.aug
[edit]
[-] webmin.aug
[edit]
[-] reprepro_uploaders.aug
[edit]
[-] resolv.aug
[edit]
[-] rhsm.aug
[edit]
[-] rmt.aug
[edit]
[-] rsyncd.aug
[edit]
[-] rsyslog.aug
[edit]
[-] rx.aug
[edit]
[-] samba.aug
[edit]
[-] schroot.aug
[edit]
[-] securetty.aug
[edit]
[-] sep.aug
[edit]
[-] services.aug
[edit]
[-] shadow.aug
[edit]
[-] shells.aug
[edit]
[-] shellvars.aug
[edit]
[-] shellvars_list.aug
[edit]
[-] simplelines.aug
[edit]
[-] simplevars.aug
[edit]
[-] sip_conf.aug
[edit]
[-] slapd.aug
[edit]
[-] slapd_140.aug
[edit]
[-] smbusers.aug
[edit]
[-] solaris_system.aug
[edit]
[-] soma.aug
[edit]
[-] spacevars.aug
[edit]
[-] splunk.aug
[edit]
[-] squid.aug
[edit]
[-] ssh.aug
[edit]
[-] sshd.aug
[edit]
[-] sshd_140.aug
[edit]
[-] sssd.aug
[edit]
[-] stunnel.aug
[edit]
[-] subversion.aug
[edit]
[-] sudoers.aug
[edit]
[-] sysconfig.aug
[edit]
[-] sysconfig_route.aug
[edit]
[-] sysctl.aug
[edit]
[-] syslog.aug
[edit]
[-] systemd.aug
[edit]
[-] thttpd.aug
[edit]
[-] tuned.aug
[edit]
[-] up2date.aug
[edit]
[-] updatedb.aug
[edit]
[-] wine.aug
[edit]