+Wed Mar 22 11:24:07 1995 Keith Vetter (keithv@fusion.com)
+
+ * fcc-proto.h: added prototype for cache changing hook,
+ * fcc.h: changed cache file location for the PC (out of /tmp).
+ * fcc_ops.h: made the cache changing hook return an error code.
+
Tue Mar 21 19:14:49 1995 Keith Vetter (keithv@fusion.com)
* fcc_destroy.c: open file on the PC in binary mode, worked around
/* fcc_ops.c */
extern krb5_cc_ops krb5_cc_file_ops;
+krb5_error_code krb5_change_cache
+ PROTOTYPE(());
+
/* fcc_write.c */
krb5_error_code INTERFACE krb5_fcc_write
#define FCC_OPEN_RDONLY 3
#ifndef TKT_ROOT
+#ifdef MSDOS_FILESYSTEM
+#define TKT_ROOT "\\tkt"
+#else
#define TKT_ROOT "/tmp/tkt"
#endif
+#endif
/* macros to make checking flags easier */
#define OPENCLOSE(id) (((krb5_fcc_data *)id->data)->flags & KRB5_TC_OPENCLOSE)
* we'll communicate to all other processes.
*/
-void
-krb5_change_cache (int send) {
+krb5_error_code
+krb5_change_cache (void) {
SendMessage(HWND_BROADCAST, krb5_get_notification_message(), 0, 0);
+ return 0;
}
unsigned int INTERFACE
}
#else /* _WINDOWS */
-void INTERFACE
+krb5_error_code
krb5_change_cache ()
{
- return;
+ return 0;
}
unsigned int INTERFACE
-krb5_get_notification_message () {
+krb5_get_notification_message ()
+{
return 0;
}
+Wed Mar 22 13:30:35 1995 Keith Vetter (keithv@fusion.com)
+
+ * an_to_ln.c, kuserok.c: last two os routines ported to the PC.
+
Fri Mar 17 19:56:39 1995 John Gilmore (gnu at toad.com)
* Makefile.in (LDFLAGS): Eliminate, duplicates config/pre.in.
*/
#include "k5-int.h"
-#ifndef _MSDOS /* Not yet for Windows */
+
#ifndef min
#define min(a,b) ((a) > (b) ? (b) : (a))
#endif /* min */
+int krb5_lname_username_fallback = 1;
+extern char *krb5_lname_file;
+
+#ifndef _MSDOS
+
static krb5_error_code dbm_an_to_ln();
static krb5_error_code username_an_to_ln();
returns system errors, NOT_ENOUGH_SPACE
*/
-int krb5_lname_username_fallback = 1;
-
-extern char *krb5_lname_file;
-
krb5_error_code
krb5_aname_to_localname(context, aname, lnsize, lname)
krb5_context context;
(void) dbm_close(db);
return retval;
}
+#endif /* _MSDOS */
/*
* Implementation: This version checks the realm to see if it is the local
if (retval = krb5_get_default_realm(context, &def_realm)) {
return(retval);
}
- if ((realm_length != strlen(def_realm)) ||
+ if (((size_t) realm_length != strlen(def_realm)) ||
(memcmp(def_realm, krb5_princ_realm(context, aname)->data, realm_length))) {
free(def_realm);
return KRB5_LNAME_NOTRANS;
}
return retval;
}
-#endif
+
+#ifdef _MSDOS
+
+krb5_error_code INTERFACE
+krb5_aname_to_localname(context, aname, lnsize, lname)
+ krb5_context context;
+ krb5_const_principal aname;
+ const int lnsize;
+ char *lname;
+{
+ if (krb5_lname_username_fallback)
+ return username_an_to_ln(context, aname, lnsize, lname);
+ return KRB5_LNAME_CANTOPEN;
+}
+
+#endif /* _MSDOS */
fclose(fp);
return(isok);
}
-#endif
+
+#else /* _MSDOS */
+
+/*
+ * If the given Kerberos name "server" translates to the same name as "luser"
+ * (using * krb5_aname_to_lname()), returns TRUE.
+ */
+krb5_boolean INTERFACE
+krb5_kuserok(context, principal, luser)
+ krb5_context context;
+ krb5_principal principal;
+ const char *luser;
+{
+ char kuser[50];
+
+ if (! krb5_aname_to_localname(context, principal, sizeof(kuser), kuser))
+ return FALSE;
+
+ if (strcmp(kuser, luser) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+#endif /* _MSDOS */