HardenedBSD/gnu/usr.sbin/yppasswdd/yppasswd_xdr.c
Bill Paul 6c394ac5f9 Obtained from: The NYS project
This is a ported/modified version of yppasswd from the NYS yppasswd-0.5
package. This package has code in it from both Olaf Kirch and Theo
de Raadt. There are GPL references and BSD-style copyright all over the
place... hopefully I won't get flamed into oblivion for commiting this.

This program has been modified from the original in the following ways:

- Changed the ALLOW_CHFN and ALLOW_CHSH compile-time options into
  run-time options.

- Demolished the password update functions and replaced them with
  routines to handle FreeBSD-style passwordd databases. It is expected
  that a seperate master.passwd file will be maintained for use with
  the NIS maps. yppasswd will have to be told where it is:

  % yppasswdd -m /var/yp/master.passwd

  A /var/yp/passwd file will be generated from /var/yp/master.passwd by
  /var/yp/Makefile. When yppasswdd has finished modifying the master.passwd
  file, it will invoke /usr/libexec/yppwupdate, which is a script that
  will run /var/yp/Makefile to generate new maps and push them.

Note that there are copies if pw_util.c and pw_copy.c here. This is
deliberate: they are *not* identical to the originals. Very similar, yes,
but not identical. *sigh*
1995-01-31 09:12:52 +00:00

58 lines
1.1 KiB
C

/*
* yppasswdd
* Copyright 1994 Olaf Kirch, <okir@monad.swb.de>
*
* This program is covered by the GNU General Public License, version 2.
* It is provided in the hope that it is useful. However, the author
* disclaims ALL WARRANTIES, expressed or implied. See the GPL for details.
*
* This file was generated automatically by rpcgen from yppasswd.x, and
* editied manually.
*/
#include <rpc/rpc.h>
#include "yppasswd.h"
bool_t
xdr_xpasswd(XDR *xdrs, xpasswd *objp)
{
if (!xdr_string(xdrs, &objp->pw_name, ~0)) {
return (FALSE);
}
if (!xdr_string(xdrs, &objp->pw_passwd, ~0)) {
return (FALSE);
}
if (!xdr_int(xdrs, &objp->pw_uid)) {
return (FALSE);
}
if (!xdr_int(xdrs, &objp->pw_gid)) {
return (FALSE);
}
if (!xdr_string(xdrs, &objp->pw_gecos, ~0)) {
return (FALSE);
}
if (!xdr_string(xdrs, &objp->pw_dir, ~0)) {
return (FALSE);
}
if (!xdr_string(xdrs, &objp->pw_shell, ~0)) {
return (FALSE);
}
return (TRUE);
}
bool_t
xdr_yppasswd(XDR *xdrs, yppasswd *objp)
{
if (!xdr_string(xdrs, &objp->oldpass, ~0)) {
return (FALSE);
}
if (!xdr_xpasswd(xdrs, &objp->newpw)) {
return (FALSE);
}
return (TRUE);
}