Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2006 09:37:09 +0000
From:      Andreas Steinel <lnxbil@cs.uni-sb.de>
To:        freebsd-bugs@freebsd.org
Subject:   Bug or not? Using Linux-NIS-Clients with FreeBSD-NIS-Server
Message-ID:  <200603170937.15317.lnxbil@cs.uni-sb.de>

next in thread | raw e-mail | index | archive | help
--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603170937.15317.lnxbil>