Makefile.yp revision 16118
1#
2# Makefile for the NIS databases
3#
4# $Id: Makefile.yp,v 1.5 1996/06/03 16:24:32 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
105
106target: 
107	@$(RM) $(NFILE)
108	@if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
109	cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \
110	make -f ../Makefile all; echo "NIS Map update completed."
111
112# If you don't want some of these maps built, feel free to comment
113# them out from this list.
114# Note that we don't build the ethers or boorparams maps by default
115# since /etc/ethers and /etc/bootparams are not likely to be present
116# on all systems.
117#
118
119all:  master.passwd passwd hosts group networks protocols rpc \
120      services servers netid # aliases publickey netgroup ethers bootparam
121
122ethers:	   ethers.byname ethers.byaddr
123bootparam: bootparams
124hosts:	   hosts.byname hosts.byaddr
125networks:  networks.byaddr networks.byname
126protocols: protocols.bynumber protocols.byname
127rpc:	   rpc.byname rpc.bynumber
128services:  services.byname
129passwd:    passwd.byname passwd.byuid
130group:     group.byname group.bygid
131netgrp:    netgroup
132netid:	   netid.byname
133servers:   ypservers
134publickey: publickey.byname
135aliases:   mail.aliases
136
137master.passwd:	master.passwd.byname master.passwd.byuid
138
139#
140# This is a special target used only when doing in-place updates with
141# rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd
142# server and won't need to be remade. They will have to be pushed to the
143# slaves however. Calling this target implicitly insures that this will
144# happen.
145#
146pushpw:
147	@$(DBLOAD) -c
148	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi
149	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi
150	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi
151	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi
152
153mail.aliases: $(ALIASES)
154	@echo "Updating $@..."
155	@echo $@.$$$$ > $(NFILE)
156	$(CAT) $(ALIASES) | \
157	$(SED) -e "/^#/d" -e s/#.*$$// -e "/^ *$$/d" |\
158	$(MKALIASES) \
159		| $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP)
160	@$(MV) $(TMP) $@
161	@$(DBLOAD) -c
162	@$(NEWALIASES)
163	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
164	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
165
166
167ypservers: $(YPSERVERS)
168	@echo "Updating $@..."
169	@echo $@.$$$$ > $(NFILE)
170	$(CAT) $(YPSERVERS) | \
171	$(AWK) '{ if ($$1 != "" && $$1 != "#") print $$0"\t"$$0 }' $^ \
172		| $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP)
173	@$(MV) $(TMP) $@
174	@$(DBLOAD) -c
175	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
176	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
177
178
179ethers.byname: $(ETHERS)
180	@echo "Updating $@..."
181	@echo $@.$$$$ > $(NFILE)
182	$(CAT) $(ETHERS) | \
183	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
184		print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
185						-o $(YPMAPDIR)/$@ - $(TMP)
186	@$(MV) $(TMP) $@
187	@$(DBLOAD) -c
188	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) -i $(ETHERS) $@; fi
189	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
190
191
192ethers.byaddr: $(ETHERS)
193	@echo "Updating $@..."
194	@echo $@.$$$$ > $(NFILE)
195	$(CAT) $(ETHERS) | \
196	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
197		print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
198						-o $(YPMAPDIR)/$@ - $(TMP)
199	@$(MV) $(TMP) $@
200	@$(DBLOAD) -c
201	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
202	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
203
204
205bootparams: $(BOOTPARAMS)
206	@echo "Updating $@..."
207	@echo $@.$$$$ > $(NFILE)
208	$(CAT) $(BOOTPARAMS) | \
209	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
210		print $$0 }' $^ | $(DBLOAD) -i $(BOOTPARAMS) \
211						-o $(YPMAPDIR)/$@ - $(TMP)
212	@$(MV) $(TMP) $@
213	@$(DBLOAD) -c
214	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
215	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
216
217
218netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
219	@echo "Updating $@..."
220	@echo $@.$$$$ > $(NFILE)
221	$(CAT) $(NETGROUP) | \
222	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
223		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
224						-o $(YPMAPDIR)/$@ - $(TMP)
225	@$(MV) $(TMP) $@
226	@$(DBLOAD) -c
227	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
228	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
229	@$(MAKE) -f ../Makefile netid
230
231
232netgroup.byhost: $(NETGROUP)
233	@echo "Updating $@..."
234	@echo $@.$$$$ > $(NFILE)
235	$(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \
236	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
237		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
238						-o $(YPMAPDIR)/$@ - $(TMP)
239	@$(MV) $(TMP) $@
240	@$(DBLOAD) -c
241	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
242	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
243
244
245netgroup.byuser: $(NETGROUP)
246	@echo "Updating $@..."
247	@echo $@.$$$$ > $(NFILE)
248	$(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \
249	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
250		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
251						-o $(YPMAPDIR)/$@ - $(TMP)
252	@$(MV) $(TMP) $@
253	@$(DBLOAD) -c
254	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
255	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
256
257
258hosts.byname: $(HOSTS)
259	@echo "Updating $@..."
260	@echo $@.$$$$ > $(NFILE)
261	$(CAT) $(HOSTS) | \
262	$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "#"; n++) \
263		print $$n"\t"$$0 }' $^ | $(DBLOAD) -i $(HOSTS)  \
264						-o $(YPMAPDIR)/$@ - $(TMP)
265	@$(MV) $(TMP) $@
266	@$(DBLOAD) -c
267	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
268	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
269	@$(MAKE) -f ../Makefile netid
270
271
272hosts.byaddr: $(HOSTS)
273	@echo "Updating $@..."
274	@echo $@.$$$$ > $(NFILE)
275	$(CAT) $(HOSTS) | \
276	$(AWK) '$$1 !~ "#" { print $$1"\t"$$0 }' $^ \
277		| $(DBLOAD) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP)
278	@$(MV) $(TMP) $@
279	@$(DBLOAD) -c
280	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
281	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
282	@$(MAKE) -f ../Makefile netid
283
284
285networks.byname: $(NETWORKS)
286	@echo "Updating $@..."
287	@echo $@.$$$$ > $(NFILE)
288	$(CAT) $(NETWORKS) | \
289	$(AWK) \
290	   '$$1 !~ "#"  { print $$1"\t"$$0; \
291			  for (n=3; n<=NF && $$n !~ "#"; n++) \
292			      print $$n"\t"$$0 \
293		}' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP)
294	@$(MV) $(TMP) $@
295	@$(DBLOAD) -c
296	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
297	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
298
299
300networks.byaddr: $(NETWORKS)
301	@echo "Updating $@..."
302	@echo $@.$$$$ > $(NFILE)
303	$(CAT) $(NETWORKS) | \
304	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
305		| $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP)
306	@$(MV) $(TMP) $@
307	@$(DBLOAD) -c
308	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
309	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
310
311
312protocols.byname: $(PROTOCOLS)
313	@echo "Updating $@..."
314	@echo $@.$$$$ > $(NFILE)
315	$(CAT) $(PROTOCOLS) | \
316	$(AWK) \
317	   '$$1 !~ "#"	{ print $$1"\t"$$0; \
318			  for (n=3; n<=NF && $$n !~ "#"; n++) \
319			      print $$n"\t"$$0 \
320			}' $^ | $(DBLOAD) -i $(PROTOCOLS) \
321						-o $(YPMAPDIR)/$@ - $(TMP)
322	@$(MV) $(TMP) $@
323	@$(DBLOAD) -c
324	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
325	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
326
327
328protocols.bynumber: $(PROTOCOLS)
329	@echo "Updating $@..."
330	@echo $@.$$$$ > $(NFILE)
331	$(CAT) $(PROTOCOLS) | \
332	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
333		| $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP)
334	@$(MV) $(TMP) $@
335	@$(DBLOAD) -c
336	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
337	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
338
339
340rpc.byname: $(RPC)
341	@echo "Updating $@..."
342	@echo $@.$$$$ > $(NFILE)
343	$(CAT) $(RPC) | \
344	$(AWK) \
345	   '$$1 !~ "#"  { print $$1"\t"$$0; \
346			  for (n=3; n<=NF && $$n !~ "#"; n++) \
347			      print $$n"\t"$$0 \
348		}' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP)
349	@$(MV) $(TMP) $@
350	@$(DBLOAD) -c
351	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
352	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
353
354
355rpc.bynumber: $(RPC)
356	@echo "Updating $@..."
357	@echo $@.$$$$ > $(NFILE)
358	$(CAT) $(RPC) | \
359	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
360		| $(DBLOAD)  -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP)
361	@$(MV) $(TMP) $@
362	@$(DBLOAD) -c
363	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
364	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
365
366
367services.byname: $(SERVICES)
368	@echo "Updating $@..."
369	@echo $@.$$$$ > $(NFILE)
370	$(CAT) $(SERVICES) | \
371	$(AWK) \
372	   '$$1 !~ "#"  { if (index($$2,"udp")) { printf("%s/udp",$$1) } \
373			  else { printf("%s/tcp",$$1) }; print "\t"$$0 ; \
374			  print $$2"\t"$$0 ; \
375		}' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP)
376	@$(MV) $(TMP) $@
377	@$(DBLOAD) -c
378	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
379	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
380
381
382publickey.byname: $(PUBLICKEY)
383	@echo "Updating $@..."
384	@echo $@.$$$$ > $(NFILE)
385	$(TMP) = `$(RCAT) $(NFILE)`
386	$(AWK) '$$1 !~ "#" { print $$1"\t"$$2 }' $^ \
387		| $(DBLOAD)  -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP)
388	@$(MV) $(TMP) $@
389	@$(DBLOAD) -c
390	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
391	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
392
393
394$(PASSWD): $(MASTER)
395	@echo "Creating new $@ file from $(MASTER)..."
396	@if [ ! $(UNSECURE) ]; then \
397	$(RCAT) $(MASTER) | \
398	$(AWK) -F: '{if ($$1 != "+") \
399		print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
400		> $(PASSWD) ; \
401	else $(RCAT) $(MASTER) | \
402	$(AWK) -F: '{if ($$1 != "+") \
403		print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
404		> $(PASSWD) ; fi
405
406
407passwd.byname: $(PASSWD)
408	@echo "Updating $@..."
409	@echo $@.$$$$ > $(NFILE)
410	$(CAT) $(PASSWD) | \
411	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
412		| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP)
413	@$(MV) $(TMP) $@
414	@$(DBLOAD) -c
415	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
416	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
417
418
419passwd.byuid: $(PASSWD)
420	@echo "Updating $@..."
421	@echo $@.$$$$ > $(NFILE)
422	$(CAT) $(PASSWD) | \
423	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
424		| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP)
425	@$(MV) $(TMP) $@
426	@$(DBLOAD) -c
427	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
428	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
429	@$(MAKE) -f ../Makefile netid
430
431
432group.byname: $(GROUP)
433	@echo "Updating $@..."
434	@echo $@.$$$$ > $(NFILE)
435	$(CAT) $(GROUP) | \
436	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
437		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP)
438	@$(MV) $(TMP) $@
439	@$(DBLOAD) -c
440	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
441	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
442
443
444group.bygid: $(GROUP)
445	@echo "Updating $@..."
446	@echo $@.$$$$ > $(NFILE)
447	$(CAT) $(GROUP) | \
448	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
449		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP)
450	@$(MV) $(TMP) $@
451	@$(DBLOAD) -c
452	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
453	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
454	@$(MAKE) -f ../Makefile netid
455
456
457netid.byname: $(GROUP) $(PASSWD)
458	@echo "Updating $@..."
459	@echo $@.$$$$ > $(NFILE)
460	@$(MKNETID) $(PASSWD) $(GROUP) `basename \`pwd\`` \
461		| $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP)
462	@$(MV) $(TMP) $@
463	@$(DBLOAD) -c
464	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
465	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
466
467
468master.passwd.byname: $(MASTER)
469	@echo "Updating $@..."
470	@echo $@.$$$$ > $(NFILE)
471	$(CAT) $(MASTER) | \
472	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
473		| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP)
474	@$(MV) $(TMP) $@
475	@$(DBLOAD) -c
476	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
477	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
478
479
480master.passwd.byuid: $(MASTER)
481	@echo "Updating $@..."
482	@echo $@.$$$$ > $(NFILE)
483	$(CAT) $(MASTER) | \
484	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
485		| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP)
486	@$(MV) $(TMP) $@
487	@$(DBLOAD) -c
488	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
489	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
490