Subject: Re: NIS/yp/passwd not compatible 1.5 -> 1.5.1?
To: cpctc <cpctc@vt.edu>
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
List: netbsd-help
Date: 09/18/2001 04:26:00
On Mon, 17 Sep 2001, cpctc wrote:
> I get the same behavior on a 1.5 nis client, 1.5.1 nis client, and the 1.5 nis server.

I can reproduce the problem w/ a 1.5.2 client and a 1.5.2 server (both
running on the same machine). Let me say first that I'm no NIS/YP guru!
The patch below might fix your problem, though - please apply & rebuild
chfn etc.:

	cd /usr/src/usr.bin/chpass
	patch <patchfile
	make
	make install

Let me know if this helps. 


 - Hubert


Index: Makefile
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/chpass/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	1997/10/24 09:00:22	1.10
+++ Makefile	2001/09/18 02:23:39
@@ -10,7 +10,7 @@
 MLINKS=	chpass.1 chfn.1 chpass.1 chsh.1
 CPPFLAGS+=-DYP -I${.CURDIR}/../../lib/libc/include
 DPADD+= ${LIBRPCSVC} ${LIBUTIL}
-LDADD+= -lrpcsvc -lutil
+LDADD+= -lrpcsvc -lutil -lcrypt
 
 .include <bsd.prog.mk>
 
Index: pw_yp.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/chpass/pw_yp.c,v
retrieving revision 1.15.8.3
diff -u -r1.15.8.3 pw_yp.c
--- pw_yp.c	2000/11/15 18:53:39	1.15.8.3
+++ pw_yp.c	2001/09/18 02:23:39
@@ -169,7 +169,19 @@
 
 	/* tell rpc.yppasswdd */
 	yppasswd.newpw.pw_name	 = strdup(pw->pw_name);
+/* printf("HF: yppasswd.oldpass='%s', pw->pw_passwd='%s'\n", yppasswd.oldpass, pw->pw_passwd); */
+#if 0
 	yppasswd.newpw.pw_passwd = strdup(pw->pw_passwd);
+#else
+	{
+		char salt[3];
+		salt[0] = 'a' + rand() % 26;
+		salt[1] = 'Z' + rand() % 26;
+		salt[2] = '\0';
+/* printf("HF: salt='%s', crypt()='%s'\n", salt, crypt(yppasswd.oldpass, salt)); */
+		yppasswd.newpw.pw_passwd = strdup(crypt(yppasswd.oldpass, salt));
+	}
+#endif
 	yppasswd.newpw.pw_uid 	 = pw->pw_uid;
 	yppasswd.newpw.pw_gid	 = pw->pw_gid;
 	yppasswd.newpw.pw_gecos  = strdup(pw->pw_gecos);

-- 
Want to get a clue on IPv6 but don't know where to start? Try this:
* Basics -> http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html
* Setup  -> http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html 
Of course with your #1 IPv6 ready operating system -> http://www.NetBSD.org/