Summary: Memory fault (Coredump) with pswd validation program

From: jasper Hoon <jasperhoon_at_webmail.co.za>
Date: Wed, 30 May 2001 08:44:01 +0200

The problem was indeed with the incorrect passing of arguments.

Many thanks to the following people who sent information as well as
replacement code!

Stanislav S. Anokhin <stas_at_peterstar.com>
Dr. Thomas.Blinn_at_Compaq.com <tpb_at_doctor.zk3.dec.com>
<LHERCAUD_at_bouyguestelecom.fr>
James Sainsbury <sainsb_j_at_chem.usyd.edu.au>
Jeff Sullivan <jps_at_zk3.dec.com>
Ann Majeske <Ann.Majeske_at_compaq.com>
Roetman, Paul <PRoetman_at_CSXLines.com>

The correct way is shown here:
===========
#include <stdio.h>
#include <stdlib.h>
#include <prot.h>
#include <sia.h>
#include <siad.h>
main (int argc, char *argv[])
{
      int auth_status;
      int myargc;
      char *myargv[2];

      myargc = 1;
      myargv[0] = "chkpass";
      myargv[1] = NULL;

auth_status=sia_validate_user(NULL,myargc,myargv,NULL,argv[1],
NULL,0,NULL , argv[2]);

      if( auth_status != SIASUCCESS){
              printf("wrong password \n");
              return(1);
      }
      printf("right password \n");
      return 0;
}
==============
________________________________________________________________
Mid-year intake! Enrol NOW & stand a chance to win 25% discount
http://www.milpark.co.za
Received on Wed May 30 2001 - 06:43:31 NZST

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