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

John Hayes jhh@envirobat.org
Tue, 17 Aug 2004 07:55:39 -0400 (EDT)


That's disgusting! Not that you were able to make it work, but that it
wasn't such a big deal.

I tried just dropping -ldes and adding -lcrypto. It compiled just fine but
crashed all the same. I suppose that it could be adding the des library
anyway.

How do I construct a shim library to fake it out, or don't you think that
is essential?

I realize there is some junk in that code. I've been fiddling with it for
a while trying anything that came to mind. If I can just sort out how the
libraries work an what they take I can begin to make some progress.

Thanks,
John Hayes

> Works fine for me. I compiled it thusly, on Solaris 8
> cc -g -R/usr/local/lib -I/usr/local/include -L/usr/local/lib
> -L/usr/local/lib/afs -o foo foo.c -lprot -lkauth -lauth -lrxkad -lrx
> -llwp -lsys -lcom_err -lubik -ldes -lafsutil -lsocket -lnsl -lcrypto
> -lresolv
>
> Note that I have libdes replaced with a shim, which means I require
> libcrypto
>
> R1 = 0
> R2 = , 0
> R3 = 0, ANDREW.CMU.EDU, 1
> R4 = 0
> R5 = 0, 1
> 0,
>
> On Aug 11, 2004, at 7:33 PM, John Hayes wrote:
>
>>
>> #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 ),
>>                 *lcell,
>>                 lrealm [ 1024 ],
>>                 realm [ 1024 ],
>>                 instance [ 1024 ];
>>
>>         int     retval = 0,
>>                 local;
>>
>> afs_int32 password_expires = -1;
>>
>>         Date LifeTime = 24 * 3600;
>>
>>         pruclient = NULL;
>>
>>         strcpy ( UserName, argv [ 1 ] );
>>         strcpy ( Password, argv [ 2 ] );
>>         strcpy ( instance, "" );
>>
>> retval = ka_Init(0);
>> printf ( "R1 = %d\n", retval );
>> printf ( "R2 = %s, %d\n", lcell, local );
>> retval = ka_CellToRealm (lcell, lrealm, &local);
>> printf ( "R3 = %d, %s, %d\n", retval, lrealm, local );
>> strcpy ( realm, lcell );
>> retval = ka_CellToRealm (realm, realm, &local);
>> printf ( "R4 = %d\n", retval );
>>
>> printf ( "R5 = %d, %d\n", retval, local );
>>
>>         if ( ! retval )
>>         {
>>                 retval = ka_UserAuthenticateGeneral (
>> KA_USERAUTH_ONLY_VERIFY+KA_USERAUTH_VERSION,
>>                                                         UserName,
>>                                                         instance,
>>                                                         realm,
>>                                                         Password,
>>                                                         3600 * 5,
>>
>> &password_expires,
>>                                                         0,
>>                                                         &Reason);
>>
>>         }
>>
>>         pr_End ();
>>
>>         printf ( "%d, %s\n", retval, Reason );
>> }
>
> _______________________________________________
> 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!