From owner-cvs-all Sun Mar 24 4:15:26 2002 Delivered-To: cvs-all@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 8128637B400; Sun, 24 Mar 2002 04:15:15 -0800 (PST) Received: from blossom.cjclark.org ([12.234.91.48]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020324121515.QVQV2951.rwcrmhc53.attbi.com@blossom.cjclark.org>; Sun, 24 Mar 2002 12:15:15 +0000 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.6) id g2OCF7w81531; Sun, 24 Mar 2002 04:15:07 -0800 (PST) (envelope-from cjc) Date: Sun, 24 Mar 2002 04:15:06 -0800 From: "Crist J. Clark" To: Robert Watson Cc: Mark Murray , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/chpass chpass.c pw_copy.c pw_copy.h Message-ID: <20020324041506.K48968@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200203181302.g2ID28H5020685@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from rwatson@FreeBSD.org on Mon, Mar 18, 2002 at 08:11:20AM -0500 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Mar 18, 2002 at 08:11:20AM -0500, Robert Watson wrote: > > On Mon, 18 Mar 2002, Mark Murray wrote: > > > > This is all quite a mess. We have chpass(8) using __pw_scan from libc > > > and source in vipw(8), and PAM modules sharing all of this code > > > too. Wouldn't the Right Thing be to put these functions in a library > > > somewhere? I think NetBSD has a lot of this stuffed in libutil. > > > > There is a lot of password-related stuff spread about the tree in this > > messy way (chpass, vipw, chsh(and friends), passwd and so on). I would > > vote very strongly for such a change. > > > > I started doing it some time ago, and lost track in the tangled thread. > > A remarkably number of userland tools assume that access to passwd > information is in libc. Would such a change move this completely out of > libc and require modifying the linkages involved for all of these, or is > this a lower-level kind of thing? I think I've sorted out most of the dependencies here: usr.bin/passwd: usr.bin/chpass usr.bin/rlogin (*) usr.sbin/vipw usr.sbin/rpc.yppasswdd usr.sbin/ypserv libexec/ypxfr usr.bin/chpass: usr.sbin/pwd_mkdb usr.sbin/vipw usr.sbin/rpc.yppasswdd libexec/ypfxr lib/libc/gen usr.sbin/rpc.yppasswdd: usr.bin/chpass usr.sbin/vipw usr.sbin/ypserv libexec/ypfxr usr.sbin/pwd_mkdb: lib/libc/gen libexec/ypfxr: usr.sbin/ypserv usr.sbin/ypserv: include/rpcsrv The (*) entry for rlogin is due to the fact that I can't figure out why it is there. passwd seems to build fine without it. At the very least, one thing to make this more sane is to get rid of of the two-way dependencies. chpass depends on rpc.passwdd and rpc.passwdd depends on chpass. Put all of the code in one or the other and have one indpendent and one depend on that one. Another problem is that despite all of these cross-dependencies, we still have repeated code. Both chpass and rpc.passwdd have an pw_copy.c file based on the same code, but which have diverged. Ideally, I think putting most of the shared code into libutil and librpcsrv would be the best way to go. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message