Stephen,

I notice that in the first part of the code you do not use DOSETPAG.
Perhaps you use setpag() in another routine somewhere.
If this routine is used for an imap server, surely you need a pag to 
access files out of a users home directory.

I like the second part of the routine... looks like it would work for a 
pop server.

-- 
[EMAIL PROTECTED]
Systems Programmer, UNC-Greensboro


> 
> This is the routine we use for "authenticating" servers.  The #if 0 section
> is used if a token is required, the second section to authenticate without
> a token.
> 
> Steve
> 
> 
> 
> int try_to_login (char *username,
>                   char *password)
> {
>   int code;
>   char *reason;
>   
> #if 0
> 
> /*      Authenticate - validate and get token.
> */
>   code = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
>                                     username,
>                                     (char *) 0,  /* instance */
>                                     (char *) 0,  /* realm */
>                                     password,
>                                     0,           /* lifetime, default */
>                                     0, 0,        /* spares */
>                                     &reason);
>   
>   if (code != 0)
>     printf("AFS login failed because %s\n", reason);
> 
> #else
> 
> /*      Validate only.  No token.
> */
>   struct ktc_encryptionKey key;
>   struct ktc_token token;
> 
>   code = ka_StringToKey (password, NULL, &key);
>   code = ka_GetAdminToken (username,  NULL, NULL, &key, 600, &token, 1);
> 
>   if (code != 0)
>     printf("AFS login failed: code %d\n", code);
> 
> #endif
>   
>   return code;
> }
> 
> 
> ----------------------------------------------------------------------------
> Steve Roseman
> Lehigh University Computing Center
> [EMAIL PROTECTED]
> 


Reply via email to