#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
# All Rights Reserved
#
# Portions of this source code were derived from Berkeley
# under license from the Regents of the University of
# California.
#
#----
# It is somewhat confusing to note that Solaris 2.x uses /etc/auto_master
# instead of the 4.x /etc/auto.master file name because of NIS+ treating a
# "." in a special way.
#
# Set the following variable to "-b" to have NIS servers use the domain name
# resolver for hosts not in the current domain.
#B=-b
B=
#
# If the ipnodes (IPv6 hosts file) lives in a directory other than
#
#
# If the auth_attr, exec_attr, prof_attr files
# need to change the following line.
#
#
# If the passwd, shadow and/or adjunct files used by rpc.yppasswdd
# live in directory other than /etc then you'll need to change the
# following line.
# to find it with grep "^PWDIR" ...
#
k:
fi; \
fi
(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; \
(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; \
(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; \
(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; \
else \
(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byname; \
(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$3); print $$0 }' $(PWDIR)/passwd $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/passwd.byuid; \
fi
@echo "updated passwd";
@if [ ! $(NOPUSH) ]; then echo "pushed passwd"; fi
@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(DIR)/group $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/group.byname;
@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$3); print $$0 }' $(DIR)/group $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/group.bygid;
@echo "updated group";
@if [ ! $(NOPUSH) ]; then echo "pushed group"; fi
@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(DIR)/project $(CHKPIPE))| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/project.byname;
@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { printf("%-10d ", $$2); print $$0 }' $(DIR)/project $(CHKPIPE)) | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/project.byprojid;
@echo "updated project";
@if [ ! $(NOPUSH) ]; then echo "pushed project"; fi
@echo "updated ipnodes";
@if [ ! $(NOPUSH) ]; then echo "pushed ipnodes"; fi
@echo "updated hosts";
@if [ ! $(NOPUSH) ]; then echo "pushed hosts"; fi
@echo "updated ethers";
@if [ ! $(NOPUSH) ]; then echo "pushed ethers"; fi
'{print $$1, $$0; for (i = 3;i <= NF;i++) print $$i,$$0}' \
@echo "updated networks";
@if [ ! $(NOPUSH) ]; then echo "pushed networks"; fi
@(awk 'BEGIN { OFS="\t"; } \
$$1 !~ /^#/ { split($$2,pp,"/"); printf("%s/%s %s\n", $$1, pp[2], $$0);\
if (seen[$$1] == "") {\
printf("%s %s\n", $$1, $$0); seen[$$1]=$$1;} \
for (i = 3; i <= NF && $$i !~ /^#/; i++) {\
if (seen[$$i] == "") {\
printf("%s %s\n", $$i, $$0); seen[$$i]=$$i;} \
printf("%s/%s %s\n", $$i, pp[2], $$0)}}' \
@echo "updated services";
@if [ ! $(NOPUSH) ]; then echo "pushed services"; fi
@echo "updated rpc";
@if [ ! $(NOPUSH) ]; then echo "pushed rpc"; fi
'{print $$1,$$0; for (i = 3;i <= NF;i++) print $$i, $$0}' \
@echo "updated protocols";
@if [ ! $(NOPUSH) ]; then echo "pushed protocols"; fi
@echo "updated netgroup";
@if [ ! $(NOPUSH) ]; then echo "pushed netgroup"; fi
@echo "updated bootparams";
@if [ ! $(NOPUSH) ]; then echo "pushed bootparams"; fi
aliases.time: $(ALIASES)
@echo "updated aliases";
@if [ ! $(NOPUSH) ]; then echo "pushed aliases"; fi
@echo "updated netmasks";
@if [ ! $(NOPUSH) ]; then echo "pushed netmasks"; fi
@echo "updated publickey";
@if [ ! $(NOPUSH) ]; then echo "pushed publickey"; fi
@echo "updated netid";
@if [ ! $(NOPUSH) ]; then echo "pushed netid"; fi
# Old way. Could be restored by PSARC decision.
#
#passwd.adjunct.time: $(PWDIR)/security/passwd.adjunct
# @(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | \
# $(MAKEDBM) -s - $(YPDBDIR)/$(DOM)/passwd.adjunct.byname;
# @chmod 600 $(YPDBDIR)/$(DOM)/passwd.adjunct.byname.dir;
# @chmod 600 $(YPDBDIR)/$(DOM)/passwd.adjunct.byname.pag;
# @touch passwd.adjunct.time
# @echo "updated passwd.adjunct";
# @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) passwd.adjunct.byname; fi
# @if [ ! $(NOPUSH) ]; then echo "pushed passwd.adjunct"; fi
(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; \
else \
(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/passwd.adjunct $(CHKPIPE)) | \
fi
@echo "updated passwd.adjunct";
@if [ ! $(NOPUSH) ]; then echo "pushed passwd.adjunct"; fi
@(awk 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ { print $$1, $$0 }' $(PWDIR)/security/group.adjunct $(CHKPIPE)) | \
@echo "updated group.adjunct";
@if [ ! $(NOPUSH) ]; then echo "pushed group.adjunct"; fi
| awk '{for (i = 2; i<=NF; i++) print $$i, $$0}' \
echo "updated timezone"; \
if [ ! $(NOPUSH) ]; then \
$(YPPUSH) timezone.byname; \
echo "pushed timezone"; \
else \
: ; \
fi \
else \
fi
-@if [ -f $(DIR)/auto_master ]; then \
echo "updated auto.master"; \
if [ ! $(NOPUSH) ]; then \
$(YPPUSH) auto.master; \
echo "pushed auto.master"; \
else \
: ; \
fi \
else \
fi
echo "updated auto.home"; \
if [ ! $(NOPUSH) ]; then \
echo "pushed auto.home"; \
else \
: ; \
fi \
else \
fi
-e 's/\\$$/\\/;t l' -e } \
| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
echo "updated auth_attr"; \
if [ ! $(NOPUSH) ]; then \
echo "pushed auth_attr"; \
else \
: ; \
fi \
else \
fi
-e 's/\\$$/\\/;t l' -e } \
| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
echo "updated exec_attr"; \
if [ ! $(NOPUSH) ]; then \
echo "pushed exec_attr"; \
else \
: ; \
fi \
else \
fi
-e 's/\\$$/\\/;t l' -e } \
| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
echo "updated prof_attr"; \
if [ ! $(NOPUSH) ]; then \
echo "pushed prof_attr"; \
else \
: ; \
fi \
else \
fi
-e 's/\\$$/\\/;t l' -e } \
| (nawk 'BEGIN { FS=":"; OFS=":" } /^[a-zA-Z0-9_]/ \
echo "updated user_attr"; \
if [ ! $(NOPUSH) ]; then \
echo "pushed user_attr"; \
else \
: ; \
fi \
else \
fi
(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; \
touch ageing.time; \
echo "updated ageing"; \
else \
fi
$(DIR)/auto_master: