xref: /titanic_51/usr/src/cmd/ypcmd/net_files/Makefile (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24#      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
25#      All Rights Reserved
26#
27# Portions of this source code were derived from Berkeley
28# under license from the Regents of the University of
29# California.
30#
31# ident	"%Z%%M%	%I%	%E% SMI"
32#
33#----
34# It is somewhat confusing to note that Solaris 2.x uses /etc/auto_master
35# instead of the 4.x /etc/auto.master file name because of NIS+ treating a
36# "." in a special way.
37#
38# Set the following variable to "-b" to have NIS servers use the domain name
39# resolver for hosts not in the current domain.
40#B=-b
41B=
42DIR =/etc
43#
44# If the ipnodes (IPv6 hosts file) lives in a directory other than
45# /etc/inet, then you'll need to change the following line.
46#
47INETDIR=/etc/inet
48#
49# If the audit_user, auth_attr, exec_attr, prof_attr files
50# live in a directory other than /etc/security, then you'll
51# need to change the following line.
52#
53RBACDIR=/etc/security
54#
55# If the passwd, shadow and/or adjunct files used by rpc.yppasswdd
56# live in directory other than /etc then you'll need to change the
57# following line.
58# DO NOT indent the line, however, since /etc/init.d/yp attempts
59# to find it with grep "^PWDIR" ...
60#
61PWDIR =/etc
62DOM = `domainname`
63NOPUSH = ""
64ALIASES = /etc/mail/aliases
65YPDIR=/usr/lib/netsvc/yp
66SBINDIR=/usr/sbin
67YPDBDIR=/var/yp
68YPPUSH=$(YPDIR)/yppush
69MAKEDBM=$(SBINDIR)/makedbm
70MULTI=$(YPDIR)/multi
71REVNETGROUP=$(SBINDIR)/revnetgroup
72STDETHERS=$(YPDIR)/stdethers
73STDHOSTS=$(YPDIR)/stdhosts
74MKNETID=$(SBINDIR)/mknetid
75MKALIAS=$(YPDIR)/mkalias
76
77CHKPIPE=  || (  echo "NIS make terminated:" $@ 1>&2; kill -TERM 0 )
78
79
80k:
81	@if [ ! $(NOPUSH) ]; then $(MAKE)  $(MFLAGS) -k all; \
82	else $(MAKE) $(MFLAGS) -k all NOPUSH=$(NOPUSH);fi
83
84all: passwd group hosts ipnodes ethers networks rpc services protocols \
85	netgroup bootparams aliases publickey netid netmasks c2secure \
86	timezone auto.master auto.home ageing \
87	auth.attr exec.attr prof.attr user.attr audit.user
88
89c2secure:
90	-@if [ -f $(PWDIR)/security/passwd.adjunct ]; then \
91		if [ ! $(NOPUSH) ]; then $(MAKE)  $(MFLAGS) -k \
92		passwd.adjunct.time group.adjunct.time; \
93		else $(MAKE) $(MFLAGS) -k NOPUSH=$(NOPUSH) \
94		passwd.adjunct.time group.adjunct.time; \
95		fi; \
96	fi
97
98passwd.time: $(PWDIR)/passwd $(PWDIR)/shadow
99	-@if [ -f $(PWDIR)/security/passwd.adjunct ]; then \
100		(nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ { $$2 = "##" $$1; printf "%s\t%s\n", $$1, $$0 }' $(PWDIR)/passwd $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
101		(nawk 'BEGIN { FS=":"; OFS=":"  } /^[a-zA-Z0-9_]/ { $$2 = "##" $$1; printf "%-10d\t%s\n", $$3, $$0 }' $(PWDIR)/passwd $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
102	elif [ -f $(PWDIR)/shadow ]; then \
103		(nawk 'BEGIN { FS=":"; OFS=":"; while ( getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; printf "%s\t%s\n",$$1,$$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
104		(nawk 'BEGIN { FS=":"; OFS=":"; while ( getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; printf "%-10d\t%s\n",$$3,$$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
105	else \
106		(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/passwd  $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
107		(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$3); print $$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
108	fi
109	@touch passwd.time;
110	@echo "updated passwd";
111	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) passwd.byname; fi
112	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) passwd.byuid; fi
113	@if [ ! $(NOPUSH) ]; then echo "pushed passwd"; fi
114
115group.time: $(DIR)/group
116	@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(DIR)/group $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/group.byname;
117	@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$3); print $$0 }' $(DIR)/group $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/group.bygid;
118	@touch group.time;
119	@echo "updated group";
120	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) group.byname; fi
121	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) group.bygid; fi
122	@if [ ! $(NOPUSH) ]; then echo "pushed group"; fi
123
124project.time: $(DIR)/project
125	@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(DIR)/project $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/project.byname;
126	@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$2); print $$0 }' $(DIR)/project $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/project.byprojid;
127	@touch project.time;
128	@echo "updated project";
129	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) project.byname; fi
130	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) project.byprojid; fi
131	@if [ ! $(NOPUSH) ]; then echo "pushed project"; fi
132
133ipnodes.time: $(INETDIR)/ipnodes
134	@($(MULTI) -n $(B) -l $(INETDIR)/ipnodes);
135	@($(STDHOSTS) -wn $(INETDIR)/ipnodes $(CHKPIPE))| \
136	(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$1, $$0 }' $(CHKPIPE)) | \
137	$(MAKEDBM) $(B) - $(YPDBDIR)/$(DOM)/ipnodes.byaddr;
138	@touch ipnodes.time;
139	@echo "updated ipnodes";
140	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) ipnodes.byname; fi
141	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) ipnodes.byaddr; fi
142	@if [ ! $(NOPUSH) ]; then echo "pushed ipnodes"; fi
143
144hosts.time: $(DIR)/hosts
145	@($(MULTI) $(B) -l $(DIR)/hosts);
146	@($(STDHOSTS) -w $(DIR)/hosts $(CHKPIPE))| \
147	(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$1, $$0 }' $(CHKPIPE)) | \
148	$(MAKEDBM) $(B) - $(YPDBDIR)/$(DOM)/hosts.byaddr;
149	@touch hosts.time;
150	@echo "updated hosts";
151	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) hosts.byname; fi
152	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) hosts.byaddr; fi
153	@if [ ! $(NOPUSH) ]; then echo "pushed hosts"; fi
154
155ethers.time: $(DIR)/ethers
156	@($(STDETHERS) $(DIR)/ethers $(CHKPIPE)) \
157	|(awk '{print $$1, $$0; for (i = 3;i <= NF;i++) print $$i,$$0}' $(CHKPIPE)) \
158	| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/ethers.byaddr
159
160	@(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
161	   $(DIR)/ethers $(CHKPIPE)) | \
162	$(MAKEDBM) - $(YPDBDIR)/$(DOM)/ethers.byname;
163	@touch ethers.time;
164	@echo "updated ethers";
165	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) ethers.byname; fi
166	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) ethers.byaddr; fi
167	@if [ ! $(NOPUSH) ]; then echo "pushed ethers"; fi
168
169networks.time: $(DIR)/networks
170	@(sed -e "/^#/d" -e s/#.*$$// $(DIR)/networks $(CHKPIPE)) |( awk \
171	    '{print $$1, $$0; for (i = 3;i <= NF;i++) print $$i,$$0}' \
172	    $(CHKPIPE) )| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/networks.byname;
173	@(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
174	   $(DIR)/networks $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/networks.byaddr;
175	@touch networks.time;
176	@echo "updated networks";
177	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) networks.byname; fi
178	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) networks.byaddr; fi
179	@if [ ! $(NOPUSH) ]; then echo "pushed networks"; fi
180
181services.time: $(DIR)/services
182	@(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
183	    $(DIR)/services $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/services.byname;
184	@(awk 'BEGIN { OFS="\t"; } \
185	$$1 !~ /^#/ { split($$2,pp,"/"); printf("%s/%s %s\n", $$1, pp[2], $$0);\
186		if (seen[$$1] == "") {\
187			printf("%s %s\n", $$1, $$0); seen[$$1]=$$1;} \
188		for (i = 3; i <= NF && $$i !~ /^#/; i++) {\
189			if (seen[$$i] == "") {\
190				printf("%s %s\n", $$i, $$0); seen[$$i]=$$i;} \
191			printf("%s/%s %s\n", $$i, pp[2], $$0)}}' \
192		$(DIR)/services $(CHKPIPE)) | \
193	$(MAKEDBM) $(B) - $(YPDBDIR)/$(DOM)/services.byservicename
194
195	@touch services.time;
196	@echo "updated services";
197	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) services.byname; fi
198	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) services.byservicename; fi
199	@if [ ! $(NOPUSH) ]; then echo "pushed services"; fi
200
201rpc.time: $(DIR)/rpc
202	@(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
203	    $(DIR)/rpc $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/rpc.bynumber;
204	@touch rpc.time;
205	@echo "updated rpc";
206	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) rpc.bynumber; fi
207	@if [ ! $(NOPUSH) ]; then echo "pushed rpc"; fi
208
209protocols.time: $(DIR)/protocols
210	@(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
211	    $(DIR)/protocols $(CHKPIPE)) | $(MAKEDBM) - \
212	    $(YPDBDIR)/$(DOM)/protocols.bynumber;
213
214	@(sed -e "/^#/d" -e s/#.*$$// $(DIR)/protocols $(CHKPIPE)) |( awk \
215	    '{print $$1,$$0; for (i = 3;i <= NF;i++) print $$i, $$0}' \
216	    $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/protocols.byname;
217
218	@touch protocols.time;
219	@echo "updated protocols";
220	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) protocols.byname; fi
221	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) protocols.bynumber; fi
222	@if [ ! $(NOPUSH) ]; then echo "pushed protocols"; fi
223
224netgroup.time: $(DIR)/netgroup
225	@$(MAKEDBM) $(DIR)/netgroup $(YPDBDIR)/$(DOM)/netgroup
226	@($(REVNETGROUP) < $(DIR)/netgroup -u $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/netgroup.byuser
227	@($(REVNETGROUP) < $(DIR)/netgroup -h $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/netgroup.byhost
228	@touch netgroup.time;
229	@echo "updated netgroup";
230	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) netgroup; fi
231	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) netgroup.byuser; fi
232	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) netgroup.byhost; fi
233	@if [ ! $(NOPUSH) ]; then echo "pushed netgroup"; fi
234
235bootparams.time: $(DIR)/bootparams
236	@(sed -e '/^#/d' -e s/#.*$$// -e 's/[	 ][	 ]*$$//' \
237	    -e '/\\$$/s/\\$$/ /' $(DIR)/bootparams $(CHKPIPE))\
238	|( awk '/ $$/ {printf "%s", $$0} !/ $$/ {print}' $(CHKPIPE))\
239	|( sed -e 's/[	 ][	 ]*/ /g' $(CHKPIPE))\
240	| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/bootparams;
241	@touch bootparams.time;
242	@echo "updated bootparams";
243	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) bootparams; fi
244	@if [ ! $(NOPUSH) ]; then echo "pushed bootparams"; fi
245
246aliases.time: $(ALIASES)
247	@cp $(ALIASES) $(YPDBDIR)/$(DOM)/mail.aliases;
248	@/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliases;
249	$(MKALIAS) $(YPDBDIR)/$(DOM)/mail.aliases $(YPDBDIR)/$(DOM)/mail.byaddr;
250	@rm $(YPDBDIR)/$(DOM)/mail.aliases;
251	@touch aliases.time;
252	@echo "updated aliases";
253	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) mail.aliases; fi
254	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) mail.byaddr; fi
255	@if [ ! $(NOPUSH) ]; then echo "pushed aliases"; fi
256
257netmasks.time: $(DIR)/netmasks
258	$(MAKEDBM) $(DIR)/netmasks $(YPDBDIR)/$(DOM)/netmasks.byaddr;
259	@touch netmasks.time;
260	@echo "updated netmasks";
261	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) netmasks.byaddr; fi
262	@if [ ! $(NOPUSH) ]; then echo "pushed netmasks"; fi
263
264
265publickey.time: $(DIR)/publickey
266	@(sed "/^#/d" < $(DIR)/publickey $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/publickey.byname;
267	@touch publickey.time;
268	@echo "updated publickey";
269	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) publickey.byname; fi
270	@if [ ! $(NOPUSH) ]; then echo "pushed publickey"; fi
271
272netid.time: $(PWDIR)/passwd $(DIR)/group $(DIR)/hosts $(DIR)/netid
273	@$(MKNETID) -q -p $(PWDIR)/passwd -g $(DIR)/group -h $(DIR)/hosts -m $(DIR)/netid > .ypjunk;
274	@$(MAKEDBM) .ypjunk $(YPDBDIR)/$(DOM)/netid.byname;
275	@rm -f .ypjunk;
276	@touch netid.time;
277	@echo "updated netid";
278	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) netid.byname; fi
279	@if [ ! $(NOPUSH) ]; then echo "pushed netid"; fi
280
281# Old way.  Could be restored by PSARC decision.
282#
283#passwd.adjunct.time: $(PWDIR)/security/passwd.adjunct
284#	@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | \
285#		$(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname;
286#	@chmod 600 $(YPDBDIR)/$(DOM)/passwd.adjunct.byname.dir;
287#	@chmod 600 $(YPDBDIR)/$(DOM)/passwd.adjunct.byname.pag;
288#	@touch passwd.adjunct.time
289#	@echo "updated passwd.adjunct";
290#	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) passwd.adjunct.byname; fi
291#	@if [ ! $(NOPUSH) ]; then echo "pushed passwd.adjunct"; fi
292
293passwd.adjunct.time: $(PWDIR)/security/passwd.adjunct $(PWDIR)/shadow
294	-@if [ -f $(PWDIR)/shadow ]; then \
295		(nawk 'BEGIN { FS=":"; while (getline < "$(PWDIR)/shadow" > 0) shadow[$$1] = $$2; } /^[a-zA-Z0-9_]/ { $$2 = shadow[$$1]; OFS=":"; printf "%s\t%s\n", $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | $(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname; \
296	else \
297		(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | \
298		$(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname; \
299	fi
300	@chmod 600 $(YPDBDIR)/$(DOM)/passwd.adjunct.byname.dir;
301	@chmod 600 $(YPDBDIR)/$(DOM)/passwd.adjunct.byname.pag;
302	@touch passwd.adjunct.time
303	@echo "updated passwd.adjunct";
304	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) passwd.adjunct.byname; fi
305	@if [ ! $(NOPUSH) ]; then echo "pushed passwd.adjunct"; fi
306
307group.adjunct.time: $(PWDIR)/security/group.adjunct
308	@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/group.adjunct $(CHKPIPE)) | \
309	$(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/group.adjunct.byname;
310	@chmod 600 $(YPDBDIR)/$(DOM)/group.adjunct.byname.dir;
311	@chmod 600 $(YPDBDIR)/$(DOM)/group.adjunct.byname.pag;
312	@touch group.adjunct.time
313	@echo "updated group.adjunct";
314	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) group.adjunct.byname; fi
315	@if [ ! $(NOPUSH) ]; then echo "pushed group.adjunct"; fi
316
317timezone.time:  $(DIR)/timezone
318	-@if [ -f $(DIR)/timezone ]; then \
319		sed -e "/^#/d" -e s/#.*$$// $(DIR)/timezone \
320		| awk '{for (i = 2; i<=NF; i++) print $$i, $$0}' \
321		| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/timezone.byname; \
322		touch timezone.time; \
323		echo "updated timezone"; \
324		if [ ! $(NOPUSH) ]; then \
325			$(YPPUSH) timezone.byname; \
326			echo "pushed timezone"; \
327		else \
328		: ; \
329		fi \
330	else \
331		echo "couldn't find $(DIR)/timezone"; \
332	fi
333
334auto.master.time:  $(DIR)/auto_master
335	-@if [ -f $(DIR)/auto_master ]; then \
336		sed -e "/^#/d" -e s/#.*$$// $(DIR)/auto_master \
337		| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.master; \
338		touch auto.master.time; \
339		echo "updated auto.master"; \
340		if [ ! $(NOPUSH) ]; then \
341			$(YPPUSH) auto.master; \
342			echo "pushed auto.master"; \
343		else \
344		: ; \
345		fi \
346	else \
347		echo "couldn't find $(DIR)/auto_master"; \
348	fi
349
350auto.home.time:  $(DIR)/auto_home
351	-@if [ -f $(DIR)/auto_home ]; then \
352		sed -e "/^#/d" -e s/#.*$$// $(DIR)/auto_home \
353		| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.home; \
354		touch auto.home.time; \
355		echo "updated auto.home"; \
356		if [ ! $(NOPUSH) ]; then \
357			$(YPPUSH) auto.home; \
358			echo "pushed auto.home"; \
359		else \
360		: ; \
361		fi \
362	else \
363		echo "couldn't find $(DIR)/auto_home"; \
364	fi
365
366
367auth.attr.time:  $(RBACDIR)/auth_attr
368	-@if [ -f $(RBACDIR)/auth_attr ]; then \
369		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/auth_attr \
370		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
371		-e 's/\\$$/\\/;t l' -e } \
372		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
373		{printf "%s:%s\n", $$1, $$0 }' $(CHKPIPE)) \
374		| $(MAKEDBM) -S ":" -E - $(YPDBDIR)/$(DOM)/auth_attr; \
375		touch auth.attr.time; \
376		echo "updated auth_attr"; \
377		if [ ! $(NOPUSH) ]; then \
378			$(YPPUSH) auth_attr; \
379			echo "pushed auth_attr"; \
380		else \
381		: ; \
382		fi \
383	else \
384		echo "couldn't find $(RBACDIR)/auth_attr"; \
385	fi
386
387exec.attr.time:  $(RBACDIR)/exec_attr
388	-@if [ -f $(RBACDIR)/exec_attr ]; then \
389		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/exec_attr \
390		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
391		-e 's/\\$$/\\/;t l' -e } \
392		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
393		{printf "%s:%s:%s:%s\n", $$1, $$2, $$6, $$0 }' $(CHKPIPE)) \
394		| $(MAKEDBM) -S ":" -E -D 2 - $(YPDBDIR)/$(DOM)/exec_attr; \
395		touch exec.attr.time; \
396		echo "updated exec_attr"; \
397		if [ ! $(NOPUSH) ]; then \
398			$(YPPUSH) exec_attr; \
399			echo "pushed exec_attr"; \
400		else \
401		: ; \
402		fi \
403	else \
404		echo "couldn't find $(RBACDIR)/exec_attr"; \
405	fi
406
407prof.attr.time:  $(RBACDIR)/prof_attr
408	-@if [ -f $(RBACDIR)/prof_attr ]; then \
409		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/prof_attr \
410		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
411		-e 's/\\$$/\\/;t l' -e } \
412		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
413		{printf "%s:%s\n", $$1, $$0 }' $(CHKPIPE)) \
414		| $(MAKEDBM) -S ":" -E - $(YPDBDIR)/$(DOM)/prof_attr; \
415		touch prof.attr.time; \
416		echo "updated prof_attr"; \
417		if [ ! $(NOPUSH) ]; then \
418			$(YPPUSH) prof_attr; \
419			echo "pushed prof_attr"; \
420		else \
421		: ; \
422		fi \
423	else \
424		echo "couldn't find $(RBACDIR)/prof_attr"; \
425	fi
426
427user.attr.time:  $(DIR)/user_attr
428	-@if [ -f $(DIR)/user_attr ]; then \
429		sed -e "/^#/d" -e s/#.*$$// $(DIR)/user_attr \
430		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
431		-e 's/\\$$/\\/;t l' -e } \
432		| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
433		{printf "%s:%s\n", $$1, $$0 }' $(CHKPIPE)) \
434		| $(MAKEDBM) -S ":" -E - $(YPDBDIR)/$(DOM)/user_attr; \
435		touch user.attr.time; \
436		echo "updated user_attr"; \
437		if [ ! $(NOPUSH) ]; then \
438			$(YPPUSH) user_attr; \
439			echo "pushed user_attr"; \
440		else \
441		: ; \
442		fi \
443	else \
444		echo "couldn't find $(DIR)/user_attr"; \
445	fi
446
447audit.user.time:  $(RBACDIR)/audit_user
448	-@if [ -f $(RBACDIR)/audit_user ]; then \
449		sed -e "/^#/d" -e s/#.*$$// $(RBACDIR)/audit_user \
450		|sed -e '/\\$$/{:l' -e 'N;s/\\\n//;t h' -e ':h' \
451		-e 's/\\$$/\\/;t l' -e } \
452		| (nawk 'BEGIN { FS=":"; OFS="\t" } /^[a-zA-Z0-9_]/ \
453		{print $$1, $$0 }' $(CHKPIPE)) \
454		| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/audit_user; \
455		touch audit.user.time; \
456		echo "updated audit_user"; \
457		if [ ! $(NOPUSH) ]; then \
458			$(YPPUSH) audit_user; \
459			echo "pushed audit_user"; \
460		else \
461		: ; \
462		fi \
463	else \
464		echo "couldn't find $(RBACDIR)/audit_user"; \
465	fi
466
467ageing.time:  $(PWDIR)/shadow
468	-@if [ -f $(PWDIR)/shadow ]; then \
469		(awk 'BEGIN {FS=":"; OFS=":"} $$1 !~ /^#/ {printf "%s\t%s:%s:%s:%s:%s:%s:%s:%s\n", $$1,$$1,$$3,$$4,$$5,$$6,$$7,$$8,$$9}' $(PWDIR)/shadow) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/ageing.byname; \
470		touch ageing.time; \
471		echo "updated ageing"; \
472	else \
473		echo "couldn't find $(PWDIR)/shadow"; \
474	fi
475
476
477
478passwd: passwd.time
479group: group.time
480project: project.time
481hosts: hosts.time
482ipnodes: ipnodes.time
483ethers: ethers.time
484networks: networks.time
485rpc: rpc.time
486services: services.time
487protocols: protocols.time
488netgroup: netgroup.time
489bootparams: bootparams.time
490aliases: aliases.time
491publickey: publickey.time
492netid: netid.time
493passwd.adjunct: passwd.adjunct.time
494group.adjunct: group.adjunct.time
495netmasks: netmasks.time
496timezone: timezone.time
497auto.master: auto.master.time
498auto.home: auto.home.time
499auth.attr:auth.attr.time
500exec.attr:exec.attr.time
501prof.attr:prof.attr.time
502user.attr:user.attr.time
503audit.user:audit.user.time
504$(DIR)/netid:
505$(DIR)/timezone:
506$(DIR)/auto_master:
507$(DIR)/auto_home:
508$(PWDIR)/shadow:
509$(DIR)/auth_attr:
510$(DIR)/exec_attr:
511$(DIR)/prof_attr:
512$(DIR)/user_attr:
513$(DIR)/audit_user:
514ageing: ageing.time
515