2 # Makefile for the NIS databases
6 # This Makefile should only be run on the NIS master server of a domain.
7 # All updated maps will be pushed to all NIS slave servers listed in the
8 # /var/yp/ypservers file. Please make sure that the hostnames of all
9 # NIS servers in your domain are listed in /var/yp/ypservers.
11 # This Makefile can be modified to support more NIS maps if desired.
14 # If this machine is an NIS master, reset this variable (NOPUSH=)
15 # in Makefile.local so that changes to the NIS maps can be propagated to
16 # the slave servers. (By default we assume that we are only serving a
17 # small domain with only one server.)
21 # If this machine does not wish to generate a linux-style shadow map
22 # from the master.passwd file, reset this variable (SHADOW=) in
26 # If you want to use a FreeBSD NIS server to serve non-FreeBSD clients
27 # (i.e. clients who expect the password field in the passwd maps to be
28 # valid) then set this variable (UNSECURE="True") in Makefile.local.
29 # This will cause $YPDIR/passwd to be generated with valid password
30 # fields. This is insecure: FreeBSD normally only serves the
31 # master.passwd and shadow maps (which have real encrypted passwords
32 # in them) to the superuser on other FreeBSD machines, but non-FreeBSD
33 # clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX, etc...)
34 # will only work properly in 'unsecure' mode.
38 # The following line encodes the YP_INTERDOMAIN key into the hosts.byname
39 # and hosts.byaddr maps so that ypserv(8) will do DNS lookups to resolve
40 # hosts not in the current domain. Resetting this variable in
41 # Makefile.local (B=) will disable the DNS lookups.
44 # Normally, the master.passwd.* and shadow.* maps are guarded against access
45 # from non-privileged users. By resetting S in Makefile.local (S=), the
46 # YP_SECURE key will be removed from these maps, allowing anyone to access
50 # These are commands which this Makefile needs to properly rebuild the
51 # NIS databases. Don't change these unless you have a good reason. Also
52 # be sure not to place an @ in front of /usr/bin/awk: it isn't necessary
53 # and it'll break everything in sight.
60 MKDB = /usr/sbin/yp_mkdb
61 DBLOAD = $(MKDB) -m `hostname`
62 MKNETID = /usr/libexec/mknetid
63 NEWALIASES = /usr/bin/newaliases
64 YPPUSH = /usr/sbin/yppush
65 .if !defined(UPDATE_DOMAIN)
66 DOMAIN = `/bin/domainname`
68 DOMAIN = $(UPDATE_DOMAIN)
70 REVNETGROUP = /usr/libexec/revnetgroup
73 # It is advisable to create a separate directory to contain the
74 # source files used to generate your NIS maps. If you intend to
75 # support multiple domains, something like /src/dir/$DOMAIN
83 YPMAPDIR = $(YPDIR)/$(DOMAIN)
85 # These are the files from which the NIS databases are built. You may edit
86 # these to taste in the event that you wish to keep your NIS source files
87 # separate from your NIS server's actual configuration files. Note that the
88 # NIS passwd and master.passwd files are stored in /var/yp: the server's
89 # real password database is not used by default. However, you may use
90 # the real /etc/passwd and /etc/master.passwd files by:
93 # - invoking yppasswdd with `-t /etc/master.passwd' (yppasswdd will do a
94 # 'pwd_mkdb' as needed if /etc/master.passwd is thus specified).
95 # - Specifying the location of the master.passwd file using the
96 # MASTER_PASSWD variable, i.e.:
98 # # make MASTER_PASSWD=/path/to/some/other/master.passwd
100 # - (optionally): editing this Makefile to change the default location.
102 # To add a user, edit $(YPDIR)/master.passwd and type 'make'. The raw
103 # passwd file will be generated from the master.passwd file automagically.
105 ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd)
106 BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
107 HOSTS = $(YPSRCDIR)/hosts
108 IPNODES = $(YPDIR)/ipnodes
109 NETWORKS = $(YPSRCDIR)/networks
110 PROTOCOLS = $(YPSRCDIR)/protocols
111 RPC = $(YPSRCDIR)/rpc
112 SERVICES = $(YPSRCDIR)/services
113 SHELLS = $(YPSRCDIR)/shells
114 GROUP = $(YPSRCDIR)/group
115 ALIASES = $(YPSRCDIR)/mail/aliases
116 NETGROUP = $(YPDIR)/netgroup
117 PASSWD = $(YPDIR)/passwd
118 .if !defined(MASTER_PASSWD)
119 MASTER = $(YPDIR)/master.passwd
121 MASTER = $(MASTER_PASSWD)
123 YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain
124 PUBLICKEY = $(YPSRCDIR)/publickey
125 NETID = $(YPSRCDIR)/netid
126 AMDHOST = $(YPSRCDIR)/amd.map
129 @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
130 cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \
131 make -f ../Makefile all; echo "NIS Map update completed."
133 # Read overrides. Note, the current directory will be /var/yp/<domain>
134 # when 'all' is built.
135 .if exists(${YPDIR}/Makefile.local)
136 .include "${YPDIR}/Makefile.local"
139 # List of maps that are always built.
140 # If you want to omit some of them, feel free to comment
141 # them out from this list.
142 TARGETS= servers hosts networks protocols rpc services shells group
146 # Sanity checks: filter out targets we can't build
147 # Note that we don't build the ethers or boorparams maps by default
148 # since /etc/ethers and /etc/bootparams are not likely to be present
150 .if exists($(ETHERS))
156 .if exists($(BOOTPARAMS))
159 BOOTPARAMS= /dev/null
162 .if exists($(NETGROUP))
168 .if exists($(MASTER))
169 TARGETS+= passwd master.passwd netid
170 .if ${SHADOW} == "\"True\""
178 .if exists($(PUBLICKEY))
184 .if exists($(AMDHOST))
190 .if !exists($(IPNODES))
196 ethers: ethers.byname ethers.byaddr
197 bootparam: bootparams
198 hosts: hosts.byname hosts.byaddr
199 ipnodes: ipnodes.byname ipnodes.byaddr
200 networks: networks.byaddr networks.byname
201 protocols: protocols.bynumber protocols.byname
202 rpc: rpc.byname rpc.bynumber
203 services: services.byname
204 passwd: passwd.byname passwd.byuid
205 shadow: shadow.byname shadow.byuid
206 group: group.byname group.bygid
210 publickey: publickey.byname
211 aliases: mail.aliases
213 master.passwd: master.passwd.byname master.passwd.byuid
216 # This is a special target used only when doing in-place updates with
217 # rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd
218 # server and won't need to be remade. They will have to be pushed to the
219 # slaves however. Calling this target implicitly insures that this will
224 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi
225 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi
226 .if ${SHADOW} == "\"True\""
227 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byname ; fi
228 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byuid ; fi
230 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi
231 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi
234 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $(PUSHMAP) ; fi
238 @echo " ********WARNING********"
239 @echo " Couldn't find the master.passwd source file. This file"
240 @echo " is needed to generate the master.passwd and passwd maps."
241 @echo " The default location is /var/yp/master.passwd. You should"
242 @echo " edit /var/yp/Makefile and set the MASTER variable to point"
243 @echo " to the source file you wish to use for building the passwd"
244 @echo " maps, or else invoke make(1) in the following manner:"
246 @echo " make MASTER_PASSWD=/path/to/master.passwd"
249 mail.aliases: $(ALIASES)
250 @echo "Updating $@..."
251 @$(NEWALIASES) -oA$(ALIASES)
252 @$(MKDB) -u $(ALIASES).db \
253 | $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP); \
256 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
257 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
260 ypservers: $(YPSERVERS)
261 @echo "Updating $@..."
262 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
264 | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \
267 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
268 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
270 ethers.byname: $(ETHERS)
271 @echo "Updating $@..."
272 .if ${ETHERS} == "/dev/null"
273 @echo "Ethers source file not found -- skipping"
275 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
276 print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
277 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
279 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
280 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
283 ethers.byaddr: $(ETHERS)
284 @echo "Updating $@..."
285 .if ${ETHERS} == "/dev/null"
286 @echo "Ethers source file not found -- skipping"
288 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
289 print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
290 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
292 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
293 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
297 bootparams: $(BOOTPARAMS)
298 @echo "Updating $@..."
299 .if ${BOOTPARAMS} == "/dev/null"
300 @echo "Bootparams source file not found -- skipping"
302 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
303 print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -i $(BOOTPARAMS) \
304 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
306 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
307 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
311 netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
312 @echo "Updating $@..."
313 .if ${NETGROUP} == "/dev/null"
314 @echo "Netgroup source file not found -- skipping"
316 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
317 print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
318 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
320 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
321 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
325 netgroup.byhost: $(NETGROUP)
326 @echo "Updating $@..."
327 .if ${NETGROUP} == "/dev/null"
328 @echo "Netgroup source file not found -- skipping"
330 @$(REVNETGROUP) -h -f $(NETGROUP) | \
331 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
332 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
333 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
335 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
336 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
340 netgroup.byuser: $(NETGROUP)
341 @echo "Updating $@..."
342 .if ${NETGROUP} == "/dev/null"
343 @echo "Netgroup source file not found -- skipping"
345 @$(REVNETGROUP) -u -f $(NETGROUP) | \
346 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
347 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
348 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
350 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
351 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
355 # Solaris 8 does the following:
356 # - /etc/hosts and hosts.{byname,byaddr} are IPv4 only.
357 # - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol
358 # independent name-to-address mapping.
360 # For local name resolution, we made /etc/hosts protocol independent.
361 # For NIS name resolution, we obey Solaris 8 practice.
362 # - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8
364 # - ipnodes.{byname,byaddr} is used for protocol independent mapping.
365 # We generate all the mappings from /etc/hosts unless /var/yp/ipnodes
366 # exists, for compatibility with FreeBSD local name resolution.
368 hosts.byname: $(HOSTS)
369 @echo "Updating $@..."
370 @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
371 print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \
372 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
374 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
375 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
378 hosts.byaddr: $(HOSTS)
379 @echo "Updating $@..."
380 @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \
381 | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \
384 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
385 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
388 ipnodes.byname: $(IPNODES)
389 @echo "Updating $@..."
390 @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
391 print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \
392 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
394 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
395 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
398 ipnodes.byaddr: $(IPNODES)
399 @echo "Updating $@..."
400 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \
401 | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \
404 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
405 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
408 networks.byname: $(NETWORKS)
409 @echo "Updating $@..."
411 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
412 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
415 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
418 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
419 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
422 networks.byaddr: $(NETWORKS)
423 @echo "Updating $@..."
424 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(NETWORKS) \
425 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
428 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
429 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
432 protocols.byname: $(PROTOCOLS)
433 @echo "Updating $@..."
435 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
436 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
438 }' $(PROTOCOLS) | $(DBLOAD) -i $(PROTOCOLS) \
439 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
441 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
442 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
445 protocols.bynumber: $(PROTOCOLS)
446 @echo "Updating $@..."
447 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(PROTOCOLS) \
448 | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP); \
451 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
452 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
456 @echo "Updating $@..."
458 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
459 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
461 }' $(RPC) | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
464 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
465 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
469 @echo "Updating $@..."
470 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(RPC) \
471 | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
474 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
475 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
478 services.byname: $(SERVICES)
479 @echo "Updating $@..."
481 '$$1 !~ "^#.*" { for (n=1; n<=NF && $$n !~ "^#.*"; n++) { \
482 if (split($$2, t, "/")) { \
483 printf("%s/%s", $$n, t[2]) }; \
486 } ; print $$2"\t"$$0 ; \
488 | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \
491 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
492 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
495 @echo "Updating $@..."
496 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
498 | $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \
501 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
502 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
504 publickey.byname: $(PUBLICKEY)
505 @echo "Updating $@..."
506 .if ${PUBLICKEY} == "/dev/null"
507 @echo "Publickey source file not found -- skipping"
509 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $(PUBLICKEY) \
510 | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP); \
513 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
514 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
519 @echo "Creating new $@ file from $(MASTER)..."
520 @if [ ! $(UNSECURE) ]; then \
521 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
522 print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
525 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
526 print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
530 passwd.byname: $(PASSWD)
531 @echo "Updating $@..."
532 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
533 print $$1"\t"$$0 }' $(PASSWD) \
534 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
537 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
538 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
541 passwd.byuid: $(PASSWD)
542 @echo "Updating $@..."
543 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
544 print $$3"\t"$$0 }' $(PASSWD) \
545 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
548 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
549 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
552 group.byname: $(GROUP)
553 @echo "Updating $@..."
554 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
555 print $$1"\t"$$0 }' $(GROUP) \
556 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
559 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
560 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
563 group.bygid: $(GROUP)
564 @echo "Updating $@..."
565 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
566 print $$3"\t"$$0 }' $(GROUP) \
567 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
570 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
571 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
574 netid.byname: $(GROUP) $(PASSWD) $(HOSTS)
575 @echo "Updating $@..."
576 @$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \
577 -d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP); \
580 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
581 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
584 master.passwd.byname: $(MASTER)
585 @echo "Updating $@..."
586 .if ${MASTER} == "/dev/null"
587 @echo "Master.passwd source file not found -- skipping"
589 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
590 print $$1"\t"$$0 }' $(MASTER) \
591 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
594 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
595 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
599 master.passwd.byuid: $(MASTER)
600 @echo "Updating $@..."
601 .if ${MASTER} == "/dev/null"
602 @echo "Master.passwd source file not found -- skipping"
604 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
605 print $$3"\t"$$0 }' $(MASTER) \
606 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
609 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
610 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
614 shadow.byname: $(MASTER)
615 @echo "Updating $@..."
616 .if ${MASTER} == "/dev/null"
617 @echo "Master.passwd source file not found -- skipping"
619 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
620 print $$1"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
621 | sed 's/\( [^:]*:\)\*:/\1!:/' \
622 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
625 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
626 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
629 shadow.byuid: $(MASTER)
630 @echo "Updating $@..."
631 .if ${MASTER} == "/dev/null"
632 @echo "Master.passwd source file not found -- skipping"
634 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
635 print $$3"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
636 | sed 's/\( [^:]*:\)\*:/\1!:/' \
637 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
640 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
641 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
645 @echo "Updating $@..."
646 @$(AWK) '$$1 !~ "^#.*" { \
647 for (i = 1; i <= NF; i++) \
649 if (substr($$i, length($$i), 1) == "\\") \
650 printf("%s", substr($$i, 1, length($$i) - 1)); \
652 printf("%s\n", $$i); \
655 printf("%s ", $$i); \
657 $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP); \
660 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
661 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi