From 1fe3e67a3fd912e9260eddc9cdf95590b352cceb Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 25 Jun 1996 20:28:07 +0000 Subject: [PATCH] Toss old mknetid script into the attic. Adjust things slightly to support the new mknetid program. --- usr.sbin/ypserv/Makefile | 5 +---- usr.sbin/ypserv/Makefile.yp | 7 ++++--- usr.sbin/ypserv/mknetid | 36 ------------------------------------ 3 files changed, 5 insertions(+), 43 deletions(-) delete mode 100755 usr.sbin/ypserv/mknetid diff --git a/usr.sbin/ypserv/Makefile b/usr.sbin/ypserv/Makefile index 340a4cc8d5d6..4b2520b3b22e 100644 --- a/usr.sbin/ypserv/Makefile +++ b/usr.sbin/ypserv/Makefile @@ -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 diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp index b8f474cccb6e..8152c76732c6 100644 --- a/usr.sbin/ypserv/Makefile.yp +++ b/usr.sbin/ypserv/Makefile.yp @@ -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 diff --git a/usr.sbin/ypserv/mknetid b/usr.sbin/ypserv/mknetid deleted file mode 100755 index 6619b5d8acf1..000000000000 --- a/usr.sbin/ypserv/mknetid +++ /dev/null @@ -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