[OpenAFS-devel] pr_Initialize falis when called within a
simple application
John Hayes
jhh@envirobat.org
Fri, 6 Aug 2004 11:58:43 -0400 (EDT)
I made a couple of modifications to my test program and the error I
reported (70354689) went away to be replaced by a different one. Now
pr_Initialize returns a 0, indicating success and so the process call:
ka_UserAuthenticateGeneral
which fails with the following code:
R: 0 # this is the value from pr_Initialize
180491 #this is the value from ka_UserAuthenticateGeneral
I have looked in the openafs source code for the definition of this number
and am trying to follow the path through but I though somebody else may
already know that is going on with it.
That may have been the original error that caused me to start twiddling
everything.
My modified program follows:
#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 [ 1024 ] = "msu.edu",
dirpath [ 1024 ] = "/usr/vice/etc",
*Reason = (char *) malloc ( 1024 ),
*UserName = (char *) malloc ( 1024 ),
*Password = (char *) malloc ( 1024 );
int retval = 0;
Date LifeTime = 24 * 3600;
long password_expires = -1;
pruclient = NULL;
strcpy ( UserName, argv [ 1 ] );
strcpy ( Password, argv [ 2 ] );
retval = pr_Initialize ( 1L, dirpath, cellname );
printf ( "R: %d\n", retval );
if ( ! retval )
{
setpag ();
retval = ka_UserAuthenticateGeneral (
KA_USERAUTH_ONLY_VERIFY,
UserName,
"",
"",
Password,
0,
0,
0,
&Reason);
}
pr_End ();
printf ( "%d, %s\n", retval, Reason );
}
Thanks,
John Hayes
> On Thu, 5 Aug 2004, John Hayes wrote:
>
>> 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
>
> translate_et 70354689
> 70354689 (acfg).1 = could not find entry
>
> That would be AFSCONF_NOTFOUND
>
> pr_Initialize calls:
> code = afsconf_GetCellInfo(tdir, cell, "afsprot", &info);
> if (code) {
> fprintf(stderr, "libprot: Could not locate cell %s in
> %s/%s\n",
> cell, confDir, AFSDIR_CELLSERVDB_FILE);
> return code;
> }
>
> The only thing interesting here is "afsprot", which in GetCellInfo
> triggers:
> if (aservice) {
> tservice = afsconf_FindService(aservice);
> if (tservice < 0) {
> UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; /*
> service
> not found */
> }
>
>
> But in our serviceTable we have:
> {"afsprot", 7002,},
>
> So I assume afsconf_Open somehow fails or fails to parse CellServDB: is it
> readable to the user you're running this as? Can you point us at a literal
> copy of the file? (like, cp it somewhere)
>
>
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel
>
--
Once you set foot on this path, you see it everywhere!