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 EUI64 = $(YPSRCDIR)/eui64 # eui64 addresses (for firewire)
107 BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
108 HOSTS = $(YPSRCDIR)/hosts
109 IPNODES = $(YPDIR)/ipnodes
110 NETWORKS = $(YPSRCDIR)/networks
111 PROTOCOLS = $(YPSRCDIR)/protocols
112 RPC = $(YPSRCDIR)/rpc
113 SERVICES = $(YPSRCDIR)/services
114 SHELLS = $(YPSRCDIR)/shells
115 GROUP = $(YPSRCDIR)/group
116 ALIASES = $(YPSRCDIR)/mail/aliases
117 NETGROUP = $(YPDIR)/netgroup
118 PASSWD = $(YPDIR)/passwd
119 .if !defined(MASTER_PASSWD)
120 MASTER = $(YPDIR)/master.passwd
122 MASTER = $(MASTER_PASSWD)
124 YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain
125 PUBLICKEY = $(YPSRCDIR)/publickey
126 NETID = $(YPSRCDIR)/netid
127 AMDHOST = $(YPSRCDIR)/amd.map
130 @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
131 cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \
132 make -f ../Makefile all; echo "NIS Map update completed."
134 # Read overrides. Note, the current directory will be /var/yp/<domain>
135 # when 'all' is built.
136 .if exists(${YPDIR}/Makefile.local)
137 .include "${YPDIR}/Makefile.local"
140 # List of maps that are always built.
141 # If you want to omit some of them, feel free to comment
142 # them out from this list.
143 TARGETS= servers hosts networks protocols rpc services shells group
147 # Sanity checks: filter out targets we can't build
148 # Note that we don't build the ethers, eui64, or boorparams maps by default
149 # since /etc/ethers, /etc/eui64 and /etc/bootparams are not likely to be present
151 .if exists($(ETHERS))
163 .if exists($(BOOTPARAMS))
166 BOOTPARAMS= /dev/null
169 .if exists($(NETGROUP))
175 .if exists($(MASTER))
176 TARGETS+= passwd master.passwd netid
177 .if ${SHADOW} == "\"True\""
185 .if exists($(PUBLICKEY))
191 .if exists($(AMDHOST))
197 .if !exists($(IPNODES))
203 ethers: ethers.byname ethers.byaddr
204 eui64: eui64.byname eui64.byid
205 bootparam: bootparams
206 hosts: hosts.byname hosts.byaddr
207 ipnodes: ipnodes.byname ipnodes.byaddr
208 networks: networks.byaddr networks.byname
209 protocols: protocols.bynumber protocols.byname
210 rpc: rpc.byname rpc.bynumber
211 services: services.byname
212 passwd: passwd.byname passwd.byuid
213 shadow: shadow.byname shadow.byuid
214 group: group.byname group.bygid
218 publickey: publickey.byname
219 aliases: mail.aliases
221 master.passwd: master.passwd.byname master.passwd.byuid
224 # This is a special target used only when doing in-place updates with
225 # rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd
226 # server and won't need to be remade. They will have to be pushed to the
227 # slaves however. Calling this target implicitly insures that this will
232 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi
233 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi
234 .if ${SHADOW} == "\"True\""
235 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byname ; fi
236 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byuid ; fi
238 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi
239 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi
242 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $(PUSHMAP) ; fi
246 @echo " ********WARNING********"
247 @echo " Couldn't find the master.passwd source file. This file"
248 @echo " is needed to generate the master.passwd and passwd maps."
249 @echo " The default location is /var/yp/master.passwd. You should"
250 @echo " edit /var/yp/Makefile and set the MASTER variable to point"
251 @echo " to the source file you wish to use for building the passwd"
252 @echo " maps, or else invoke make(1) in the following manner:"
254 @echo " make MASTER_PASSWD=/path/to/master.passwd"
257 mail.aliases: $(ALIASES)
258 @echo "Updating $@..."
259 @$(NEWALIASES) -oA$(ALIASES)
260 @$(MKDB) -u $(ALIASES).db \
261 | $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP); \
264 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
265 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
268 ypservers: $(YPSERVERS)
269 @echo "Updating $@..."
270 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
272 | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \
275 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
276 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
278 ethers.byname: $(ETHERS)
279 @echo "Updating $@..."
280 .if ${ETHERS} == "/dev/null"
281 @echo "Ethers source file not found -- skipping"
283 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
284 print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
285 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
287 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
288 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
291 ethers.byaddr: $(ETHERS)
292 @echo "Updating $@..."
293 .if ${ETHERS} == "/dev/null"
294 @echo "Ethers source file not found -- skipping"
296 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
297 print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
298 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
300 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
301 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
304 eui64.byname: $(EUI64)
305 @echo "Updating $@..."
306 .if ${EUI64} == "/dev/null"
307 @echo "EUI64 source file not found -- skipping"
309 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
310 print $$2"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \
311 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
313 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
314 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
318 @echo "Updating $@..."
319 .if ${EUI64} == "/dev/null"
320 @echo "EUI64 source file not found -- skipping"
322 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
323 print $$1"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \
324 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
326 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
327 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
331 bootparams: $(BOOTPARAMS)
332 @echo "Updating $@..."
333 .if ${BOOTPARAMS} == "/dev/null"
334 @echo "Bootparams source file not found -- skipping"
336 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
337 print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -i $(BOOTPARAMS) \
338 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
340 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
341 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
345 netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
346 @echo "Updating $@..."
347 .if ${NETGROUP} == "/dev/null"
348 @echo "Netgroup source file not found -- skipping"
350 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
351 print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
352 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
354 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
355 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
359 netgroup.byhost: $(NETGROUP)
360 @echo "Updating $@..."
361 .if ${NETGROUP} == "/dev/null"
362 @echo "Netgroup source file not found -- skipping"
364 @$(REVNETGROUP) -h -f $(NETGROUP) | \
365 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
366 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
367 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
369 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
370 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
374 netgroup.byuser: $(NETGROUP)
375 @echo "Updating $@..."
376 .if ${NETGROUP} == "/dev/null"
377 @echo "Netgroup source file not found -- skipping"
379 @$(REVNETGROUP) -u -f $(NETGROUP) | \
380 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
381 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
382 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
384 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
385 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
389 # Solaris 8 does the following:
390 # - /etc/hosts and hosts.{byname,byaddr} are IPv4 only.
391 # - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol
392 # independent name-to-address mapping.
394 # For local name resolution, we made /etc/hosts protocol independent.
395 # For NIS name resolution, we obey Solaris 8 practice.
396 # - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8
398 # - ipnodes.{byname,byaddr} is used for protocol independent mapping.
399 # We generate all the mappings from /etc/hosts unless /var/yp/ipnodes
400 # exists, for compatibility with FreeBSD local name resolution.
402 hosts.byname: $(HOSTS)
403 @echo "Updating $@..."
404 @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
405 print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \
406 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
408 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
409 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
412 hosts.byaddr: $(HOSTS)
413 @echo "Updating $@..."
414 @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \
415 | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \
418 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
419 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
422 ipnodes.byname: $(IPNODES)
423 @echo "Updating $@..."
424 @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
425 print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \
426 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
428 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
429 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
432 ipnodes.byaddr: $(IPNODES)
433 @echo "Updating $@..."
434 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \
435 | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \
438 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
439 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
442 networks.byname: $(NETWORKS)
443 @echo "Updating $@..."
445 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
446 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
449 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
452 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
453 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
456 networks.byaddr: $(NETWORKS)
457 @echo "Updating $@..."
458 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(NETWORKS) \
459 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
462 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
463 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
466 protocols.byname: $(PROTOCOLS)
467 @echo "Updating $@..."
469 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
470 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
472 }' $(PROTOCOLS) | $(DBLOAD) -i $(PROTOCOLS) \
473 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
475 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
476 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
479 protocols.bynumber: $(PROTOCOLS)
480 @echo "Updating $@..."
481 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(PROTOCOLS) \
482 | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP); \
485 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
486 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
490 @echo "Updating $@..."
492 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
493 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
495 }' $(RPC) | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
498 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
499 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
503 @echo "Updating $@..."
504 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(RPC) \
505 | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
508 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
509 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
512 services.byname: $(SERVICES)
513 @echo "Updating $@..."
515 '$$1 !~ "^#.*" { for (n=1; n<=NF && $$n !~ "^#.*"; n++) { \
516 if (split($$2, t, "/")) { \
517 printf("%s/%s", $$n, t[2]) }; \
520 } ; print $$2"\t"$$0 ; \
522 | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \
525 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
526 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
529 @echo "Updating $@..."
530 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
532 | $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \
535 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
536 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
538 publickey.byname: $(PUBLICKEY)
539 @echo "Updating $@..."
540 .if ${PUBLICKEY} == "/dev/null"
541 @echo "Publickey source file not found -- skipping"
543 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $(PUBLICKEY) \
544 | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP); \
547 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
548 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
553 @echo "Creating new $@ file from $(MASTER)..."
554 @if [ ! $(UNSECURE) ]; then \
555 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
556 print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
559 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
560 print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
564 passwd.byname: $(PASSWD)
565 @echo "Updating $@..."
566 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
567 print $$1"\t"$$0 }' $(PASSWD) \
568 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
571 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
572 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
575 passwd.byuid: $(PASSWD)
576 @echo "Updating $@..."
577 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
578 print $$3"\t"$$0 }' $(PASSWD) \
579 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
582 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
583 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
586 group.byname: $(GROUP)
587 @echo "Updating $@..."
588 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
589 print $$1"\t"$$0 }' $(GROUP) \
590 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
593 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
594 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
597 group.bygid: $(GROUP)
598 @echo "Updating $@..."
599 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
600 print $$3"\t"$$0 }' $(GROUP) \
601 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
604 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
605 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
608 netid.byname: $(GROUP) $(PASSWD) $(HOSTS)
609 @echo "Updating $@..."
610 @$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \
611 -d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP); \
614 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
615 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
618 master.passwd.byname: $(MASTER)
619 @echo "Updating $@..."
620 .if ${MASTER} == "/dev/null"
621 @echo "Master.passwd source file not found -- skipping"
623 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
624 print $$1"\t"$$0 }' $(MASTER) \
625 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
628 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
629 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
633 master.passwd.byuid: $(MASTER)
634 @echo "Updating $@..."
635 .if ${MASTER} == "/dev/null"
636 @echo "Master.passwd source file not found -- skipping"
638 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
639 print $$3"\t"$$0 }' $(MASTER) \
640 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
643 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
644 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
648 shadow.byname: $(MASTER)
649 @echo "Updating $@..."
650 .if ${MASTER} == "/dev/null"
651 @echo "Master.passwd source file not found -- skipping"
653 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
654 print $$1"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
655 | sed 's/\( [^:]*:\)\*:/\1!:/' \
656 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
659 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
660 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
663 shadow.byuid: $(MASTER)
664 @echo "Updating $@..."
665 .if ${MASTER} == "/dev/null"
666 @echo "Master.passwd source file not found -- skipping"
668 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
669 print $$3"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
670 | sed 's/\( [^:]*:\)\*:/\1!:/' \
671 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
674 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
675 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
679 @echo "Updating $@..."
680 @$(AWK) '$$1 !~ "^#.*" { \
681 for (i = 1; i <= NF; i++) \
683 if (substr($$i, length($$i), 1) == "\\") \
684 printf("%s", substr($$i, 1, length($$i) - 1)); \
686 printf("%s\n", $$i); \
689 printf("%s ", $$i); \
691 $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP); \
694 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
695 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi