yppasswd program modification

From: Marcel A. Bernards <bernards_at_ecn.nl>
Date: Tue, 21 Nov 1995 11:42:01 +0100

Hi all OSF managers.
I'm fighting with the Sun yppasswd.x and yppasswd.c from Theo de Raadt <deraadt_at_fsa.ca>
This source seems to have a slightly different clnt_call rpc call than the one
generated by rpcgen, so I modded the source slightly to use the yppasswd_clnt.c

This all is because I want a modified yppasswd to update multiple domains simultanious.

I can get a working executable and it seems to communicate with yppasswdd, but no update
is done.

This is the part where things seems to go wrong
[ getpass and stuff deleted ]

  /* The yppasswd.x file said `unix authentication required',
   * so I added it. This is the only reason it is in here.
   */
  clnt = clnt_create( master, YPPASSWDPROG, YPPASSWDVERS, "udp" );
  clnt->cl_auth = authunix_create_default();
  timeout.tv_sec = 25; timeout.tv_usec = 0;
  r = yppasswdproc_update_1(&yppasswd,clnt);
         
  if (r) {
      clnt_perrno(r);
      fprintf( stderr, "\n" );
  }

  printf("The YP password has%s been changed on %s.\n",
                (r) ? " not" : "", master);

  auth_destroy( clnt->cl_auth );
  clnt_destroy( clnt );
  exit ((r) != 0);
}


---
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */
#include <rpc/rpc.h>
#include "yppasswd.h"
/* Default timeout can be changed using clnt_control() */
static struct timeval TIMEOUT = { 25, 0 };
int *
yppasswdproc_update_1(argp, clnt)
        yppasswd *argp;
        CLIENT *clnt;
{
        static int res;
        bzero((char *)&res, sizeof(res));
        if (clnt_call(clnt, YPPASSWDPROC_UPDATE, xdr_yppasswd, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
                return (NULL);
        }
        return (&res);
}
------
Anyone has ever managed to get a working NIS yppasswd program from this sources ?
Thanx in advance.
Marcel Bernards, UNIX & Net sysadm Netherlands Energy Research Foundation ECN
(and SURFnet IC/ICP), Phone: (+31 /0)224 564579 Fax: (+31 /0)224 561864
E-Mail: Bernards_at_ECN.NL, SnailMail: P.O. Box 1, 1755 ZG Petten 
SCREAMNet : AAAAAARGHH!HUH?? : Disclaimer: "The AntiChrist is the Internet !" 
Received on Tue Nov 21 1995 - 12:24:07 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT