summaryrefslogtreecommitdiff
path: root/usr/src/man/man4/NISLDAPmapping.4
blob: 0094fb0ad83edaec5c7943bdef6673798c2076ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
'\" te
.\" Copyright (C) 2006, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH NISLDAPMAPPING 4 "Feb 25, 2017"
.SH NAME
NISLDAPmapping \- mapping file used by the NIS server components
.SH SYNOPSIS
.LP
.nf
\fB/var/yp/NISLDAPmapping\fR
.fi

.SH DESCRIPTION
.LP
The \fBNISLDAPmapping\fR file specifies the mapping between NIS map entries and
equivalent Directory Information Tree (DIT) entries.
.sp
.LP
The presence of \fB/var/yp/NISLDAPmapping\fR on a NIS master server causes that
server to obtain NIS data from LDAP. See \fBypserv\fR(4). If
\fB/var/yp/NISLDAPmapping\fR is present but the connection configuration file
that is defined in \fB/etc/default/ypserv\fR cannot be found, a warning is
logged. See \fBypserv\fR(1M).
.sp
.LP
NIS slave servers always obtain their data from a NIS master server, whether or
not that server is getting data from LDAP, and ignore the
\fB/var/yp/NISLDAPmapping\fR file.
.sp
.LP
A simple \fBNISLDAPmapping\fR file is created using \fBinityp2l\fR(1M). You can
customize your \fBNISLDAPmapping\fR file as you require.
.sp
.LP
Each attribute defined below can be specified
in\fB/var/yp/NISLDAPmappingLDAP\fR or as an LDAP attribute. If both are
specified, then the attribute in \fB/var/yp/NISLDAPmapping\fR (including empty
values) takes precedence.
.sp
.LP
A continuation is indicated by a '\e' (backslash) in the last position,
immediately before the newline of a line. Characters are escaped, that is,
exempted from special interpretation, when preceded by a backslash character.
.sp
.LP
The '#' (hash) character starts a comment. White space is either ASCII space or
a horizontal tab. In general, lines consist of optional white space, an
attribute name, at least one white space character, and an attribute value.
.SH EXTENDED DESCRIPTION
.SS "File Syntax"
.LP
Repeated fields, with separator characters, are described by the following
syntax:
.sp
.ne 2
.na
\fBOne or more entries\fR
.ad
.RS 24n
entry:entry:entry
.sp
.in +2
.nf
entry[":"...]
.fi
.in -2

.RE

.sp
.ne 2
.na
\fBZero or more entries\fR
.ad
.RS 24n
.sp
.in +2
.nf
[entry":"...]
.fi
.in -2

.RE

.SS "Attributes"
.LP
Attributes generally apply to one more more NIS maps. Map names can be
specified either on their own,that is in \fBpasswd.byname\fR, in which case
they apply to all domains, or for individual NIS domains, for example, in
\fBpasswd.byname,example.sun.uk\fR. Where a map is mentioned in more than one
attribute, both versions are applied. If any parts of the attributes are in
conflict, the domain specific version takes precedence over the non-domain
specific version.
.sp
.LP
Each domain specific attributes must appear in \fBNISLDAPmapping\fR before any
related non-domain specific attribute. If non-domain specific attributes appear
first, behavior may be unpredictable. Errors are logged when non-domain
specific attributes are found first.
.sp
.LP
You can associate a group of map names with a \fBdatabaseId\fR. In effect, a
macro is expanded to the group of names. Use this mechanism where the same
group of names is used in many attributes or where domain specific map names
are used. Then, you can make any changes to the domain name in one place.
.sp
.LP
Unless otherwise noted, all elements of the syntaxes below may be surrounded by
white space. Separator characters and white space must be escaped if they are
part of syntactic elements.
.sp
.LP
The following attributes are recognized.
.sp
.ne 2
.na
\fB\fBnisLDAPdomainContext\fR\fR
.ad
.sp .6
.RS 4n
The context to use for a NIS domain.
.sp
The syntax for \fBnisLDAPdomainContext\fR is:
.sp
.in +2
.nf
NISDomainName ":" context
.fi
.in -2

The following is an example of the \fBnisLDAPdomainContext\fR attribute:
.sp
.in +2
.nf
domain.one : dc=site, dc=company, dc=com
.fi
.in -2

The mapping file should define the context for each domain before any other
attribute makes use of the \fBNISDomainName\fR specified for that domain.
.RE

.sp
.ne 2
.na
\fB\fBnisLDAPyppasswddDomains\fR\fR
.ad
.sp .6
.RS 4n
Lists the domains for which password changes should be made. NIS password
change requests do not specify the domains in which any given password should
be changed. In traditional NIS this information is effectively hard coded in
the NIS makefile.
.sp
The syntax for the \fBnisLDAPyppasswddDomains\fR attribute is:
.sp
.in +2
.nf
domainname
.fi
.in -2

If there are multiple domains, use multiple \fBnisLDAPyppasswddDomain\fR
entries with one domainname per entry.
.RE

.sp
.ne 2
.na
\fB\fBnisLDAPdatabaseIdMapping\fR\fR
.ad
.sp .6
.RS 4n
Sets up an alias for a group of NIS map names. There is no default value.
.sp
The syntax for the \fBnisLDAPdatabaseIdMapping\fR attribute is:
.sp
.in +2
.nf
databaseId ":" ["["indexlist"]"] mapname[" "...]
.fi
.in -2

where
.sp
.in +2
.nf
databaseId      = Label identifying a (subset of a) NIS
                  object for mapping purposes.
indexlist       = fieldspec[","...]
fieldspec       = fieldname "=" fieldvalue
fieldname       = The name of a entry field as defined in
                  nisLDAPnameFields.
fieldvalue      = fieldvaluestring | \e" fieldvaluestring \e"
.fi
.in -2

\fBindexlist\fR is used for those cases where it is necessary to select a
subset of entries from a NIS map. The subset are those NIS entries that match
the \fBindexlist\fR. If there are multiple specifications indexed for a
particular NIS map, they are tried in the order retrieved until one matches.
Note that retrieval order usually is unspecified for multi-valued LDAP
attributes. Hence, if using indexed specifications when
\fBnisLDAPdatabaseIdMapping\fR is retrieved from LDAP, make sure that the
subset match is unambiguous.
.sp
If the \fBfieldvaluestring\fR contains white space or commas, it must either be
surrounded by double quotes, or the special characters must be escaped.
Wildcards are allowed in the \fBfieldvaluestring\fR. See Wildcards
.sp
To associate the \fBpasswd.byname\fR and \fBpasswd.byuid\fR maps with the
\fBpasswd databaseId\fR:
.sp
.in +2
.nf
passwd:passwd.byname passwd.byuid
.fi
.in -2

The \fBpasswd\fR and \fBpasswd.adjunct\fR \fBdatabaseIds\fR receive special
handling. In addition to its normal usage, \fBpasswd\fR defines which maps
\fByppasswdd\fR is to update when a \fBpasswd\fR is changed. In addition to its
normal usage \fBpasswd.adjunct\fR defines which maps \fByppasswdd\fR is to
update when an adjunct \fBpasswd\fR is changed.
.sp
You may not alias a single map name to a different name, as the results are
unpredictable.
.RE

.sp
.ne 2
.na
\fB\fBnisLDAPentryTtl\fR\fR
.ad
.sp .6
.RS 4n
Establish TTLs for NIS entries derived from LDAP.
.sp
The syntax for the \fBnisLDAPentryTtl\fR attribute is:
.sp
.in +2
.nf
mapName[" "...]":"
        initialTTLlo ":" initialTTLhi ":" runningTTL
.fi
.in -2

where
.sp
.ne 2
.na
\fB\fBinitialTTLlo\fR\fR
.ad
.RS 16n
The lower limit for the initial \fBTTL\fR (in seconds) for data read from LDAP
when the \fBypserv\fR starts. If the \fBinitialTTLhi\fR also is specified, the
actual \fBinitialTTL\fR will be randomly selected from the interval
\fBinitialTTLlo\fR to \fBinitialTTLhi\fR , inclusive. Leaving the field empty
yields the default value of 1800 seconds.
.RE

.sp
.ne 2
.na
\fB\fBinitialTTLhi\fR\fR
.ad
.RS 16n
The upper limit for the initial TTL. If left empty, defaults to 5400.
.RE

.sp
.ne 2
.na
\fB\fBrunningTTL\fR\fR
.ad
.RS 16n
The TTL (in seconds) for data retrieved from LDAP while the ypserv is running.
Leave the field empty to obtain the default value of 3600 seconds.
.RE

If there is no specification of \fBTTL\fRs for a particular map, the default
values are used.
.sp
If the \fBinitialTTLlo\fR and \fBinitialTTLhi\fR have the same value, the
effect will be that all data known to the \fBypserv\fR at startup times out at
the same time. Depending on NIS data lookup patterns, this could cause spikes
in ypserv-to-LDAP traffic. In order to avoid that, you can specify different
\fBinitialTTLlo\fR and \fBinitialTTLhi\fR values, and obtain a spread in
initial TTLs.
.sp
The following is an example of the \fBnisLDAPentryTtl\fR attribute used to
specify that entries in the NIS host maps read from LDAP should be valid for
four hours. When \fBypserv\fR restarts, the disk database entries are valid for
between two and three hours.
.sp
.in +2
.nf
hosts.byname hosts.byaddr:7200:10800:14400
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBnisLDAPobjectDN\fR\fR
.ad
.sp .6
.RS 4n
Specifies the connection between a group of NIS maps and the LDAP directory.
This attribute also defines the 'order' of the NIS maps. When NIS maps are bulk
copied to or from the DIT, they are processed in the same order as related
\fBnisLDAPobjectDN\fR attributes appear in \fB/var/yp/NISLDAPmapping.\fR
.sp
The syntax for the \fBnisLDAPobjectDN\fR\ attribute is:
.sp
.in +2
.nf
mapName[" "...] ":" objectDN *( ";" objectDN )
.fi
.in -2

where
.sp
.in +2
.nf
objectDN            = readObjectSpec [":"[writeObjectSpec]]
readObjectSpec      = [baseAndScope [filterAttrValList]]
writeObjectSpec     = [baseAndScope [attrValList]]
baseAndScope        = [baseDN] ["?" [scope]]
filterAttrValList   = ["?" [filter | attrValList]]]
scope               = "base" | "one" | "sub"
attrValList         = attribute "=" value
                            *("," attribute "=" value)
.fi
.in -2

The \fBbaseDN\fR defaults to the value of the \fBnisLDAPdomainContext\fR
attribute for the accessed domain. If the \fBbaseDN\fR ends in a comma, the
\fBnisLDAPdomainContext\fR value is appended.
.sp
\fBscope\fR defaults to one. \fBscope\fR has no meaning and is ignored in a
\fBwriteObjectSpec\fR.
.sp
The \fBfilter\fR is an LDAP search filter and has no default value.
.sp
The \fBattrValList\fR is a list of attribute and value pairs. There is no
default value.
.sp
As a convenience, if an \fBattrValList\fR is specified in a
\fBreadObjectSpec\fR, it is converted to a search filter by ANDing together the
attributes and the values. For example, the attribute and value list:
.sp
.in +2
.nf
objectClass=posixAccount,objectClass=shadowAccount
.fi
.in -2

is converted to the filter:
.sp
.in +2
.nf
(&(objectClass=posixAccount)\e
        (objectClass=shadowAccount))
.fi
.in -2

Map entries are mapped by means of the relevant mapping rules in the
\fBnisLDAPnameFields\fR and \fBnisLDAPattributeFromField\fR .
.sp
If a \fBwriteObjectSpec\fR is omitted, the effect is one of the following:
.RS +4
.TP
.ie t \(bu
.el o
If there is no trailing colon after the \fBreadObjectSpec\fR, then there is no
write at all.
.RE
.RS +4
.TP
.ie t \(bu
.el o
If there is a colon after the \fBreadObjectSpec\fR, then \fBwriteObjectSpec\fR
equals \fBreadObjectSpec\fR.
.RE
The following is an example of a \fBnisLDAPobjectDN\fR attribute declaration
that gets the \fBhosts.byaddr\fR map entries from the \fBou=Hosts\fR container
under the default search base and writes to the same place.
.sp
.in +2
.nf
hosts.byaddr:ou=Hosts,?one?objectClass=ipHost:
.fi
.in -2

The following is an example of a \fBnisLDAPobjectDN\fR attribute declaration
that obtains \fBpasswd\fR map entries from the \fBou=People\fR containers under
the default search base, and also from \fBdc=another,dc=domain\fR.
.sp
.in +2
.nf
passwd:ou=People,?one?\e
                objectClass=shadowAccount,\e
                objectClass=posixAccount:;\e
       ou=People,dc=another,dc=domain,?one?\e
                objectClass=shadowAccount,\e
                objectClass=posixAccount
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBnisLDAPnameFields\fR\fR
.ad
.sp .6
.RS 4n
Specifies the content of entries in a NIS map and how they should be broken
into named fields. \fBnisLDAPnameFields\fR is required because NIS
maps do not store information in named fields.
.sp
The syntax for the \fBnisLDAPnameFields\fR attribute is as follows:
.sp
.in +2
.nf
"nisLDAPnameFields" mapName ":" "(" matchspec "," fieldNames ")"
fieldName       = nameOrArrayName[","...]
nameOrArrayName = Name of field or 'array' of repeated fields.
matchspec       = \e" formatString \e"
.fi
.in -2

\fBformatString\fR may contains a list of \fB%s\fR and \fB%a\fR elements each
of which represents a single named field or a list of repeated fields. A
\fB%a\fR field is interpreted as an IPv4 address or an IPv6 address in
preferred format. If an IPv6 address in non preferred format is found, then it
is converted and a warning is logged.
.sp
Where there are a list of repeated fields, the entire list is stored as one
entry. The fields are broken up into individual entries, based on the internal
separator, at a latter stage. Other characters represent separators which must
be present. Any separator, including whitespace, specified by the
\fBformatString\fR, may be surrounded by a number of whitespace and tab
characters. The whitespace and tab characters are ignored.
.sp
Regardless of the content of this entry some \fBfieldNames\fR are reserved:
.sp
.ne 2
.na
\fB\fBrf_key\fR\fR
.ad
.RS 18n
The DBM key value
.RE

.sp
.ne 2
.na
\fB\fBrf_ipkey\fR\fR
.ad
.RS 18n
The DBM key value handled as an IP address. See the discussion of \fB%a\fR
fields.
.RE

.sp
.ne 2
.na
\fB\fBrf_comment\fR\fR
.ad
.RS 18n
Everything following the first occurrence of a symbol. \fBrf_comment\fR is
defined by \fBnisLDAPcommentChar\fR.
.RE

.sp
.ne 2
.na
\fB\fBrf_domain\fR\fR
.ad
.RS 18n
The name of the domain in which the current NIS operation is being carried out.
.RE

.sp
.ne 2
.na
\fB\fBrf_searchipkey\fR\fR
.ad
.RS 18n
The \fBrf_searchkey\fR value handled as an IP address. See the discussion of
\fB%a\fR fields above.
.RE

.sp
.ne 2
.na
\fB\fBrf_searchkey\fR\fR
.ad
.RS 18n
See the description under \fBnisLDAPattributeFromField\fR below.
.RE

For example, the \fBrpc.bynumber\fR map has the format:
.sp
.in +2
.nf
name number alias[" "...]
.fi
.in -2

The NIS to LDAP system is instructed to break it into a name, a number, and an
array of alias field by the following entry in the mapping file:
.sp
.in +2
.nf
nisLDAPnameFields rpc.bynumber : \e
        "%s %s %s", name,number,aliases)
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBnisLDAPsplitFields\fR\fR
.ad
.sp .6
.RS 4n
Defines how a field, or list of fields, named by \fBnisLDAPnameFields\fR is
split into subfields. The original field is compared with each line of this
attribute until one matches. When a match is found named subfields are
generated. In latter operations subfield names can be used in the same way as
other field names.
.sp
The syntax for the \fBnisLDAPsplitFields\fR attribute is as follows:
.sp
.in +2
.nf
"nisLDAPsplitFields" fieldName ":" splitSpec[","...]
splitSpec       = "(" matchspec "," subFieldNames ")"
fieldName       = Name of a field from nisLDAPnameFields
subFieldNames   = subFieldname[","...]
matchspec       = \e" formatString \e"
.fi
.in -2

The netgroup \fBmemberTriples\fR can have format \fB(host, user, domain)\fR or
\fBgroupname\fR. The format is specified by the attribute:
.sp
.in +2
.nf
nisLDAPsplitField memberTriple: \e
      ("(%s,%s,%s)", host, user, domain) , \e
      ("%s", group)
.fi
.in -2

Later operations can then use field names \fBhost\fR, \fBuser\fR, \fBdomain\fR,
\fBgroup\fR or \fBmemberTriple\fR. Because lines are processed in order, if
\fBhost\fR, \fBuser\fR and \fBdomain\fR are found, \fBgroup\fR will not be
generated.
.sp
Several maps and databaseIds may contain fields that are to be split in the
same way. As a consequence, the names of fields to be split must be unique
across all maps and databaseIds.
.sp
Only one level of spliting is supported.That is, a subfield cannot be split
into further subfields.
.RE

.sp
.ne 2
.na
\fB\fBnisLDAPrepeatedFieldSeparators\fR\fR
.ad
.sp .6
.RS 4n
Where there is a list of repeated, splitable fields,
\fBnisLDAPrepeatedFieldSeparators\fR specifies which characters separate
instances of the splitable field.
.sp
The syntax for the \fBnisLDAPrepeatedFieldSeparators\fR attribute is as
follows:
.sp
.in +2
.nf
"nisLDAPrepeatedFieldSeparators" fieldName \e"sepChar[...]\e"
sepChar = A separator character.
.fi
.in -2

The default value is space or tab. If repeated splitable fields are adjacent,
that is, there is no separating character, then the following should be
specified:
.sp
.in +2
.nf
nisLDAPrepeatedFieldSeparators netIdEntry: ""
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBnisLDAPcommentChar\fR\fR
.ad
.sp .6
.RS 4n
Specifies which character represents the start of the special comment field in
a given NIS map. If this attribute is not present then the default comment
character \fB#\fR is used.
.sp
To specify that a map uses a asterix to mark the start of comments.
.sp
.in +2
.nf
nisLDAPcommentChar mapname : '*'
.fi
.in -2

If a map cannot contain comments, then the following attribute should be
specified.
.sp
.in +2
.nf
nisLDAPcommentChar mapname : ''
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBnisLDAPmapFlags\fR\fR
.ad
.sp .6
.RS 4n
 Indicates if \fBYP_INTERDOMAIN\fR or \fBYP_SECURE\fR entries should be created
in a map. Using \fBnisLDAPmapFlags\fR is equivalent to running
\fBmakedbm\fR(1M) with the \fB-b\fR or the \fB-s\fR option. When a map is
created from the contents of the DIT, the mapping file attribute is the only
source for the \fBYP_INTERDOMAIN\fR or \fBYP_SECURE\fR entries.
.sp
The syntax for the \fBnisLDAPmapFlags\fR attribute is as follows:
.sp
.in +2
.nf
"nisLDAPmapFlags" mapname ":" ["b"]["s"]
.fi
.in -2

By default neither entry is created.
.RE

.sp
.ne 2
.na
\fB\fBnisLDAPfieldFromAttribute\fR\fR
.ad
.sp .6
.RS 4n
Specifies how a NIS entries field values are derived from LDAP attribute
values.
.sp
The syntax for the \fBnisLDAPfieldFromAttribute\fR attribute is as follows:
.sp
.in +2
.nf
mapName ":" fieldattrspec *("," fieldattrspec)
.fi
.in -2

The format of \fBfieldattrspec\fR is shown below at Field and Attribute
Conversion Syntax.
.sp
To map by direct copy and assignment the value of the \fBipHostNumber\fR
attribute to the \fBaddr\fR named field, for example:
.sp
.in +2
.nf
addr=ipHostNumber
.fi
.in -2

Formats for the named field and attribute conversion syntax are discussed
below, including examples of complex attribute to field conversions.
.RE

.sp
.ne 2
.na
\fB\fBnisLDAPattributeFromField\fR\fR
.ad
.sp .6
.RS 4n
 Specifies how an LDAP attribute value is derived from a NIS entriy field
value.
.sp
The syntax for the \fBnisLDAPattributeFromField\fR attribute is as follows:
.sp
.in +2
.nf
mapName ":" fieldattrspec *("," fieldattrspec )
.fi
.in -2

The format of \fBfieldattrspec\fR is shown below at Field and Attribute
Conversion Syntax.
.sp
As a special case, if the \fBdn\fR attribute value derived from a
\fBfieldattrspec\fR ends in a comma ("\fB,\fR"), the domains context from
\fBnisLDAPdomainContext\fR is appended.
.sp
Use the following example to map the value of the \fBaddr\fR field to the
\fBipHostNumber\fR attribute by direct copy and assignment:
.sp
.in +2
.nf
ipHostNumber=addr
.fi
.in -2

All relevant attributes, including the \fBdn\fR, must be specified.
.sp
For every map it must be possible to rapidly find a DIT entry based on its key.
There are some maps for which a NIS to LDAP mapping for the key is not
desirable, so a key mapping cannot be specified. In these cases a mapping that
uses the reserved \fBrf_searchkey\fR must be specified. Mappings that use this
field name are ignored when information is mapped into the DIT.
.RE

.SS "Field and Attribute Conversion Syntax"
.LP
The general format of a \fBfieldattrspec\fR is:
.sp
.in +2
.nf
fieldattrspec     = lhs "=" rhs
lhs               = lval | namespeclist
rhs               = rval | [namespec]
namespeclist      = namespec | "(" namespec *("," namespec) ")"
.fi
.in -2

.sp
.LP
The \fBlval\fR and \fBrval\fR syntax are defined below at Values. The format of
a \fBnamespec\fR is:
.sp
.ne 2
.na
\fB\fBnamespec\fR\fR
.ad
.RS 16n
.sp
.in +2
.nf
["ldap:"] attrspec [searchTriple] | ["yp:"] fieldname
[mapspec]
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBfieldname\fR\fR
.ad
.RS 16n
.sp
.in +2
.nf
field | "(" field ")"
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBattrspec\fR\fR
.ad
.RS 16n
.sp
.in +2
.nf
attribute | "(" attribute ")"
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBsearchTriple\fR\fR
.ad
.RS 16n
.sp
.in +2
.nf
":" [baseDN] ["?" [scope] ["?" [filter]]]
.fi
.in -2

.RE

.sp
.ne 2
.na
\fB\fBbaseDN\fR\fR
.ad
.RS 16n
Base DN for search
.RE

.sp
.ne 2
.na
\fB\fBfilter\fR\fR
.ad
.RS 16n
LDAP search filter
.RE

.sp
.ne 2
.na
\fB\fBmapspec\fR\fR
.ad
.RS 16n
Map name
.RE

.sp
.LP
The repository specification in a \fBnamespec\fR defaults is as follows:
.RS +4
.TP
.ie t \(bu
.el o
For assignments to a field:
.RS

.sp
.ne 2
.na
\fBon the \fBLHS\fR\fR
.ad
.RS 14n
yp
.RE

.sp
.ne 2
.na
\fBon the \fBRHS\fR\fR
.ad
.RS 14n
ldap
.RE

.RE

NIS field values on the \fBRHS\fR are those that exist before the NIS entry is
modified.
.RE
.RS +4
.TP
.ie t \(bu
.el o
For assignments to an attribute:
.RS

.sp
.ne 2
.na
\fBon the \fBLHS\fR\fR
.ad
.RS 14n
ldap
.RE

.sp
.ne 2
.na
\fBon the \fBRHS\fR\fR
.ad
.RS 14n
yp
.RE

.RE

Attribute values on the \fBRHS\fR are those that exist before the LDAP entry is
modified.
.RE
.sp
.LP
When the field or attribute name is enclosed in parenthesis, it denotes a list
of field or attribute values. For attributes, the meaning is the list of all
attributes of that name, and the interpretation depends on the context. See the
discussion at Values. The list specification is ignored when a
\fBsearchTriple\fR or \fBmapspec\fR is supplied.
.sp
.LP
For fields, the \fBfieldname\fR syntax is used to map multiple attribute
instances to multiple NIS entries.
.sp
.LP
The \fBsearchTriple\fR can be used to specify an attribute from a location
other than the read or write target. The defaultvalues are as follows:
.sp
.ne 2
.na
\fB\fBbaseDN\fR\fR
.ad
.RS 10n
If \fBbaseDN\fR is omitted, the default is the current \fBobjectDN\fR. If the
\fBbaseDN\fR ends in a comma, the context of the domain is appended from
\fBnisLDAPdomainContext\fR .
.RE

.sp
.ne 2
.na
\fB\fBscope\fR\fR
.ad
.RS 10n
one
.RE

.sp
.ne 2
.na
\fB\fBfilter\fR\fR
.ad
.RS 10n
Empty
.RE

.sp
.LP
Similarly, the \fBmapspec\fR can be used to specify a field value from a NIS
map other than the one implicitly indicated by the \fBmapName\fR. If
\fBsearchTriple\fR or \fBmapspec\fR is explicitly specified in a
\fBnamespec\fR, the retrieval or assignment, whether from or to LDAP or NIS, is
performed without checking if read and write are enabled for the LDAP container
or NIS map.
.sp
.LP
The omission of the \fBnamespec\fR in an \fBrhs\fR is only allowed if the
\fBlhs\fR is one or more attributes. The effect is to delete the specified
attribute(s). In all other situations, an omitted \fBnamespec\fR means that the
rule is ignored.
.sp
.LP
The \fBfilter\fR can be a value. See Values. For example, to find the
\fBipHostNumber\fRthat uses the \fBcn\fR, you specify the following in the
\fBfilter\fR field:
.sp
.in +2
.nf
ldap:ipHostNumber:?one?("cn=%s", (cname, "%s.*"))
.fi
.in -2

.sp
.LP
In order to remove ambiguity, the unmodified value of a single field or
attribute must be specified as the following when used in the \fBfilter\fR
field.
.sp
.in +2
.nf
("%s", namespec)
.fi
.in -2

.sp
.LP
If the \fBfilter\fR is not specified, the scope will be base, and the
\fBbaseDN\fR is assumed to be the \fBDN\fR of the entry that contains the
attribute to be retrieved or modified. To use previously existing field or
attribute values in the mapping rules requires a lookup to find those values.
Obviously, this adds to the time required to perform the modification. Also,
there is a window between the time when a value is retrieved and then slightly
later stored back. If the values have changed in the mean time, the change may
be overwritten.
.sp
.LP
When \fBfieldattrspecs\fR are grouped into rule sets, in the value of a
\fBnisLDAPfieldFromAttribute\fR or \fBnisLDAPattributeFromField\fR attribute,
the evaluation of the \fBfieldattrspecs\fR proceed in the listed order.
However, evaluation may be done in parallel for multiple \fBfieldattrspecs\fR.
If there is an error when evaluating a certain \fBfieldattrspec\fR, including
retrieval or assignment of entry or field values, the extent to which the other
\fBfieldattrspec\fR rules are evaluated is unspecified.
.SS "Wildcards"
.LP
Where wildcard support is available, it is of the following limited form:
.sp
.ne 2
.na
\fB\fB*\fR\fR
.ad
.RS 9n
Matches any number of characters
.RE

.sp
.ne 2
.na
\fB\fB[x]\fR\fR
.ad
.RS 9n
Matches the character x
.RE

.sp
.ne 2
.na
\fB\fB[x-y]\fR\fR
.ad
.RS 9n
Matches any character in the range x to y, inclusive
.RE

.sp
.LP
Combinations such as \fB[a-cA-C0123]\fR are also allowed, which would match any
one of a, b, c, A, B, C, 0, 1, 2, or 3.
.SS "Substring Extraction"
.in +2
.nf
substringextract = "(" namespec "," matchspec ")"
name             = field or attribute name
matchspec        =
.fi
.in -2

.sp
.LP
The \fBmatchspec\fR is a string like the \fBsscanf\fR(3C) format string, except
that there may be at most one format specifier, a single \fB%s\fR. The output
value of the \fBsubstringextract\fR is the substring that matches the location
of the \fB%s\fR.
.sp
.LP
If there is no \fB%s\fR in the formatstring, it must instead be a single
character, which is assumed to be a field separator for the \fBnamespec\fR. The
output values are the field values. Wild cards are supported. If there is no
match, the output value is the empty string, " ".
.sp
.LP
For example, if the \fBfieldcname\fR has the value
\fBuser.some.domain.name.\fR, the value of the expression:
.sp
.in +2
.nf
(cname, "%s.*")
.fi
.in -2

.sp
.LP
is \fBuser\fR, which can be used to extract the user name from a NIS principal
name.
.sp
.LP
Similarly, use this expression to extract the third of the colon-separated
fields of the shadow field:
.sp
.in +2
.nf
(shadow, "*:*:%s:*")
.fi
.in -2

.sp
.LP
This form can be used to extract all of the shadow fields. However, a simpler
way to specify that special case is:
.sp
.in +2
.nf
(shadow, ":")
.fi
.in -2

.SS "Values"
.in +2
.nf
lval            = "(" formatspec "," namespec *("," namespec) ")"
rval            = "(" formatspec ["," namelist ["," elide] ] ")"

namelist        = name_or_sse *( "," name_or_sse)
name_or_sse     = namespec | removespec | substringextract
removespec      = list_or_name "-" namespec
list_or_name    = "(" namespec ")" | namespec
formatspec      =
formatstring    = A string combining text and % field specifications
elide           =
singlechar      = Any character
.fi
.in -2

.sp
.LP
The syntax above is used to produce \fBrval\fR values that incorporate field or
attribute values, in a manner like \fBsprintf\fR(3C), or to perform assignments
to \fBlval\fR like \fBsscanf\fR(3C). One important restriction is that the
format specifications,\fB%\fR plus a single character, use the designations
from \fBber_printf\fR(3LDAP). Thus, while \fB%s\fR is used to extract a string
value, \fB%i\fR causes BER conversion from an integer. Formats other than
\fB%s\fR, for instance, \fB%i\fR, are only meaningfully defined in simple
format strings without any other text.
.sp
.LP
The following \fBber_printf()\fR format characters are recognized:
.sp
.in +2
.nf
b  i  n  o  s
.fi
.in -2

.sp
.LP
If there are too few format specifiers, the format string may be repeated as
needed.
.sp
.LP
When used as an \fBlval\fR, there is a combination of pattern matching and
assignment, possibly to multiple fields or attributes.
.sp
.LP
In an assignment to an attribute, if the value of the \fBaddr\fR field is
\fB1.2.3.4\fR, the \fBrval\fR:
.sp
.in +2
.nf
("ipNetworkNumber=%s,", addr)
.fi
.in -2

.sp
.LP
produces the value \fBipNetworkNumber=1.2.3.4,\fR, while:
.sp
.in +2
.nf
("(%s,%s,%s)", host, user, domain)
.fi
.in -2

.sp
.LP
results in:
.sp
.in +2
.nf
(assuming host="xyzzy", user="-", domain="x.y.z")
"(xyzzy,-,x.y.z)"
.fi
.in -2

.sp
.LP
The elide character feature is used with attribute lists. So:
.sp
.in +2
.nf
("%s,", (mgrprfc822mailmember), ",")
.fi
.in -2

.sp
.LP
concatenates all \fBmgrprfc822mailmember\fR values into one comma-separated
string, and then elides the final trailing comma. Thus, for
.sp
.in +2
.nf
mgrprfc822mailmember=usera
mgrprfc822mailmember=userb
mgrprfc822mailmember=userc
.fi
.in -2

.sp
.LP
the value would be:
.sp
.in +2
.nf
usera,userb,userc
.fi
.in -2

.sp
.LP
As a special case, to combine an \fBLHS\fR extraction with an \fBRHS\fR
implicit list creates multiple entries and values. So
.sp
.in +2
.nf
("(%s,%s,%s)", host, user, domain)=(nisNetgroupTriple)
.fi
.in -2

.sp
.LP
creates one NIS entry for each \fBnisNetgroupTriple\fR value.
.sp
.LP
The \fB\&'removespec'\fR form is used to exclude previously assigned fields
values from a list. So, if an LDAP entry contains:
.sp
.in +2
.nf
name: foo
cn: foo
cn: foo1
cn: foo2
.fi
.in -2

.sp
.LP
and the mapping file specifies :
.sp
.in +2
.nf
myName = name, \e
myAliases = ("%s ", (cn) - yp:myName, " ")
.fi
.in -2

.sp
.LP
then the following assignments are carried out:
.RS +4
.TP
1.
Assign value \fBfoo\fR to \fBmyName\fR
.RE
.RS +4
.TP
2.
Assign value \fBfoo foo1 foo2\fR to \fBmyAliases\fR
.RE
.RS +4
.TP
3.
Remove value of \fBmyName\fR from value \fBmyAliases\fR
.RE
.sp
.LP
This results in the field values \fBmyName\fR is set to \fBfoo\fR, and
\fBmyAliases\fR is set to \fBfoo1 foo2\fR.
.SS "Assignments"
.LP
The assignment syntax, also found at Field and Attribute Conversion Syntax, is
as follows:
.sp
.in +2
.nf
fieldattrspec    = lhs "=" rhs
lhs              = lval | namespeclist
rhs              = rval | namespec
namespeclist     = namespec | "(" namespec *("," namespec) ")"
.fi
.in -2

.sp
.LP
The general form of a simple assignment, which is a one-to-one mapping of field
to attribute, is:
.sp
.in +2
.nf
("%s", fieldname)=("%s", attrname)
.fi
.in -2

.sp
.LP
As a convenient shorthand, this can also be written as:
.sp
.in +2
.nf
fieldname=attrname
.fi
.in -2

.sp
.LP
A list specification, which is a name enclosed in parenthesis, can be used to
make many-to-many assignments. The expression:
.sp
.in +2
.nf
(fieldname)=(attrname)
.fi
.in -2

.sp
.LP
where there are multiple instances of \fBattrname\fR, creates one NIS entry for
each such instance, differentiated by their \fBfieldname\fR values. The
following combinations of lists are allowed, but they are not particularly
useful:
.sp
.ne 2
.na
\fB\fB(attrname)=(fieldname)\fR\fR
.ad
.RS 26n
Equivalent to \fBattrname=fieldname\fR
.RE

.sp
.ne 2
.na
\fB\fBattrname=(fieldname)\fR\fR
.ad
.RS 26n
Equivalent to \fBattrname=fieldname\fR
.RE

.sp
.ne 2
.na
\fB\fB(fieldname)=attrname\fR\fR
.ad
.RS 26n
Equivalent to \fBfieldname=attrname\fR
.RE

.sp
.ne 2
.na
\fB\fBfieldname=(attrname)\fR\fR
.ad
.RS 26n
Equivalent to \fBfieldname=attrname\fR
.RE

.sp
.LP
If a multi-valued \fBRHS\fR is assigned to a single-valued \fBLHS\fR, the
\fBLHS\fR value will be the first of the \fBRHS\fR values. If the \fBRHS\fR is
an attribute list, the first attribute is the first one returned by the LDAP
server when queried. Otherwise, the definition of "first"is implementation
dependent.
.sp
.LP
Finally, the \fBLHS\fR can be an explicit list of fields or attributes, such
as:
.sp
.in +2
.nf
(name1,name2,name3)
.fi
.in -2

.sp
.LP
If the \fBRHS\fR is single-valued, this assigns the \fBRHS\fR value to all
entities in the list. If the \fBRHS\fR is multi-valued, the first value is
assigned to the first entity of the list, the second value to the second
entity, and so on. Excess values or entities are silently ignored.
.SH EXAMPLES
.LP
\fBExample 1 \fRAssigning an Attribute Value to a Field
.sp
.LP
The following example illustrates how to assign the value of the
\fBipHostNumber\fR attribute to the \fBaddr\fR field

.sp
.in +2
.nf
addr=ipHostNumber
.fi
.in -2

.LP
\fBExample 2 \fRCreating Multiple NIS Entries from Multi-Valued LDAP Attributes
.sp
.LP
An LDAP entry with:

.sp
.in +2
.nf
cn=name1
cn=name2
cn=name3
.fi
.in -2

.sp
.LP
and the following assignments:

.sp
.in +2
.nf
cname=cn
(name)=(cn)
.fi
.in -2

.sp
.LP
creates three NIS entries. Other attributes and fields are omitted for clarity.

.sp
.in +2
.nf
cname=name1, name=name1
cname=name1, name=name2
cname=name1, name=name3
.fi
.in -2

.LP
\fBExample 3 \fRAssigning String Constants
.sp
.LP
The following expression sets the \fBpasswd\fR field to x:

.sp
.in +2
.nf
passwd=("x")
.fi
.in -2

.LP
\fBExample 4 \fRSplitting Field Values to Multi-Valued Attributes
.sp
.LP
The \fBexpansion\fR field contains a comma-separated list of alias member
names. In the following example, the expression assigns each member name to an
instance of \fBmgrprfc822mailmember\fR:

.sp
.in +2
.nf
(mgrprfc822mailmember)=(expansion, ",")
.fi
.in -2

.SH FILES
.ne 2
.na
\fB\fB/var/yp/NISLDAPmapping\fR\fR
.ad
.RS 26n
Mapping file used by the NIS server components
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability 	Obsolete
.TE

.SH SEE ALSO
.LP
\fBinityp2l\fR(1M), \fBmakedbm\fR(1M), \fBypserv\fR(1M),
\fBber_printf\fR(3LDAP), \fBsprintf\fR(3C), \fBsscanf\fR(3C),
\fBypserv\fR(4), \fBattributes\fR(5)
.sp
.LP
\fISystem Administration Guide: Naming and Directory Services (DNS, NIS, and
LDAP)\fR