2 # Makefile for the NIS databases
5 # This Makefile should only be run on the NIS master server of a domain.
6 # All updated maps will be pushed to all NIS slave servers listed in the
7 # /var/yp/ypservers file. Please make sure that the hostnames of all
8 # NIS servers in your domain are listed in /var/yp/ypservers.
10 # This Makefile can be modified to support more NIS maps if desired.
13 # If this machine is an NIS master, reset this variable (NOPUSH=)
14 # in Makefile.local so that changes to the NIS maps can be propagated to
15 # the slave servers. (By default we assume that we are only serving a
16 # small domain with only one server.)
20 # If this machine does not wish to generate a linux-style shadow map
21 # from the master.passwd file, reset this variable (SHADOW=) in
25 # If you want to use a FreeBSD NIS server to serve non-FreeBSD clients
26 # (i.e. clients who expect the password field in the passwd maps to be
27 # valid) then set this variable (UNSECURE="True") in Makefile.local.
28 # This will cause $YPDIR/passwd to be generated with valid password
29 # fields. This is insecure: FreeBSD normally only serves the
30 # master.passwd and shadow maps (which have real encrypted passwords
31 # in them) to the superuser on other FreeBSD machines, but non-FreeBSD
32 # clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX, etc...)
33 # will only work properly in 'unsecure' mode.
37 # The following line encodes the YP_INTERDOMAIN key into the hosts.byname
38 # and hosts.byaddr maps so that ypserv(8) will do DNS lookups to resolve
39 # hosts not in the current domain. Resetting this variable in
40 # Makefile.local (B=) will disable the DNS lookups.
43 # Normally, the master.passwd.* and shadow.* maps are guarded against access
44 # from non-privileged users. By resetting S in Makefile.local (S=), the
45 # YP_SECURE key will be removed from these maps, allowing anyone to access
49 # These are commands which this Makefile needs to properly rebuild the
50 # NIS databases. Don't change these unless you have a good reason. Also
51 # be sure not to place an @ in front of /usr/bin/awk: it isn't necessary
52 # and it'll break everything in sight.
59 MKDB = /usr/sbin/yp_mkdb
60 DBLOAD = $(MKDB) -m `hostname`
61 MKNETID = /usr/libexec/mknetid
62 NEWALIASES = /usr/bin/newaliases
63 YPPUSH = /usr/sbin/yppush
64 .if !defined(UPDATE_DOMAIN)
65 DOMAIN = `/bin/domainname`
67 DOMAIN = $(UPDATE_DOMAIN)
69 REVNETGROUP = /usr/libexec/revnetgroup
72 # It is advisable to create a separate directory to contain the
73 # source files used to generate your NIS maps. If you intend to
74 # support multiple domains, something like /src/dir/$DOMAIN
82 YPMAPDIR = $(YPDIR)/$(DOMAIN)
84 # These are the files from which the NIS databases are built. You may edit
85 # these to taste in the event that you wish to keep your NIS source files
86 # separate from your NIS server's actual configuration files. Note that the
87 # NIS passwd and master.passwd files are stored in /var/yp: the server's
88 # real password database is not used by default. However, you may use
89 # the real /etc/passwd and /etc/master.passwd files by:
92 # - invoking yppasswdd with `-t /etc/master.passwd' (yppasswdd will do a
93 # 'pwd_mkdb' as needed if /etc/master.passwd is thus specified).
94 # - Specifying the location of the master.passwd file using the
95 # MASTER_PASSWD variable, i.e.:
97 # # make MASTER_PASSWD=/path/to/some/other/master.passwd
99 # - (optionally): editing this Makefile to change the default location.
101 # To add a user, edit $(YPDIR)/master.passwd and type 'make'. The raw
102 # passwd file will be generated from the master.passwd file automagically.
104 ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd)
105 EUI64 = $(YPSRCDIR)/eui64 # eui64 addresses (for firewire)
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, eui64, or boorparams maps by default
148 # since /etc/ethers, /etc/eui64 and /etc/bootparams are not likely to be present
150 .if exists($(ETHERS))
162 .if exists($(BOOTPARAMS))
165 BOOTPARAMS= /dev/null
168 .if exists($(NETGROUP))
174 .if exists($(MASTER))
175 TARGETS+= passwd master.passwd netid
176 .if ${SHADOW} == "\"True\""
184 .if exists($(PUBLICKEY))
190 .if exists($(AMDHOST))
196 .if !exists($(IPNODES))
202 ethers: ethers.byname ethers.byaddr
203 eui64: eui64.byname eui64.byid
204 bootparam: bootparams
205 hosts: hosts.byname hosts.byaddr
206 ipnodes: ipnodes.byname ipnodes.byaddr
207 networks: networks.byaddr networks.byname
208 protocols: protocols.bynumber protocols.byname
209 rpc: rpc.byname rpc.bynumber
210 services: services.byname
211 passwd: passwd.byname passwd.byuid
212 shadow: shadow.byname shadow.byuid
213 group: group.byname group.bygid
217 publickey: publickey.byname
218 aliases: mail.aliases
220 master.passwd: master.passwd.byname master.passwd.byuid
223 # This is a special target used only when doing in-place updates with
224 # rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd
225 # server and won't need to be remade. They will have to be pushed to the
226 # slaves however. Calling this target implicitly insures that this will
231 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi
232 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi
233 .if ${SHADOW} == "\"True\""
234 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byname ; fi
235 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byuid ; fi
237 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi
238 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi
241 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $(PUSHMAP) ; fi
245 @echo " ********WARNING********"
246 @echo " Couldn't find the master.passwd source file. This file"
247 @echo " is needed to generate the master.passwd and passwd maps."
248 @echo " The default location is /var/yp/master.passwd. You should"
249 @echo " edit /var/yp/Makefile and set the MASTER variable to point"
250 @echo " to the source file you wish to use for building the passwd"
251 @echo " maps, or else invoke make(1) in the following manner:"
253 @echo " make MASTER_PASSWD=/path/to/master.passwd"
256 mail.aliases: $(ALIASES)
257 @echo "Updating $@..."
258 @$(NEWALIASES) -oA$(ALIASES)
259 @$(MKDB) -u $(ALIASES).db \
260 | $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP); \
263 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
264 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
267 ypservers: $(YPSERVERS)
268 @echo "Updating $@..."
269 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
271 | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \
274 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
275 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
277 ethers.byname: $(ETHERS)
278 @echo "Updating $@..."
279 .if ${ETHERS} == "/dev/null"
280 @echo "Ethers source file not found -- skipping"
282 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
283 print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
284 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
286 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
287 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
290 ethers.byaddr: $(ETHERS)
291 @echo "Updating $@..."
292 .if ${ETHERS} == "/dev/null"
293 @echo "Ethers source file not found -- skipping"
295 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
296 print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
297 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
299 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
300 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
303 eui64.byname: $(EUI64)
304 @echo "Updating $@..."
305 .if ${EUI64} == "/dev/null"
306 @echo "EUI64 source file not found -- skipping"
308 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
309 print $$2"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \
310 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
312 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
313 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
317 @echo "Updating $@..."
318 .if ${EUI64} == "/dev/null"
319 @echo "EUI64 source file not found -- skipping"
321 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
322 print $$1"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \
323 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
325 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
326 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
330 bootparams: $(BOOTPARAMS)
331 @echo "Updating $@..."
332 .if ${BOOTPARAMS} == "/dev/null"
333 @echo "Bootparams source file not found -- skipping"
335 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
336 print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -i $(BOOTPARAMS) \
337 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
339 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
340 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
344 netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
345 @echo "Updating $@..."
346 .if ${NETGROUP} == "/dev/null"
347 @echo "Netgroup source file not found -- skipping"
349 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
350 print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
351 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
353 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
354 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
358 netgroup.byhost: $(NETGROUP)
359 @echo "Updating $@..."
360 .if ${NETGROUP} == "/dev/null"
361 @echo "Netgroup source file not found -- skipping"
363 @$(REVNETGROUP) -h -f $(NETGROUP) | \
364 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
365 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
366 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
368 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
369 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
373 netgroup.byuser: $(NETGROUP)
374 @echo "Updating $@..."
375 .if ${NETGROUP} == "/dev/null"
376 @echo "Netgroup source file not found -- skipping"
378 @$(REVNETGROUP) -u -f $(NETGROUP) | \
379 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
380 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
381 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
383 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
384 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
388 # Solaris 8 does the following:
389 # - /etc/hosts and hosts.{byname,byaddr} are IPv4 only.
390 # - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol
391 # independent name-to-address mapping.
393 # For local name resolution, we made /etc/hosts protocol independent.
394 # For NIS name resolution, we obey Solaris 8 practice.
395 # - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8
397 # - ipnodes.{byname,byaddr} is used for protocol independent mapping.
398 # We generate all the mappings from /etc/hosts unless /var/yp/ipnodes
399 # exists, for compatibility with FreeBSD local name resolution.
401 hosts.byname: $(HOSTS)
402 @echo "Updating $@..."
403 @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
404 print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \
405 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
407 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
408 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
411 hosts.byaddr: $(HOSTS)
412 @echo "Updating $@..."
413 @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \
414 | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \
417 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
418 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
421 ipnodes.byname: $(IPNODES)
422 @echo "Updating $@..."
423 @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
424 print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \
425 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
427 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
428 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
431 ipnodes.byaddr: $(IPNODES)
432 @echo "Updating $@..."
433 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \
434 | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \
437 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
438 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
441 networks.byname: $(NETWORKS)
442 @echo "Updating $@..."
444 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
445 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
448 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
451 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
452 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
455 networks.byaddr: $(NETWORKS)
456 @echo "Updating $@..."
457 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(NETWORKS) \
458 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
461 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
462 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
465 protocols.byname: $(PROTOCOLS)
466 @echo "Updating $@..."
468 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
469 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
471 }' $(PROTOCOLS) | $(DBLOAD) -i $(PROTOCOLS) \
472 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
474 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
475 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
478 protocols.bynumber: $(PROTOCOLS)
479 @echo "Updating $@..."
480 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(PROTOCOLS) \
481 | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP); \
484 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
485 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
489 @echo "Updating $@..."
491 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
492 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
494 }' $(RPC) | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
497 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
498 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
502 @echo "Updating $@..."
503 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(RPC) \
504 | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
507 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
508 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
511 services.byname: $(SERVICES)
512 @echo "Updating $@..."
514 '$$1 !~ "^#.*" { for (n=1; n<=NF && $$n !~ "^#.*"; n++) { \
515 if (split($$2, t, "/")) { \
516 printf("%s/%s", $$n, t[2]) }; \
519 } ; print $$2"\t"$$0 ; \
521 | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \
524 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
525 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
528 @echo "Updating $@..."
529 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
531 | $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \
534 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
535 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
537 publickey.byname: $(PUBLICKEY)
538 @echo "Updating $@..."
539 .if ${PUBLICKEY} == "/dev/null"
540 @echo "Publickey source file not found -- skipping"
542 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $(PUBLICKEY) \
543 | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP); \
546 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
547 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
552 @echo "Creating new $@ file from $(MASTER)..."
553 @if [ ! $(UNSECURE) ]; then \
554 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
555 print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
558 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
559 print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
563 passwd.byname: $(PASSWD)
564 @echo "Updating $@..."
565 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
566 print $$1"\t"$$0 }' $(PASSWD) \
567 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
570 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
571 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
574 passwd.byuid: $(PASSWD)
575 @echo "Updating $@..."
576 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
577 print $$3"\t"$$0 }' $(PASSWD) \
578 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
581 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
582 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
585 group.byname: $(GROUP)
586 @echo "Updating $@..."
587 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
588 print $$1"\t"$$0 }' $(GROUP) \
589 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
592 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
593 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
596 group.bygid: $(GROUP)
597 @echo "Updating $@..."
598 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
599 print $$3"\t"$$0 }' $(GROUP) \
600 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
603 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
604 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
607 netid.byname: $(GROUP) $(PASSWD) $(HOSTS)
608 @echo "Updating $@..."
609 @$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \
610 -d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP); \
613 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
614 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
617 master.passwd.byname: $(MASTER)
618 @echo "Updating $@..."
619 .if ${MASTER} == "/dev/null"
620 @echo "Master.passwd source file not found -- skipping"
622 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
623 print $$1"\t"$$0 }' $(MASTER) \
624 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
627 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
628 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
632 master.passwd.byuid: $(MASTER)
633 @echo "Updating $@..."
634 .if ${MASTER} == "/dev/null"
635 @echo "Master.passwd source file not found -- skipping"
637 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
638 print $$3"\t"$$0 }' $(MASTER) \
639 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
642 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
643 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
647 shadow.byname: $(MASTER)
648 @echo "Updating $@..."
649 .if ${MASTER} == "/dev/null"
650 @echo "Master.passwd source file not found -- skipping"
652 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
653 print $$1"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
654 | sed 's/\( [^:]*:\)\*:/\1!:/' \
655 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
658 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
659 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
662 shadow.byuid: $(MASTER)
663 @echo "Updating $@..."
664 .if ${MASTER} == "/dev/null"
665 @echo "Master.passwd source file not found -- skipping"
667 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
668 print $$3"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
669 | sed 's/\( [^:]*:\)\*:/\1!:/' \
670 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
673 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
674 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
678 @echo "Updating $@..."
679 @$(AWK) '$$1 !~ "^#.*" { \
680 for (i = 1; i <= NF; i++) \
682 if (substr($$i, length($$i), 1) == "\\") \
683 printf("%s", substr($$i, 1, length($$i) - 1)); \
685 printf("%s\n", $$i); \
688 printf("%s ", $$i); \
690 $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP); \
693 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
694 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi