diff options
author | Alexandra Ellwood <lxs@mit.edu> | 2008-10-22 20:40:29 +0000 |
---|---|---|
committer | Alexandra Ellwood <lxs@mit.edu> | 2008-10-22 20:40:29 +0000 |
commit | 50e7f8e37b9d532343d9316677559664df88b466 (patch) | |
tree | 5960ef9fe962d2042fe64c01727072dbd4e80a0b /src/ccapi | |
parent | 006d3ec49636996908bf1c109f01fe76192e4e68 (diff) | |
download | krb5-50e7f8e37b9d532343d9316677559664df88b466.zip krb5-50e7f8e37b9d532343d9316677559664df88b466.tar.gz krb5-50e7f8e37b9d532343d9316677559664df88b466.tar.bz2 |
Remove ipc message sent on cc_context_release
IPC message was causing problems when called from thread fini function
(via krb5_stdcc_shutdown).
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20908 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi')
-rw-r--r-- | src/ccapi/common/cci_types.h | 2 | ||||
-rw-r--r-- | src/ccapi/lib/ccapi_context.c | 21 | ||||
-rw-r--r-- | src/ccapi/lib/ccapi_context.h | 4 | ||||
-rw-r--r-- | src/ccapi/server/ccs_cache_collection.c | 24 |
4 files changed, 17 insertions, 34 deletions
diff --git a/src/ccapi/common/cci_types.h b/src/ccapi/common/cci_types.h index 20c6470..43f7100 100644 --- a/src/ccapi/common/cci_types.h +++ b/src/ccapi/common/cci_types.h @@ -39,7 +39,7 @@ enum cci_msg_id_t { /* cc_context_t */ cci_context_first_msg_id, - cci_context_release_msg_id, + cci_context_unused_release_msg_id, /* Unused. Handle for old clients. */ cci_context_sync_msg_id, cci_context_get_change_time_msg_id, cci_context_wait_for_change_msg_id, diff --git a/src/ccapi/lib/ccapi_context.c b/src/ccapi/lib/ccapi_context.c index 0f1712e..7ba3db4 100644 --- a/src/ccapi/lib/ccapi_context.c +++ b/src/ccapi/lib/ccapi_context.c @@ -198,6 +198,16 @@ cc_int32 cc_initialize (cc_context_t *out_context, #endif /* ------------------------------------------------------------------------ */ +/* + * Currently does not need to talk to the server since the server must + * handle cleaning up resources from crashed clients anyway. + * + * NOTE: if server communication is ever added here, make sure that + * krb5_stdcc_shutdown calls an internal function which does not talk to the + * server. krb5_stdcc_shutdown is called from thread fini functions and may + * crash talking to the server depending on what order the OS calls the fini + * functions (ie: if the ipc layer fini function is called first). + */ cc_int32 ccapi_context_release (cc_context_t in_context) { @@ -207,17 +217,6 @@ cc_int32 ccapi_context_release (cc_context_t in_context) if (!in_context) { err = ccErrBadParam; } if (!err) { - err = cci_context_sync (context, 0); - } - - if (!err) { - err = cci_ipc_send_no_launch (cci_context_release_msg_id, - context->identifier, - NULL, - NULL); - } - - if (!err) { cci_identifier_release (context->identifier); free (context->functions); free (context); diff --git a/src/ccapi/lib/ccapi_context.h b/src/ccapi/lib/ccapi_context.h index 7462a05..564f49d 100644 --- a/src/ccapi/lib/ccapi_context.h +++ b/src/ccapi/lib/ccapi_context.h @@ -29,6 +29,10 @@ #include "cci_common.h" +/* Used for freeing ccapi context in thread fini calls + * Does not tell the server you are exiting. */ +cc_int32 cci_context_destroy (cc_context_t in_context); + cc_int32 ccapi_context_release (cc_context_t in_context); cc_int32 ccapi_context_get_change_time (cc_context_t in_context, diff --git a/src/ccapi/server/ccs_cache_collection.c b/src/ccapi/server/ccs_cache_collection.c index b09ae8d..3790a10 100644 --- a/src/ccapi/server/ccs_cache_collection.c +++ b/src/ccapi/server/ccs_cache_collection.c @@ -571,25 +571,6 @@ cc_int32 ccs_cache_collection_set_default_ccache (ccs_cache_collection_t io_cac /* ------------------------------------------------------------------------ */ -static cc_int32 ccs_cache_collection_context_release (ccs_cache_collection_t io_cache_collection, - k5_ipc_stream in_request_data, - k5_ipc_stream io_reply_data) -{ - cc_int32 err = ccNoError; - - if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); } - if (!in_request_data ) { err = cci_check_error (ccErrBadParam); } - if (!io_reply_data ) { err = cci_check_error (ccErrBadParam); } - - if (!err) { - /* Currently does nothing */ - } - - return cci_check_error (err); -} - -/* ------------------------------------------------------------------------ */ - static cc_int32 ccs_cache_collection_sync (ccs_cache_collection_t io_cache_collection, k5_ipc_stream in_request_data, k5_ipc_stream io_reply_data) @@ -1051,9 +1032,8 @@ static cc_int32 ccs_cache_collection_unlock (ccs_pipe_t in_client_pi } if (!err) { - if (in_request_name == cci_context_release_msg_id) { - err = ccs_cache_collection_context_release (io_cache_collection, - in_request_data, reply_data); + if (in_request_name == cci_context_unused_release_msg_id) { + /* Old release message. Do nothing. */ } else if (in_request_name == cci_context_sync_msg_id) { err = ccs_cache_collection_sync (io_cache_collection, |