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
145 # Sanity checks: filter out targets we can't build
146 # Note that we don't build the ethers or boorparams maps by default
147 # since /etc/ethers and /etc/bootparams are not likely to be present
149 .if exists($(ETHERS))
155 .if exists($(BOOTPARAMS))
158 BOOTPARAMS= /dev/null
161 .if exists($(NETGROUP))
167 .if exists($(MASTER))
168 TARGETS+= passwd master.passwd netid
169 .if ${SHADOW} == "\"True\""
177 .if exists($(PUBLICKEY))
183 .if exists($(AMDHOST))
189 .if exists($(IPNODES))
197 ethers: ethers.byname ethers.byaddr
198 bootparam: bootparams
199 hosts: hosts.byname hosts.byaddr
200 ipnodes: ipnodes.byname ipnodes.byaddr
201 networks: networks.byaddr networks.byname
202 protocols: protocols.bynumber protocols.byname
203 rpc: rpc.byname rpc.bynumber
204 services: services.byname
205 passwd: passwd.byname passwd.byuid
206 shadow: shadow.byname shadow.byuid
207 group: group.byname group.bygid
211 publickey: publickey.byname
212 aliases: mail.aliases
214 master.passwd: master.passwd.byname master.passwd.byuid
217 # This is a special target used only when doing in-place updates with
218 # rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd
219 # server and won't need to be remade. They will have to be pushed to the
220 # slaves however. Calling this target implicitly insures that this will
225 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi
226 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi
227 .if ${SHADOW} == "\"True\""
228 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byname ; fi
229 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byuid ; fi
231 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi
232 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi
235 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $(PUSHMAP) ; fi
239 @echo " ********WARNING********"
240 @echo " Couldn't find the master.passwd source file. This file"
241 @echo " is needed to generate the master.passwd and passwd maps."
242 @echo " The default location is /var/yp/master.passwd. You should"
243 @echo " edit /var/yp/Makefile and set the MASTER variable to point"
244 @echo " to the source file you wish to use for building the passwd"
245 @echo " maps, or else invoke make(1) in the following manner:"
247 @echo " make MASTER_PASSWD=/path/to/master.passwd"
250 mail.aliases: $(ALIASES)
251 @echo "Updating $@..."
252 @$(NEWALIASES) -oA$(ALIASES)
253 @$(MKDB) -u $(ALIASES).db \
254 | $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP); \
257 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
258 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
261 ypservers: $(YPSERVERS)
262 @echo "Updating $@..."
263 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
265 | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \
268 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
269 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
271 ethers.byname: $(ETHERS)
272 @echo "Updating $@..."
273 .if ${ETHERS} == "/dev/null"
274 @echo "Ethers source file not found -- skipping"
276 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
277 print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
278 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
280 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
281 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
284 ethers.byaddr: $(ETHERS)
285 @echo "Updating $@..."
286 .if ${ETHERS} == "/dev/null"
287 @echo "Ethers source file not found -- skipping"
289 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
290 print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \
291 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
293 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
294 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
298 bootparams: $(BOOTPARAMS)
299 @echo "Updating $@..."
300 .if ${BOOTPARAMS} == "/dev/null"
301 @echo "Bootparams source file not found -- skipping"
303 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
304 print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -i $(BOOTPARAMS) \
305 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
307 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
308 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
312 netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
313 @echo "Updating $@..."
314 .if ${NETGROUP} == "/dev/null"
315 @echo "Netgroup source file not found -- skipping"
317 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
318 print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
319 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
321 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
322 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
326 netgroup.byhost: $(NETGROUP)
327 @echo "Updating $@..."
328 .if ${NETGROUP} == "/dev/null"
329 @echo "Netgroup source file not found -- skipping"
331 @$(REVNETGROUP) -h -f $(NETGROUP) | \
332 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
333 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
334 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
336 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
337 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
341 netgroup.byuser: $(NETGROUP)
342 @echo "Updating $@..."
343 .if ${NETGROUP} == "/dev/null"
344 @echo "Netgroup source file not found -- skipping"
346 @$(REVNETGROUP) -u -f $(NETGROUP) | \
347 $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
348 print $$0 }' | $(DBLOAD) -i $(NETGROUP) \
349 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
351 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
352 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
356 hosts.byname: $(HOSTS)
357 @echo "Updating $@..."
358 @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
359 print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \
360 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
362 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
363 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
366 hosts.byaddr: $(HOSTS)
367 @echo "Updating $@..."
368 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \
369 | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \
372 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
373 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
376 ipnodes.byname: $(IPNODES)
377 @echo "Updating $@..."
378 .if ${IPNODES} == "/dev/null"
379 @echo "Ipnodes source file not found -- skipping"
381 @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
382 print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \
383 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
385 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
386 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
390 ipnodes.byaddr: $(IPNODES)
391 @echo "Updating $@..."
392 .if ${IPNODES} == "/dev/null"
393 @echo "Ipnodes source file not found -- skipping"
395 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \
396 | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \
399 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
400 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
404 networks.byname: $(NETWORKS)
405 @echo "Updating $@..."
407 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
408 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
411 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
414 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
415 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
418 networks.byaddr: $(NETWORKS)
419 @echo "Updating $@..."
420 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(NETWORKS) \
421 | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \
424 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
425 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
428 protocols.byname: $(PROTOCOLS)
429 @echo "Updating $@..."
431 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
432 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
434 }' $(PROTOCOLS) | $(DBLOAD) -i $(PROTOCOLS) \
435 -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
437 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
438 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
441 protocols.bynumber: $(PROTOCOLS)
442 @echo "Updating $@..."
443 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(PROTOCOLS) \
444 | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP); \
447 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
448 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
452 @echo "Updating $@..."
454 '$$1 !~ "^#.*" { print $$1"\t"$$0; \
455 for (n=3; n<=NF && $$n !~ "^#.*"; n++) \
457 }' $(RPC) | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
460 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
461 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
465 @echo "Updating $@..."
466 @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(RPC) \
467 | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \
470 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
471 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
474 services.byname: $(SERVICES)
475 @echo "Updating $@..."
477 '$$1 !~ "^#.*" { for (n=1; n<=NF && $$n !~ "^#.*"; n++) { \
478 if (split($$2, t, "/")) { \
479 printf("%s/%s", $$n, t[2]) }; \
482 } ; print $$2"\t"$$0 ; \
484 | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \
487 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
488 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
491 @echo "Updating $@..."
492 @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \
494 | $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \
497 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
498 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
500 publickey.byname: $(PUBLICKEY)
501 @echo "Updating $@..."
502 .if ${PUBLICKEY} == "/dev/null"
503 @echo "Publickey source file not found -- skipping"
505 @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $(PUBLICKEY) \
506 | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP); \
509 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
510 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
515 @echo "Creating new $@ file from $(MASTER)..."
516 @if [ ! $(UNSECURE) ]; then \
517 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
518 print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
521 $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
522 print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \
526 passwd.byname: $(PASSWD)
527 @echo "Updating $@..."
528 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
529 print $$1"\t"$$0 }' $(PASSWD) \
530 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
533 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
534 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
537 passwd.byuid: $(PASSWD)
538 @echo "Updating $@..."
539 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
540 print $$3"\t"$$0 }' $(PASSWD) \
541 | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
544 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
545 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
548 group.byname: $(GROUP)
549 @echo "Updating $@..."
550 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
551 print $$1"\t"$$0 }' $(GROUP) \
552 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
555 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
556 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
559 group.bygid: $(GROUP)
560 @echo "Updating $@..."
561 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
562 print $$3"\t"$$0 }' $(GROUP) \
563 | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
566 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
567 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
570 netid.byname: $(GROUP) $(PASSWD) $(HOSTS)
571 @echo "Updating $@..."
572 @$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \
573 -d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP); \
576 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
577 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
580 master.passwd.byname: $(MASTER)
581 @echo "Updating $@..."
582 .if ${MASTER} == "/dev/null"
583 @echo "Master.passwd source file not found -- skipping"
585 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
586 print $$1"\t"$$0 }' $(MASTER) \
587 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
590 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
591 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
595 master.passwd.byuid: $(MASTER)
596 @echo "Updating $@..."
597 .if ${MASTER} == "/dev/null"
598 @echo "Master.passwd source file not found -- skipping"
600 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
601 print $$3"\t"$$0 }' $(MASTER) \
602 | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \
605 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
606 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
610 shadow.byname: $(MASTER)
611 @echo "Updating $@..."
612 .if ${MASTER} == "/dev/null"
613 @echo "Master.passwd source file not found -- skipping"
615 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
616 print $$1"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
617 | sed 's/\( [^:]*:\)\*:/\1!:/' \
618 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
621 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
622 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
625 shadow.byuid: $(MASTER)
626 @echo "Updating $@..."
627 .if ${MASTER} == "/dev/null"
628 @echo "Master.passwd source file not found -- skipping"
630 @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
631 print $$3"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \
632 | sed 's/\( [^:]*:\)\*:/\1!:/' \
633 | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
636 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
637 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
641 @echo "Updating $@..."
642 @$(AWK) '$$1 !~ "^#.*" { \
643 for (i = 1; i <= NF; i++) \
645 if (substr($$i, length($$i), 1) == "\\") \
646 printf("%s", substr($$i, 1, length($$i) - 1)); \
648 printf("%s\n", $$i); \
651 printf("%s ", $$i); \
653 $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP); \
656 @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
657 @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi