[OpenAFS-devel] pr_Initialize falis when called within a simple application

John Hayes jhh@envirobat.org
Thu, 5 Aug 2004 14:26:00 -0400 (EDT)


I have recemtly begun working on an application that must use the openafs
libraries. I am trying to put to gether a very simple test fixture to
begin experimenting with the concept.

When I call pr_Initialize it fails with the following error message:
jhh@jhh:~/work/projects/afs_support> ./afstest jhh "};)-8" test test
libprot: Could not locate cell msu.edu in /usr/vice/etc/CellServDB
70354689

The contents of the CellServDB file follows:
jhh:/home/jhh # more /usr/vice/etc/CellServDB
>msu.edu                #Michigan State University Home Cell
35.9.7.10               #afsdb0.cl.msu.edu

The contents of the ThisCell file are:
jhh:/home/jhh # more /usr/vice/etc/ThisCell
msu.edu

The source code for the test fixture is:
#include <afs/stds.h>
#include <afs/ptint.h>
#include <afs/kautils.h>
#include <afs/ptclient.h>
#include <stdio.h>


extern struct ubik_client *pruclient;


main ( int argc, char *argv [] )

{
        char cellname [64],
             *cellnameptr = ( char * ) malloc ( 64 );

        char    *Reason = (char *) malloc ( 256 );

        strcpy(cellname, "msu.edu" );

        int     retval = 0;

        Date LifeTime = 24 * 3600;

        long password_expires = -1;

        pruclient = NULL;

        retval = pr_Initialize ( 1L, AFSDIR_CLIENT_ETC_DIRPATH,
&cellnameptr );

        if ( ! retval )
        {
                setpag ();

                retval = ka_UserAuthenticateGeneral (   KA_USERAUTH_VERSION,
                                                        argv [ 1 ],
                                                        NULL,
                                                        NULL,
                                                        argv [ 2 ],
                                                        0,
                                                        &password_expires,
                                                        0,
                                                        &Reason);
        }

        pr_End ();

        printf ( "%d\n", retval );
}

Any information at all as to how to solve the problem would be greatly
appreciated.

Thanks,
John Hayes