| 2 * It contains source for the ZMakeAuthentication function. |
2 * It contains source for the ZMakeAuthentication function. |
| 3 * |
3 * |
| 4 * Created by: Robert French |
4 * Created by: Robert French |
| 5 * |
5 * |
| 6 * $Source$ |
6 * $Source$ |
| 7 * $Author: warmenhoven $ |
7 * $Author: lschiere $ |
| 8 * |
8 * |
| 9 * Copyright (c) 1987 by the Massachusetts Institute of Technology. |
9 * Copyright (c) 1987 by the Massachusetts Institute of Technology. |
| 10 * For copying and distribution information, see the file |
10 * For copying and distribution information, see the file |
| 11 * "mit-copyright.h". |
11 * "mit-copyright.h". |
| 12 */ |
12 */ |
| 13 /* $Id: ZMkAuth.c 2096 2001-07-31 01:00:39Z warmenhoven $ */ |
13 /* $Id: ZMkAuth.c 8940 2004-02-07 17:40:57Z lschiere $ */ |
| 14 |
14 |
| 15 #include <internal.h> |
15 #include <internal.h> |
| 16 |
16 |
| 17 #ifndef lint |
17 #ifndef lint |
| 18 static const char rcsid_ZMakeAuthentication_c[] = "$Id: ZMkAuth.c 2096 2001-07-31 01:00:39Z warmenhoven $"; |
18 static const char rcsid_ZMakeAuthentication_c[] = "$Id: ZMkAuth.c 8940 2004-02-07 17:40:57Z lschiere $"; |
| 19 #endif |
19 #endif |
| 20 |
20 |
| 21 #ifdef ZEPHYR_USES_KERBEROS |
21 #ifdef ZEPHYR_USES_KERBEROS |
| 22 #include <krb_err.h> |
22 #include <krb_err.h> |
| 23 static long last_authent_time = 0L; |
23 static long last_authent_time = 0L; |
| 50 if (last_authent_time == 0 || (now - last_authent_time > 120)) { |
50 if (last_authent_time == 0 || (now - last_authent_time > 120)) { |
| 51 result = krb_mk_req(&authent, SERVER_SERVICE, |
51 result = krb_mk_req(&authent, SERVER_SERVICE, |
| 52 SERVER_INSTANCE, __Zephyr_realm, 0); |
52 SERVER_INSTANCE, __Zephyr_realm, 0); |
| 53 if (result != MK_AP_OK) { |
53 if (result != MK_AP_OK) { |
| 54 last_authent_time = 0; |
54 last_authent_time = 0; |
| 55 return (result+krb_err_base); |
55 return (result+ERROR_TABLE_BASE_krb); |
| 56 } |
56 } |
| 57 last_authent_time = now; |
57 last_authent_time = now; |
| 58 last_authent = authent; |
58 last_authent = authent; |
| 59 } |
59 } |
| 60 else { |
60 else { |