Makefile.yp revision 16732
1#
2# Makefile for the NIS databases
3#
4# $Id: Makefile.yp,v 1.6 1996/06/05 02:01:27 wpaul Exp $
5#
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.
10#
11# This Makefile can be modified to support more NIS maps if desired.
12#
13
14# If this machine is an NIS master, comment out this next line so
15# that changes to the NIS maps can be propagated to the slave servers.
16# (By default we assume that we are only serving a small domain with
17# only one server.)
18#
19NOPUSH = "True"
20
21# If you want to use a FreeBSD NIS server to serve non-FreeBSD clients
22# (i.e. clients who expect the password field in the passwd maps to be
23# valid) then uncomment this line. This will cause $YPDIR/passwd to
24# be generated with valid password fields. This is insecure: FreeBSD
25# normally only serves the master.passwd maps (which have real encrypted
26# passwords in them) to the superuser on other FreeBSD machines, but
27# non-FreeBSD clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX,
28# etc...) will only work properly in 'unsecure' mode.
29# 
30#UNSECURE = "True"
31
32# These are commands which this Makefile needs to properly rebuild the
33# NIS databases. Don't change these unless you have a good reason. Also
34# be sure not to place an @ in front of /usr/bin/awk: it isn't necessary
35# and it'll break everything in sight.
36#
37AWK = /usr/bin/awk
38RM  = @/bin/rm -f
39MV  = @/bin/mv -f
40RCAT = /bin/cat
41CAT = @$(RCAT)
42SED = /usr/bin/sed
43
44DBLOAD = /usr/sbin/yp_mkdb -m `hostname`
45MKNETID = /usr/libexec/mknetid
46MKALIASES = /usr/libexec/mkaliases
47NEWALIASES = /usr/bin/newaliases
48YPPUSH = /usr/sbin/yppush
49.if !defined(UPDATE_DOMAIN)
50DOMAIN = `/bin/domainname`
51.else
52DOMAIN = $(UPDATE_DOMAIN)
53.endif
54REVNETGROUP = /usr/libexec/revnetgroup
55NFILE = /tmp/ypmake
56TMP = `$(RCAT) $(NFILE)`
57
58# It is advisable to create a seperate directory to contain the
59# source files used to generate your NIS maps. If you intent to
60# support multiple domains, something like /src/dir/$DOMAIN
61# would work well.
62YPSRCDIR = /etc
63YPDIR = /var/yp
64YPMAPDIR = $(YPDIR)/$(DOMAIN)
65
66# These are the files from which the NIS databases are built. You may edit
67# these to taste in the event that you wish to keep your NIS source files
68# seperate from your NIS server's actual configuration files. Note that the
69# NIS passwd and master.passwd files are stored in /var/yp: the server's
70# real password database is not used by default. However, you may use
71# the real /etc/passwd and /etc/master.passwd files by:
72#
73#
74# - invoking yppasswdd without the -m option (yppasswdd will use
75#   /etc/master.passwd if no alternate master.passwd file is specified
76#   and do a 'pwd_mkdb' as needed).
77# - Specifying the location of the master.passwd file using the
78#   MASTER_PASSWD variable, i.e.:
79#
80#   # make MASTER_PASSWD=/path/to/some/other/master.passwd
81#
82# - (optionally): editing this Makefile to change the default location.
83#
84# To add a user, edit $(YPDIR)/master.passwd and type 'make'. The raw
85# passwd file will be generated from the master.passwd file automagically.
86#
87ETHERS    = $(YPSRCDIR)/ethers	   # ethernet addresses (for rarpd)
88BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
89HOSTS     = $(YPSRCDIR)/hosts
90NETWORKS  = $(YPSRCDIR)/networks
91PROTOCOLS = $(YPSRCDIR)/protocols
92RPC 	  = $(YPSRCDIR)/rpc
93SERVICES  = $(YPSRCDIR)/services
94GROUP     = $(YPSRCDIR)/group
95ALIASES   = $(YPSRCDIR)/aliases
96NETGROUP  = $(YPDIR)/netgroup
97PASSWD    = $(YPDIR)/passwd
98.if !defined(MASTER_PASSWD)
99MASTER    = $(YPDIR)/master.passwd
100.else
101MASTER	  = $(MASTER_PASSWD)
102.endif
103YPSERVERS = $(YPDIR)/ypservers	# List of all NIS servers for a domain
104PUBLICKEY = $(YPSRCDIR)/publickey
105NETID     = $(YPSRCDIR)/netid
106
107target: 
108	@$(RM) $(NFILE)
109	@if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
110	cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \
111	make -f ../Makefile all; echo "NIS Map update completed."
112
113# If you don't want some of these maps built, feel free to comment
114# them out from this list.
115# Note that we don't build the ethers or boorparams maps by default
116# since /etc/ethers and /etc/bootparams are not likely to be present
117# on all systems.
118#
119
120all:  master.passwd passwd hosts group networks protocols rpc \
121      services servers netid # aliases publickey netgroup ethers bootparam
122
123ethers:	   ethers.byname ethers.byaddr
124bootparam: bootparams
125hosts:	   hosts.byname hosts.byaddr
126networks:  networks.byaddr networks.byname
127protocols: protocols.bynumber protocols.byname
128rpc:	   rpc.byname rpc.bynumber
129services:  services.byname
130passwd:    passwd.byname passwd.byuid
131group:     group.byname group.bygid
132netgrp:    netgroup
133netid:	   netid.byname
134servers:   ypservers
135publickey: publickey.byname
136aliases:   mail.aliases
137
138master.passwd:	master.passwd.byname master.passwd.byuid
139
140#
141# This is a special target used only when doing in-place updates with
142# rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd
143# server and won't need to be remade. They will have to be pushed to the
144# slaves however. Calling this target implicitly insures that this will
145# happen.
146#
147pushpw:
148	@$(DBLOAD) -c
149	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi
150	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi
151	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi
152	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi
153
154mail.aliases: $(ALIASES)
155	@echo "Updating $@..."
156	@echo $@.$$$$ > $(NFILE)
157	$(CAT) $(ALIASES) | \
158	$(SED) -e "/^#/d" -e s/#.*$$// -e "/^ *$$/d" |\
159	$(MKALIASES) \
160		| $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP)
161	@$(MV) $(TMP) $@
162	@$(DBLOAD) -c
163	@$(NEWALIASES)
164	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
165	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
166
167
168ypservers: $(YPSERVERS)
169	@echo "Updating $@..."
170	@echo $@.$$$$ > $(NFILE)
171	$(CAT) $(YPSERVERS) | \
172	$(AWK) '{ if ($$1 != "" && $$1 != "#") print $$0"\t"$$0 }' $^ \
173		| $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP)
174	@$(MV) $(TMP) $@
175	@$(DBLOAD) -c
176	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
177	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
178
179
180ethers.byname: $(ETHERS)
181	@echo "Updating $@..."
182	@echo $@.$$$$ > $(NFILE)
183	$(CAT) $(ETHERS) | \
184	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
185		print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
186						-o $(YPMAPDIR)/$@ - $(TMP)
187	@$(MV) $(TMP) $@
188	@$(DBLOAD) -c
189	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) -i $(ETHERS) $@; fi
190	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
191
192
193ethers.byaddr: $(ETHERS)
194	@echo "Updating $@..."
195	@echo $@.$$$$ > $(NFILE)
196	$(CAT) $(ETHERS) | \
197	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
198		print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
199						-o $(YPMAPDIR)/$@ - $(TMP)
200	@$(MV) $(TMP) $@
201	@$(DBLOAD) -c
202	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
203	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
204
205
206bootparams: $(BOOTPARAMS)
207	@echo "Updating $@..."
208	@echo $@.$$$$ > $(NFILE)
209	$(CAT) $(BOOTPARAMS) | \
210	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
211		print $$0 }' $^ | $(DBLOAD) -i $(BOOTPARAMS) \
212						-o $(YPMAPDIR)/$@ - $(TMP)
213	@$(MV) $(TMP) $@
214	@$(DBLOAD) -c
215	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
216	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
217
218
219netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
220	@echo "Updating $@..."
221	@echo $@.$$$$ > $(NFILE)
222	$(CAT) $(NETGROUP) | \
223	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
224		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
225						-o $(YPMAPDIR)/$@ - $(TMP)
226	@$(MV) $(TMP) $@
227	@$(DBLOAD) -c
228	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
229	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
230	@$(MAKE) -f ../Makefile netid
231
232
233netgroup.byhost: $(NETGROUP)
234	@echo "Updating $@..."
235	@echo $@.$$$$ > $(NFILE)
236	$(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \
237	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
238		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
239						-o $(YPMAPDIR)/$@ - $(TMP)
240	@$(MV) $(TMP) $@
241	@$(DBLOAD) -c
242	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
243	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
244
245
246netgroup.byuser: $(NETGROUP)
247	@echo "Updating $@..."
248	@echo $@.$$$$ > $(NFILE)
249	$(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \
250	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
251		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
252						-o $(YPMAPDIR)/$@ - $(TMP)
253	@$(MV) $(TMP) $@
254	@$(DBLOAD) -c
255	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
256	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
257
258
259hosts.byname: $(HOSTS)
260	@echo "Updating $@..."
261	@echo $@.$$$$ > $(NFILE)
262	$(CAT) $(HOSTS) | \
263	$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "#"; n++) \
264		print $$n"\t"$$0 }' $^ | $(DBLOAD) -i $(HOSTS)  \
265						-o $(YPMAPDIR)/$@ - $(TMP)
266	@$(MV) $(TMP) $@
267	@$(DBLOAD) -c
268	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
269	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
270	@$(MAKE) -f ../Makefile netid
271
272
273hosts.byaddr: $(HOSTS)
274	@echo "Updating $@..."
275	@echo $@.$$$$ > $(NFILE)
276	$(CAT) $(HOSTS) | \
277	$(AWK) '$$1 !~ "#" { print $$1"\t"$$0 }' $^ \
278		| $(DBLOAD) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP)
279	@$(MV) $(TMP) $@
280	@$(DBLOAD) -c
281	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
282	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
283	@$(MAKE) -f ../Makefile netid
284
285
286networks.byname: $(NETWORKS)
287	@echo "Updating $@..."
288	@echo $@.$$$$ > $(NFILE)
289	$(CAT) $(NETWORKS) | \
290	$(AWK) \
291	   '$$1 !~ "#"  { print $$1"\t"$$0; \
292			  for (n=3; n<=NF && $$n !~ "#"; n++) \
293			      print $$n"\t"$$0 \
294		}' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP)
295	@$(MV) $(TMP) $@
296	@$(DBLOAD) -c
297	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
298	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
299
300
301networks.byaddr: $(NETWORKS)
302	@echo "Updating $@..."
303	@echo $@.$$$$ > $(NFILE)
304	$(CAT) $(NETWORKS) | \
305	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
306		| $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP)
307	@$(MV) $(TMP) $@
308	@$(DBLOAD) -c
309	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
310	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
311
312
313protocols.byname: $(PROTOCOLS)
314	@echo "Updating $@..."
315	@echo $@.$$$$ > $(NFILE)
316	$(CAT) $(PROTOCOLS) | \
317	$(AWK) \
318	   '$$1 !~ "#"	{ print $$1"\t"$$0; \
319			  for (n=3; n<=NF && $$n !~ "#"; n++) \
320			      print $$n"\t"$$0 \
321			}' $^ | $(DBLOAD) -i $(PROTOCOLS) \
322						-o $(YPMAPDIR)/$@ - $(TMP)
323	@$(MV) $(TMP) $@
324	@$(DBLOAD) -c
325	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
326	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
327
328
329protocols.bynumber: $(PROTOCOLS)
330	@echo "Updating $@..."
331	@echo $@.$$$$ > $(NFILE)
332	$(CAT) $(PROTOCOLS) | \
333	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
334		| $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP)
335	@$(MV) $(TMP) $@
336	@$(DBLOAD) -c
337	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
338	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
339
340
341rpc.byname: $(RPC)
342	@echo "Updating $@..."
343	@echo $@.$$$$ > $(NFILE)
344	$(CAT) $(RPC) | \
345	$(AWK) \
346	   '$$1 !~ "#"  { print $$1"\t"$$0; \
347			  for (n=3; n<=NF && $$n !~ "#"; n++) \
348			      print $$n"\t"$$0 \
349		}' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP)
350	@$(MV) $(TMP) $@
351	@$(DBLOAD) -c
352	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
353	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
354
355
356rpc.bynumber: $(RPC)
357	@echo "Updating $@..."
358	@echo $@.$$$$ > $(NFILE)
359	$(CAT) $(RPC) | \
360	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
361		| $(DBLOAD)  -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP)
362	@$(MV) $(TMP) $@
363	@$(DBLOAD) -c
364	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
365	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
366
367
368services.byname: $(SERVICES)
369	@echo "Updating $@..."
370	@echo $@.$$$$ > $(NFILE)
371	$(CAT) $(SERVICES) | \
372	$(AWK) \
373	   '$$1 !~ "#"  { if (index($$2,"udp")) { printf("%s/udp",$$1) } \
374			  else { printf("%s/tcp",$$1) }; print "\t"$$0 ; \
375			  print $$2"\t"$$0 ; \
376		}' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP)
377	@$(MV) $(TMP) $@
378	@$(DBLOAD) -c
379	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
380	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
381
382
383publickey.byname: $(PUBLICKEY)
384	@echo "Updating $@..."
385	@echo $@.$$$$ > $(NFILE)
386	$(TMP) = `$(RCAT) $(NFILE)`
387	$(AWK) '$$1 !~ "#" { print $$1"\t"$$2 }' $^ \
388		| $(DBLOAD)  -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP)
389	@$(MV) $(TMP) $@
390	@$(DBLOAD) -c
391	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
392	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
393
394
395$(PASSWD): $(MASTER)
396	@echo "Creating new $@ file from $(MASTER)..."
397	@if [ ! $(UNSECURE) ]; then \
398	$(RCAT) $(MASTER) | \
399	$(AWK) -F: '{if ($$1 != "+") \
400		print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
401		> $(PASSWD) ; \
402	else $(RCAT) $(MASTER) | \
403	$(AWK) -F: '{if ($$1 != "+") \
404		print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
405		> $(PASSWD) ; fi
406
407
408passwd.byname: $(PASSWD)
409	@echo "Updating $@..."
410	@echo $@.$$$$ > $(NFILE)
411	$(CAT) $(PASSWD) | \
412	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
413		| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP)
414	@$(MV) $(TMP) $@
415	@$(DBLOAD) -c
416	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
417	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
418
419
420passwd.byuid: $(PASSWD)
421	@echo "Updating $@..."
422	@echo $@.$$$$ > $(NFILE)
423	$(CAT) $(PASSWD) | \
424	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
425		| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP)
426	@$(MV) $(TMP) $@
427	@$(DBLOAD) -c
428	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
429	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
430	@$(MAKE) -f ../Makefile netid
431
432
433group.byname: $(GROUP)
434	@echo "Updating $@..."
435	@echo $@.$$$$ > $(NFILE)
436	$(CAT) $(GROUP) | \
437	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
438		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP)
439	@$(MV) $(TMP) $@
440	@$(DBLOAD) -c
441	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
442	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
443
444
445group.bygid: $(GROUP)
446	@echo "Updating $@..."
447	@echo $@.$$$$ > $(NFILE)
448	$(CAT) $(GROUP) | \
449	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
450		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP)
451	@$(MV) $(TMP) $@
452	@$(DBLOAD) -c
453	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
454	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
455	@$(MAKE) -f ../Makefile netid
456
457
458netid.byname: $(GROUP) $(PASSWD)
459	@echo "Updating $@..."
460	@echo $@.$$$$ > $(NFILE)
461	@$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \
462		-d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP)
463	@$(MV) $(TMP) $@
464	@$(DBLOAD) -c
465	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
466	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
467
468
469master.passwd.byname: $(MASTER)
470	@echo "Updating $@..."
471	@echo $@.$$$$ > $(NFILE)
472	$(CAT) $(MASTER) | \
473	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
474		| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP)
475	@$(MV) $(TMP) $@
476	@$(DBLOAD) -c
477	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
478	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
479
480
481master.passwd.byuid: $(MASTER)
482	@echo "Updating $@..."
483	@echo $@.$$$$ > $(NFILE)
484	$(CAT) $(MASTER) | \
485	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
486		| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP)
487	@$(MV) $(TMP) $@
488	@$(DBLOAD) -c
489	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
490	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
491