From 1f03328ba672d2bfc3b6fe2746299961aee9c10f Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 6 Dec 1999 21:38:22 +0000 Subject: [PATCH] merge from 1.1 branch git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11945 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 24 ++++++++++++++++++++++++ src/lib/krb5/os/an_to_ln.c | 2 +- src/lib/krb5/os/changepw.c | 5 ++++- src/lib/krb5/os/init_os_ctx.c | 23 +++++++++++++++-------- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 589ebafa3..a990ab26e 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,27 @@ +1999-12-03 Danilo Almeida + + * changepw.c: Define ETIMEDOUT for Windows. + +1999-12-01 Ken Raeburn + + * init_os_ctx.c (krb5_secure_config_files): Do define; always + return an error, but perform old functionality in case the error + is ignored. Delete when we can make a major version number + change. + +1999-11-23 Ken Raeburn + + * an_to_ln.c (default_an_to_ln): Avoid stomping byte after + supplied buffer. Thanks to Matt Crawford. + + * init_os_ctx.c (os_init_paths): Delete SECURE argument; read the + value from the profile structure instead. + (krb5_os_init_context, krb5_get_profile): Don't pass SECURE + argument. + (os_init_paths, krb5_get_profile): Cast first arg to + profile_init. + (krb5_secure_config_files): Don't define. + 1999-11-22 Miro Jurisic * ccdefname.c (get_from_os): Replaced Kerberos5GlobalsLib calls diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index 1225c35af..3c721fb87 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -630,7 +630,7 @@ default_an_to_ln(context, aname, lnsize, lname) free(def_realm); strncpy(lname, krb5_princ_component(context, aname,0)->data, min(krb5_princ_component(context, aname,0)->length,lnsize)); - if (lnsize < krb5_princ_component(context, aname,0)->length ) { + if (lnsize <= krb5_princ_component(context, aname,0)->length ) { retval = KRB5_CONFIG_NOTENUFSPACE; } else { lname[krb5_princ_component(context, aname,0)->length] = '\0'; diff --git a/src/lib/krb5/os/changepw.c b/src/lib/krb5/os/changepw.c index c8120f276..84dcfc5e1 100644 --- a/src/lib/krb5/os/changepw.c +++ b/src/lib/krb5/os/changepw.c @@ -1,7 +1,7 @@ /* * lib/krb5/os/changepw.c * - * Copyright 1990 by the Massachusetts Institute of Technology. + * Copyright 1990,1999 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -43,6 +43,9 @@ #ifndef EHOSTUNREACH #define EHOSTUNREACH WSAEHOSTUNREACH #endif +#ifndef ETIMEDOUT +#define ETIMEDOUT WSAETIMEDOUT +#endif #endif /* _WIN32 && !__CYGWIN32__ */ /* diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index 486ece893..0afef471d 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -316,14 +316,13 @@ os_get_default_config_files(pfiles, secure) do not include user paths (from environment variables, etc.) */ static krb5_error_code -os_init_paths(ctx, secure) +os_init_paths(ctx) krb5_context ctx; - krb5_boolean secure; { krb5_error_code retval = 0; profile_filespec_t *files = 0; + krb5_boolean secure = ctx->profile_secure; - ctx->profile_secure = secure; #ifdef KRB5_DNS_LOOKUP ctx->profile_in_memory = 0; #endif /* KRB5_DNS_LOOKUP */ @@ -331,7 +330,8 @@ os_init_paths(ctx, secure) retval = os_get_default_config_files(&files, secure); if (!retval) { - retval = profile_init(files, &ctx->profile); + retval = profile_init((const_profile_filespec_t *) files, + &ctx->profile); #ifdef KRB5_DNS_LOOKUP /* if none of the filenames can be opened use an empty profile */ if (retval == ENOENT) { @@ -386,7 +386,7 @@ krb5_os_init_context(ctx) krb5_cc_set_default_name(ctx, NULL); - retval = os_init_paths(ctx, FALSE); + retval = os_init_paths(ctx); /* * If there's an error in the profile, return an error. Just @@ -407,7 +407,7 @@ krb5_get_profile (ctx, profile) retval = os_get_default_config_files(&files, ctx->profile_secure); if (!retval) - retval = profile_init(files, profile); + retval = profile_init((const_profile_filespec_t *) files, profile); if (files) free_filespecs(files); @@ -468,6 +468,10 @@ krb5_error_code krb5_secure_config_files(ctx) krb5_context ctx; { + /* Obsolete interface; always return an error. + + This function should be removed next time a major version + number change happens. */ krb5_error_code retval; if (ctx->profile) { @@ -475,9 +479,12 @@ krb5_secure_config_files(ctx) ctx->profile = 0; } - retval = os_init_paths(ctx, TRUE); + ctx->profile_secure = TRUE; + retval = os_init_paths(ctx); + if (retval) + return retval; - return retval; + return KRB5_OBSOLETE_FN; } void -- 2.26.2