2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
15 #if defined(AFS_SGI_ENV)
20 #include <sys/types.h>
21 #include <sys/param.h>
22 #include <afs/kauth.h>
23 #include <afs/kautils.h>
25 extern char *ktc_tkt_string();
28 * authenticate with AFS
30 * 1 if read password but couldn't authenticate correctly via AFS
31 * 0 if authenticated via AFS correctly
35 char *uname, /* user name trying to log in */
36 char *pword, /* password */
37 afs_int32 *exp, /* expiration time */
38 int quite) /* no printing */
44 * The basic model for logging in now, is that *if* there
45 * is a kerberos record for this individual user we will
46 * trust kerberos (provided the user really has an account
47 * locally.) If there is no kerberos record (or the password
48 * were typed incorrectly.) we would attempt to authenticate
49 * against the local password file entry. Naturally, if
50 * both fail we use existing failure code.
52 if (ka_UserAuthenticateGeneral(
53 KA_USERAUTH_VERSION + KA_USERAUTH_DOSETPAG,
54 uname, /* kerberos name */
55 (char *)0, /* instance */
56 (char *)0, /* realm */
58 0, /* default lifetime */
59 exp, /* spare 1/expiration */
61 &reason /* error string */
64 printf("Unable to authenticate to AFS because %s\n",
66 printf("proceeding with local authentication...\n");
70 /* authenticated successfully */
75 afs_gettktstring(void)
77 return ktc_tkt_string();