Toss old mknetid script into the attic.
Adjust things slightly to support the new mknetid program.
This commit is contained in:
parent
7dc8618317
commit
091efb042f
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.3 1995/12/23 21:35:27 wpaul Exp $
|
||||
# $Id: Makefile,v 1.4 1996/04/28 04:38:45 wpaul Exp $
|
||||
|
||||
PROG= ypserv
|
||||
SRCS= yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
|
||||
@ -35,9 +35,6 @@ afterinstall:
|
||||
@if [ ! -f ${DESTDIR}/var/yp/Makefile.dist ]; then \
|
||||
ln -s ${DESTDIR}/var/yp/Makefile.dist \
|
||||
${DESTDIR}/var/yp/Makefile; fi
|
||||
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
||||
${.CURDIR}/mknetid \
|
||||
${DESTDIR}/usr/libexec/mknetid
|
||||
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
||||
${.CURDIR}/mkaliases \
|
||||
${DESTDIR}/usr/libexec/mkaliases
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Makefile for the NIS databases
|
||||
#
|
||||
# $Id: Makefile.yp,v 1.5 1996/06/03 16:24:32 wpaul Exp $
|
||||
# $Id: Makefile.yp,v 1.6 1996/06/05 02:01:27 wpaul Exp $
|
||||
#
|
||||
# This Makefile should only be run on the NIS master server of a domain.
|
||||
# All updated maps will be pushed to all NIS slave servers listed in the
|
||||
@ -102,6 +102,7 @@ MASTER = $(MASTER_PASSWD)
|
||||
.endif
|
||||
YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain
|
||||
PUBLICKEY = $(YPSRCDIR)/publickey
|
||||
NETID = $(YPSRCDIR)/netid
|
||||
|
||||
target:
|
||||
@$(RM) $(NFILE)
|
||||
@ -457,8 +458,8 @@ group.bygid: $(GROUP)
|
||||
netid.byname: $(GROUP) $(PASSWD)
|
||||
@echo "Updating $@..."
|
||||
@echo $@.$$$$ > $(NFILE)
|
||||
@$(MKNETID) $(PASSWD) $(GROUP) `basename \`pwd\`` \
|
||||
| $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP)
|
||||
@$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \
|
||||
-d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP)
|
||||
@$(MV) $(TMP) $@
|
||||
@$(DBLOAD) -c
|
||||
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
|
||||
|
@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Produce netid.byname map file
|
||||
#
|
||||
# Written by O.Kirch, 1994.
|
||||
#
|
||||
PASSWD=$1
|
||||
GROUP=$2
|
||||
DOMAIN=$3
|
||||
|
||||
tempsed=/tmp/pass.$$
|
||||
|
||||
# First, get all login/uid info from passwd file
|
||||
grep -v '^+:' $PASSWD |
|
||||
awk -F: '{ printf "s/^%s:/%s/\n", $1, $3; }' >$tempsed
|
||||
# next one is a giant pipe:
|
||||
grep -v '^+:' $GROUP |
|
||||
grep -v ':[ ]*$' |
|
||||
sed 's/^[^:]*:[^:]*:\([0-9]*\):\(.*\)/\1,\2/' |
|
||||
awk -F, '{ for (n=2; n<=NF; n++)
|
||||
if ($n != "") print $n":\t"$1;
|
||||
}' |
|
||||
sed -f $tempsed | sort | grep -v ':' |
|
||||
awk 'BEGIN { uid=-1; }
|
||||
{ if (uid == $1) {
|
||||
groups=groups","$2;
|
||||
} else {
|
||||
if (uid != -1)
|
||||
print uid":"groups;
|
||||
uid=$1; groups=$2;
|
||||
}
|
||||
}
|
||||
END { if (uid != -1) printf("%s:%s\n", uid, groups); }' |
|
||||
sed "s/\(.*\):/unix.\1@$DOMAIN &/"
|
||||
rm -f $tempsed
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user