imapext-2007
diff src/osdep/nt/kerb_mit.c @ 0:ada5e610ab86
imap-2007e
author | yuuji@gentei.org |
---|---|
date | Mon, 14 Sep 2009 15:17:45 +0900 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/osdep/nt/kerb_mit.c Mon Sep 14 15:17:45 2009 +0900 1.3 @@ -0,0 +1,74 @@ 1.4 +/* ======================================================================== 1.5 + * Copyright 1988-2006 University of Washington 1.6 + * 1.7 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.8 + * you may not use this file except in compliance with the License. 1.9 + * You may obtain a copy of the License at 1.10 + * 1.11 + * http://www.apache.org/licenses/LICENSE-2.0 1.12 + * 1.13 + * 1.14 + * ======================================================================== 1.15 + */ 1.16 + 1.17 +/* 1.18 + * Program: MIT Kerberos routines 1.19 + * 1.20 + * Author: Mark Crispin 1.21 + * Networks and Distributed Computing 1.22 + * Computing & Communications 1.23 + * University of Washington 1.24 + * Administration Building, AG-44 1.25 + * Seattle, WA 98195 1.26 + * Internet: MRC@CAC.Washington.EDU 1.27 + * 1.28 + * Date: 4 March 2003 1.29 + * Last Edited: 30 August 2006 1.30 + */ 1.31 + 1.32 +#define PROTOTYPE(x) x 1.33 +#include <gssapi/gssapi_generic.h> 1.34 +#include <gssapi/gssapi_krb5.h> 1.35 + 1.36 + 1.37 +long kerberos_server_valid (void); 1.38 +long kerberos_try_kinit (OM_uint32 error); 1.39 +char *kerberos_login (char *user,char *authuser,int argc,char *argv[]); 1.40 + 1.41 +/* Kerberos server valid check 1.42 + * Returns: T if have keytab, NIL otherwise 1.43 + */ 1.44 + 1.45 +long kerberos_server_valid () 1.46 +{ 1.47 + return NIL; 1.48 +} 1.49 + 1.50 + 1.51 +/* Kerberos check for missing or expired credentials 1.52 + * Returns: T if should suggest running kinit, NIL otherwise 1.53 + */ 1.54 + 1.55 +long kerberos_try_kinit (OM_uint32 error) 1.56 +{ 1.57 + switch (error) { 1.58 + case KRB5KRB_AP_ERR_TKT_EXPIRED: 1.59 + case KRB5_FCC_NOFILE: /* MIT */ 1.60 + case KRB5_CC_NOTFOUND: /* Heimdal */ 1.61 + return LONGT; 1.62 + } 1.63 + return NIL; 1.64 +} 1.65 + 1.66 +/* Kerberos server log in 1.67 + * Accepts: authorization ID as user name 1.68 + * authentication ID as Kerberos principal 1.69 + * argument count 1.70 + * argument vector 1.71 + * Returns: logged in user name if logged in, NIL otherwise 1.72 + */ 1.73 + 1.74 +char *kerberos_login (char *user,char *authuser,int argc,char *argv[]) 1.75 +{ 1.76 + return NIL; 1.77 +}