static int s_error_cache_init (void) { char * tmp_string; if(globus_module_activate(GLOBUS_OBJECT_MODULE) != GLOBUS_SUCCESS) { return GLOBUS_FAILURE; } globus_thread_key_create(&s_peek_key, s_key_destructor_func); globus_object_cache_init (&s_result_to_object_mapper); local_mutex_init (&s_result_to_object_mutex, NULL); s_next_available_result_count = 1; s_error_cache_initialized = 1; tmp_string = globus_module_getenv("GLOBUS_ERROR_OUTPUT"); if(tmp_string != GLOBUS_NULL) { globus_i_error_output = GLOBUS_TRUE; } tmp_string = globus_module_getenv("GLOBUS_ERROR_VERBOSE"); if(tmp_string != GLOBUS_NULL) { globus_i_error_verbose = GLOBUS_TRUE; } globus_thread_key_create(&globus_i_error_verbose_key, GLOBUS_NULL); return GLOBUS_SUCCESS; }
/** * Module activation * @ingroup globus_callout_activation */ static int globus_l_callout_activate(void) { int result = (int) GLOBUS_SUCCESS; char * tmp_string; static char * _function_name_ = "globus_l_callout_activate"; tmp_string = globus_module_getenv("GLOBUS_CALLOUT_DEBUG_LEVEL"); if(tmp_string != GLOBUS_NULL) { globus_i_callout_debug_level = atoi(tmp_string); if(globus_i_callout_debug_level < 0) { globus_i_callout_debug_level = 0; } } tmp_string = globus_module_getenv("GLOBUS_CALLOUT_DEBUG_FILE"); if(tmp_string != GLOBUS_NULL) { globus_i_callout_debug_fstream = fopen(tmp_string, "a"); if(globus_i_callout_debug_fstream == NULL) { result = (int) GLOBUS_FAILURE; goto exit; } } else { globus_i_callout_debug_fstream = stderr; } GLOBUS_I_CALLOUT_DEBUG_ENTER; result = globus_module_activate(GLOBUS_COMMON_MODULE); if(result != GLOBUS_SUCCESS) { goto exit; } #ifndef BUILD_STATIC_ONLY if((result = lt_dlinit()) != 0) { goto exit; } #endif GLOBUS_I_CALLOUT_DEBUG_EXIT; exit: return result; }
static int globus_l_ftp_control_activate(void) { int rc; char * tmp_string; rc = globus_module_activate(GLOBUS_IO_MODULE); if(rc != GLOBUS_SUCCESS) { return rc; } tmp_string = globus_module_getenv("GLOBUS_FTP_CONTROL_DEBUG_LEVEL"); if(tmp_string != GLOBUS_NULL) { globus_i_ftp_control_debug_level = atoi(tmp_string); if(globus_i_ftp_control_debug_level < 0) { globus_i_ftp_control_debug_level = 0; } } globus_i_ftp_control_debug_printf(1, (stderr, "globus_l_ftp_control_activate() entering\n")); rc = globus_module_activate(GLOBUS_THREAD_MODULE); if(rc != GLOBUS_SUCCESS) { goto exit; } rc = globus_module_activate(GLOBUS_COMMON_MODULE); if(rc != GLOBUS_SUCCESS) { goto exit; } rc = globus_module_activate(GLOBUS_GSI_GSSAPI_MODULE); if(rc != GLOBUS_SUCCESS) { goto exit; } rc = (int)globus_i_ftp_control_server_activate(); if(rc != GLOBUS_SUCCESS) { goto exit; } rc = (int)globus_i_ftp_control_client_activate(); if(rc != GLOBUS_SUCCESS) { goto exit; } rc = (int)globus_i_ftp_control_data_activate(); exit: globus_i_ftp_control_debug_printf(1, (stderr, "globus_l_ftp_control_activate() exiting\n")); return rc; }
globus_bool_t globus_xio_get_env_pair( const char * env_name, int * min, int * max) { char * min_max; GlobusXIOName(globus_xio_get_env_pair); min_max = globus_module_getenv(env_name); if(min_max && sscanf(min_max, " %d , %d", min, max) == 2) { return GLOBUS_TRUE; } return GLOBUS_FALSE; }
/** * Module activation */ static int globus_l_gsi_gssapi_activate(void) { int rc = GLOBUS_SUCCESS; char * tmp_string; char * gsi_conf_data; rc = globus_module_activate(GLOBUS_COMMON_MODULE); if (rc != GLOBUS_SUCCESS) { goto common_activate_fail; } rc = globus_l_gsi_gssapi_read_config(&gsi_conf_data); if (rc != GLOBUS_SUCCESS) { goto read_conf_data_fail; } if (gsi_conf_data == NULL) { gsi_conf_data = strdup(globus_l_gsi_conf_string); if (gsi_conf_data == NULL) { rc = GLOBUS_FAILURE; goto strdup_default_data_fail; } } rc = globus_l_gsi_gssapi_parse_config(gsi_conf_data); if (rc != GLOBUS_SUCCESS) { goto parse_conf_data_fail; } tmp_string = globus_module_getenv("GLOBUS_GSSAPI_DEBUG_LEVEL"); if(tmp_string != GLOBUS_NULL) { globus_i_gsi_gssapi_debug_level = atoi(tmp_string); if(globus_i_gsi_gssapi_debug_level < 0) { globus_i_gsi_gssapi_debug_level = 0; } } tmp_string = globus_module_getenv("GLOBUS_GSSAPI_DEBUG_FILE"); if(tmp_string != GLOBUS_NULL) { globus_i_gsi_gssapi_debug_fstream = fopen(tmp_string, "a"); if(!globus_i_gsi_gssapi_debug_fstream) { rc = GLOBUS_FAILURE; goto debug_open_fail; } } else { globus_i_gsi_gssapi_debug_fstream = stderr; if(!globus_i_gsi_gssapi_debug_fstream) { rc = GLOBUS_FAILURE; goto debug_stderr_fail; } } tmp_string = globus_module_getenv("GLOBUS_GSSAPI_FORCE_TLS"); if(tmp_string != GLOBUS_NULL && (strcasecmp(tmp_string, "true") == 0 || strcasecmp(tmp_string, "yes") == 0 || strcmp(tmp_string, "1") == 0)) { globus_i_gsi_gssapi_force_tls = 1; } tmp_string = globus_module_getenv("GLOBUS_GSSAPI_NAME_COMPATIBILITY"); if(tmp_string != NULL) { if (strcmp(tmp_string, "STRICT_GT2") == 0) { gss_i_name_compatibility_mode = GSS_I_COMPATIBILITY_STRICT_GT2; } else if (strcmp(tmp_string, "STRICT_RFC2818") == 0) { gss_i_name_compatibility_mode = GSS_I_COMPATIBILITY_STRICT_RFC2818; } else if (strcmp(tmp_string, "HYBRID") == 0) { gss_i_name_compatibility_mode = GSS_I_COMPATIBILITY_HYBRID; } else { GLOBUS_I_GSI_GSSAPI_DEBUG_PRINT( 1, (_GGSL("Unknown GLOBUS_GSSAPI_NAME_COMPATIBILITY value: %s\n"), tmp_string)); gss_i_name_compatibility_mode = GSS_I_COMPATIBILITY_HYBRID; } } else { gss_i_name_compatibility_mode = GSS_I_COMPATIBILITY_HYBRID; } tmp_string = globus_module_getenv("GLOBUS_GSSAPI_CIPHERS"); if (tmp_string != NULL) { globus_i_gsi_gssapi_cipher_list = tmp_string; } tmp_string = globus_module_getenv("GLOBUS_GSSAPI_SERVER_CIPHER_ORDER"); if (tmp_string != NULL) { if (strcasecmp(tmp_string, "true") == 0 || strcasecmp(tmp_string, "yes") == 0 || strcmp(tmp_string, "1") == 0) { globus_i_gsi_gssapi_server_cipher_order = GLOBUS_TRUE; } } rc = globus_module_activate(GLOBUS_OPENSSL_MODULE); if (rc != GLOBUS_SUCCESS) { goto activate_openssl_module_fail; } rc = globus_module_activate(GLOBUS_GSI_PROXY_MODULE); if (rc != GLOBUS_SUCCESS) { goto activate_gsi_proxy_fail; } rc = globus_module_activate(GLOBUS_GSI_CALLBACK_MODULE); if (rc != GLOBUS_SUCCESS) { goto activate_gsi_callback_fail; } GLOBUS_I_GSI_GSSAPI_INTERNAL_DEBUG_EXIT; globus_i_gssapi_active = GLOBUS_TRUE; if (rc != GLOBUS_SUCCESS) { activate_gsi_callback_fail: globus_module_deactivate(GLOBUS_GSI_PROXY_MODULE); activate_gsi_proxy_fail: globus_module_deactivate(GLOBUS_OPENSSL_MODULE); activate_openssl_module_fail: if (globus_i_gsi_gssapi_debug_fstream != NULL && globus_i_gsi_gssapi_debug_fstream != stderr) { fclose(globus_i_gsi_gssapi_debug_fstream); globus_i_gsi_gssapi_debug_fstream = NULL; } } debug_stderr_fail: debug_open_fail: parse_conf_data_fail: strdup_default_data_fail: free(gsi_conf_data); read_conf_data_fail: if (rc != GLOBUS_SUCCESS) { globus_module_deactivate(GLOBUS_COMMON_MODULE); } common_activate_fail: return rc; }