Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2002 04:15:06 -0800
From:      "Crist J. Clark" <crist.clark@attbi.com>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        Mark Murray <mark@grondar.za>, 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>
In-Reply-To: <Pine.NEB.3.96L.1020318081017.13492G-100000@fledge.watson.org>; from rwatson@FreeBSD.org on Mon, Mar 18, 2002 at 08:11:20AM -0500
References:  <200203181302.g2ID28H5020685@grimreaper.grondar.org> <Pine.NEB.3.96L.1020318081017.13492G-100000@fledge.watson.org>

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




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