From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 17 09:37:21 2006 Return-Path: X-Original-To: freebsd-bugs@freebsd.org Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFEBA16A401 for ; Fri, 17 Mar 2006 09:37:21 +0000 (UTC) (envelope-from lnxbil@cs.uni-sb.de) Received: from uni-sb.de (uni-sb.de [134.96.252.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5331943D46 for ; Fri, 17 Mar 2006 09:37:20 +0000 (GMT) (envelope-from lnxbil@cs.uni-sb.de) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by uni-sb.de (8.13.5/2006012700) with ESMTP id k2H9bJFu026329 for ; Fri, 17 Mar 2006 10:37:19 +0100 (CET) Received: from xantippe (xantippe.cs.uni-sb.de [134.96.240.13]) by mail.cs.uni-sb.de (8.13.5/2006012700) with ESMTP id k2H9bIiX019015 for ; Fri, 17 Mar 2006 10:37:18 +0100 (CET) Received: from balora [134.96.240.85] by xantippe with esmtp (Exim 3.35 #1 (Debian))id 1FKBOX-0005eV-00 for ; Fri, 17 Mar 2006 10:37:17 +0100 From: Andreas Steinel To: freebsd-bugs@freebsd.org Date: Fri, 17 Mar 2006 09:37:09 +0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1660472.KSLsHtReuI"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200603170937.15317.lnxbil@cs.uni-sb.de> Subject: Bug or not? Using Linux-NIS-Clients with FreeBSD-NIS-Server X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Mar 2006 09:37:22 -0000 --nextPart1660472.KSLsHtReuI Content-Type: multipart/mixed; boundary="Boundary-01=_GNoGENRGSiQzQs+" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_GNoGENRGSiQzQs+ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I found it difficult to setup Linux-NIS-Clients with a FreeBSD-NIS-Server.= =20 After googling for a while, I found some patches for /var/yp/Makefile. It=20 seams to me, that only few people have this problems. Only 2 posts found=20 about this topic. According to this post, I successfully setup a Linux-NIS-Client with a=20 =46reeBSD-NIS-Server: http://lists.freebsd.org/pipermail/freebsd-bugs/2004-May/006818.html After gaving such problems I think about a uniform solution to this problem= =20 and I start to alter /var/yp/Makefile in such a way that one can set a=20 variable (in this case LINUXCOMPMODE) and you are able to use=20 Linux-NIS-Clients (and FreeBSD-ones too). Please find the patch attached. I suggest to include it in the official=20 release. With best regards Andreas Steinel =2D-=20 Andreas Steinel email: lnxbil@xantippe.cs.uni-sb.de Zimmer 122 web: http://w5.cs.uni-sb.de Bau 36.1 Phone: +49 (0) 681 302-4135 Lehrstuhl Prof. Wahlster fax: +49 (0) 12 12 / 52 35 64 89 =46akult=E4t 6 - Informatik =20 Universit=E4t des Saarlandes =20 66123 Saarbr=FCcken =20 GPG-Fingerprint: C09D 96DD 548C 8F13 097A 8D04 8329 7BEA A623 11D6 --Boundary-01=_GNoGENRGSiQzQs+ Content-Type: text/x-diff; charset="iso-8859-1"; name="nis-clients-unter-linux.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="nis-clients-unter-linux.patch" =2D-- Makefile.dist Thu Nov 3 09:12:04 2005 +++ Makefile Fri Mar 17 09:55:48 2006 @@ -40,6 +40,11 @@ # key will be removed from these maps, allowing anyone to access them. S=3D-s =20 +# If you want to have linux NIS clients you must enable this: +# Comment the line if you have no linux NIS clients +#LINUXCOMPMODE=3D1 + + # These are commands which this Makefile needs to properly rebuild the # NIS databases. Don't change these unless you have a good reason. Also # be sure not to place an @ in front of /usr/bin/awk: it isn't necessary @@ -196,6 +201,7 @@ aliases: mail.aliases =20 master.passwd: master.passwd.byname master.passwd.byuid +master.passwd: shadow.byname =20 # # This is a special target used only when doing in-place updates with @@ -498,6 +504,16 @@ =20 $(PASSWD): $(MASTER) @echo "Creating new $@ file from $(MASTER)..." +.if defined(LINUXCOMPMODE) + @if [ ! $(UNSECURE) ]; then \ + $(AWK) -F: '{if ($$1 !=3D "" && $$1 !~ "^#.*" && $$1 !=3D "+") \ + print $$1":x:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ + > $(PASSWD) ; \ + else \ + $(AWK) -F: '{if ($$1 !=3D "" && $$1 !~ "^#.*" && $$1 !=3D "+") \ + print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ + > $(PASSWD) ; fi +.else @if [ ! $(UNSECURE) ]; then \ $(AWK) -F: '{if ($$1 !=3D "" && $$1 !~ "^#.*" && $$1 !=3D "+") \ print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ @@ -506,6 +522,7 @@ $(AWK) -F: '{if ($$1 !=3D "" && $$1 !~ "^#.*" && $$1 !=3D "+") \ print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ > $(PASSWD) ; fi +.endif =20 =20 passwd.byname: $(PASSWD) @@ -613,3 +630,20 @@ @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi =20 + +shadow.byname: $(MASTER) +.if defined(LINUXCOMPMODE) + @echo "Updating $@..." +.if ${MASTER} =3D=3D "/dev/null" + @echo "Master.passwd source file not found -- skipping" +.else + @cat $(MASTER) | \ + $(AWK) -F: '{ if ($$1 !=3D "" && $$1 !~ "^#.*" && $$1 !=3D "+") \ + print $$1"\t"$$1":"$$2":::::::" }' $^ \ + | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP)= ; \ + $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif +.endif --Boundary-01=_GNoGENRGSiQzQs+-- --nextPart1660472.KSLsHtReuI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQBEGoNLgyl76qYjEdYRAs08AKCtvpaWUZl4qN5PBu1txCZ6N8J6wACgj8MX Dlo7qMDWRVBrJz8HkeN5WlM= =S8KV -----END PGP SIGNATURE----- --nextPart1660472.KSLsHtReuI--