calling yppasswd

mcdonald at AEDC-VAX.AF.MIL mcdonald at AEDC-VAX.AF.MIL
Fri Apr 19 00:30:38 AEST 1991


Yesterday I posted a request on how ypchpass changed the various fields of
the NIS password entry for users.

<brendan at illyria.wpd.sgi.com> responded with the following reply:
------------------------------------------------------------------------------
> Any information on how ypchpass works or how to change YP databases from the
> client side will be appreciated.

See /usr/include/rpcsvc/yppasswd.h and yppasswd(3R).  Set the oldpass
member of struct yppasswd to "" if you aren't changing pw_passwd, only
pw_gecos etc.

/be
------------------------------------------------------------------------------


#include <stdio.h>
#include <pwd.h>
#include <rpcsvc/yppasswd.h>

main()
{
   struct passwd *pw;
   static char oldpass[10]="";

   pw=getpwnam("c60244");
   strcpy(pw->pw_gecos,"NEW GECOS FIELD");

   printf("retval=%d\n",yppasswd(oldpass,pw));
}


THIS IS WHAT MY NIS PASSWORD ENTRY LOOKS LIKE (both before & after running the
above program & retval=-1):

c60244:4jT4D3x.F21G2:3007:3007:Kenny McDonald,EAF 1001,3413:/net/ccfiris/usr1/pe
ople/c60244:/bin/csh

I have tried setting the new passwd to "" & oldpass to "" and nothing happens.
I have tried setting the oldpass to my unencrypted password and the only thing
that changes is my password field.

Does anyone know exactly how this is supposed to be done?
Any help will be appreciated.


  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  | Kenneth M. McDonald * OAO Corp * Arnold Engineering Development Center |
  |          MS 120 * Arnold AFS, TN 37389-9998 * (615) 454-3413           |
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  INTERNET:
  mcdonald at aedc-vax.af.mil

  LOCAL:
  c60244 at ccfiris



More information about the Comp.sys.sgi mailing list