⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slapo-rwm.5

📁 ldap服务器源码
💻 5
📖 第 1 页 / 共 2 页
字号:
.TH SLAPO-RWM 5 "RELEASEDATE" "OpenLDAP LDVERSION".\" Copyright 1998-2007 The OpenLDAP Foundation, All Rights Reserved..\" Copying restrictions apply.  See the COPYRIGHT file..\" Copyright 2004, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>.\" $OpenLDAP: pkg/ldap/doc/man/man5/slapo-rwm.5,v 1.8.2.7 2007/01/02 21:43:45 kurt Exp $.\".\" Portions of this document should probably be moved to slapd-ldap(5).\" and maybe manual pages for librewrite..\".SH NAMEslapo-rwm \- rewrite/remap overlay.SH SYNOPSISETCDIR/slapd.conf.SH DESCRIPTIONThe.B rwmoverlay to.BR slapd (8)performs basic DN/data rewrite and objectClass/attributeType mapping.Its usage is mostly intended to provide virtual views of existing dataeither remotely, in conjunction with the proxy backend described in.BR slapd-ldap (5),or locally, in conjunction with the relay backend described in.BR slapd-relay (5)..LPThis overlay is experimental..SH MAPPINGAn important feature of the.B rwmoverlay is the capability to map objectClasses and attributeTypesfrom the local set (or a subset of it) to a foreign set, and vice versa.This is accomplished by means of the .B rwm-mapdirective..TP.B rwm-map "{attribute | objectclass} [<local name> | *] {<foreign name> | *}"Map attributeTypes and objectClasses from the foreign server todifferent values on the local slapd.The reason is that some attributes might not be part of the localslapd's schema, some attribute names might be different but serve thesame purpose, etc.If local or foreign name is `*', the name is preserved.If local name is omitted, the foreign name is removed.Unmapped names are preserved if both local and foreign name are `*',and removed if local name is omitted and foreign name is `*'..LPThe local .I objectClasses and .I attributeTypes must be defined in the local schema; the foreign ones do not have to,but users are encouraged to explicitly define the remote attributeTypesand the objectClasses they intend to map.  All in all, when remappinga remote server via back-ldap (\fBslapd-ldap\fP(5)) or back-meta (\fBslapd-meta\fP(5))their definition can be easily obtained by querying the \fIsubschemaSubentry\fPof the remote server; the problem should not exist when remapping a local database.Note, however, that the decision whether to rewrite or not attributeTypeswith .IR "distinguishedName syntax" ,requires the knowledge of the attributeType syntax.See the REWRITING section for details..LPNote that when mapping DN-valued attributes from local to remote,first the DN is rewritten, and then the attributeType is mapped;while mapping from remote to local, first the attributeType is mapped,and then the DN is rewritten.As such, it is important that the local attributeType is appropriatelydefined as using the distinguishedName syntax.Also, note that there are DN-related syntaxes (i.e. compound types witha portion that is DN-valued), like nameAndOptionalUID,whose values are currently not rewritten..SH SUFFIX MASSAGINGA basic feature of the.B rwmoverlay is the capability to perform suffix massaging between a virtualand a real naming context by means of the .B rwm-suffixmassagedirective..TP.B rwm-suffixmassage "[<virtual naming context>]" "<real naming context>"Shortcut to implement naming context rewriting; the trailing partof the DN is rewritten from the virtual to the real naming contextin the bindDN, searchDN, searchFilterAttrDN, compareDN, compareAttrDN,addDN, addAttrDN, modifyDN, modifyAttrDN, modrDN, newSuperiorDN,deleteDN, exopPasswdDN, and from the real to the virtual naming contextin the searchEntryDN, searchAttrDN and matchedDN rewrite contexts.By default no rewriting occurs for the searchFilter and for the referralAttrDN and referralDN rewrite contexts.If no \fI<virtual naming context>\fP is given, the first suffix of thedatabase is used; this requires the .B rwm-suffixmassagedirective be defined \fIafter\fP the database.B suffixdirective.The.B rwm-suffixmassagedirective automatically sets the.B rwm-rewriteEngineto.BR ON ..LPSee the REWRITING section for details..SH REWRITINGA string is rewritten according to a set of rules, called a `rewritecontext'.The rules are based on POSIX (''extended'') regular expressions withsubstring matching; basic variable substitution and map resolution of substrings is allowed by specific mechanisms detailed in the following.The behavior of pattern matching/substitution can be altered by a setof flags..LP.RS.nf<rewrite context> ::= <rewrite rule> [...]<rewrite rule> ::= <pattern> <action> [<flags>].fi.RE.LPThe underlying concept is to build a lightweight rewrite modulefor the slapd server (initially dedicated to the LDAP backend):.LP.SH PassesAn incoming string is matched against a set of.IR rewriteRules .Rules are made of a .IR "regex match pattern" , a .I "substitution pattern"and a set of actions, described by a set of .IR "optional flags" .In case of match, string rewriting is performed according to thesubstitution pattern that allows to refer to substrings matched in theincoming string.The actions, if any, are finally performed.Each rule is executed recursively, unless altered by specific action flags; see "Action Flags" for details.A default limit on the recursion level is set, and can be alteredby the.B rwm-rewriteMaxPassesdirective, as detailed in the "Additional Configuration Syntax" section.The substitution pattern allows map resolution of substrings.A map is a generic object that maps a substitution pattern to a value.The flags are divided in "Pattern Matching Flags" and "Action Flags";the former alter the regex match pattern behavior, while the latteralter the actions that are taken after substitution..SH "Pattern Matching Flags".TP.B `C'honors case in matching (default is case insensitive).TP.B `R'use POSIX ''basic'' regular expressions (default is ''extended'').TP.B `M{n}'allow no more than.B nrecursive passes for a specific rule; does not alter the max total countof passes, so it can only enforce a stricter limit for a specific rule..SH "Action Flags".TP.B `:'apply the rule once only (default is recursive).TP.B `@'stop applying rules in case of match; the current rule is still applied recursively; combine with `:' to apply the current rule only once and then stop..TP.B `#'stop current operation if the rule matches, and issue an `unwilling toperform' error..TP.B `G{n}'jump.B nrules back and forth (watch for loops!).Note that `G{1}' is implicit in every rule..TP.B `I'ignores errors in rule; this means, in case of error, e.g. issued by amap, the error is treated as a missed match.The `unwilling to perform' is not overridden..TP.B `U{n}'uses.Bnas return code if the rule matches; the flag does not alter the recursivebehavior of the rule, so, to have it performed only once, it must be used in combination with `:', e.g..B `:U{32}'returns the value `32' (indicating noSuchObject) after exactly one execution of the rule, if the pattern matches.As a consequence, its behavior is equivalent to `@', with the returncode set to.BR n ;or, in other words, `@' is equivalent to `U{0}'.Positive errors are allowed, indicating the related LDAP error codesas specified in \fIdraft-ietf-ldapbis-protocol\fP..LPThe ordering of the flags can be significant.For instance: `IG{2}' means ignore errors and jump two lines aheadboth in case of match and in case of error, while `G{2}I' means ignoreerrors, but jump two lines ahead only in case of match..LPMore flags (mainly Action Flags) will be added as needed..SH "Pattern Matching"See.BR regex (7)and/or.BR re_format (7)..SH "Substitution Pattern Syntax"Everything starting with `$' requires substitution;.LPthe only obvious exception is `$$', which is turned into a single `$';.LPthe basic substitution is `$<d>', where `<d>' is a digit;0 means the whole string, while 1-9 is a submatch, as discussed in .BR regex (7)and/or.BR re_format (7)..LPa `$' followed by a `{' invokes an advanced substitution.The pattern is:.LP.RS`$' `{' [ <operator> ] <name> `(' <substitution> `)' `}'.RE.LPwhere <name> must be a legal name for the map, i.e..LP.RS.nf<name> ::= [a-z][a-z0-9]* (case insensitive)<operator> ::= `>' `|' `&' `&&' `*' `**' `$'.fi.RE.LPand <substitution> must be a legal substitutionpattern, with no limits on the nesting level..LPThe operators are:.TP.B >sub-context invocation; <name> must be a legal, already definedrewrite context name.TP.B |external command invocation; <name> must refer to a legal, alreadydefined command name (NOT IMPLEMENTED YET).TP.B &variable assignment; <name> defines a variable in the runningoperation structure which can be dereferenced later; operator.B &assigns a variable in the rewrite context scope; operator.B &&assigns a variable that scopes the entire session, e.g. its valuecan be dereferenced later by other rewrite contexts.TP.B *variable dereferencing; <name> must refer to a variable that isdefined and assigned for the running operation; operator.B *dereferences a variable scoping the rewrite context; operator.B **dereferences a variable scoping the whole session, e.g. the valueis passed across rewrite contexts.TP.B $parameter dereferencing; <name> must refer to an existing parameter;the idea is to make some run-time parameters set by the systemavailable to the rewrite engine, as the client host name, the bind DNif any, constant parameters initialized at config time, and so on;no parameter is currently set by either .B back\-ldapor.BR back\-meta ,but constant parameters can be defined in the configuration fileby using the.B rewriteParamdirective..LP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -