\n"
- "The table below lists config file options, associated command line "
+ "The table below lists config file options, associated command line "
"options (if available) and descriptions. Note that any boolean "
- "option can be negated on the command line by preceding the specified "
+ "option can be negated on the command line by preceding the specified "
"option with '-no-' or '-n'. Example: -no-cas or -nf.\n"
"
\n"
- " \n",
- o->configfile_option,
+ " \n",
+ o->configfile_option,
value,
- o->short_cmdline_option ? shortflag : "",
+ o->short_cmdline_option ? shortflag : "",
o->short_cmdline_option ? o->short_cmdline_option : "",
- o->type != GLOBUS_L_GFS_CONFIG_BOOL &&
+ o->type != GLOBUS_L_GFS_CONFIG_BOOL &&
o->short_cmdline_option ? value : "",
- o->short_cmdline_option ? "\n" : "",
+ o->short_cmdline_option ? "\n" : "",
o->long_cmdline_option ? longflag : "",
o->long_cmdline_option ? o->long_cmdline_option : "",
- o->type != GLOBUS_L_GFS_CONFIG_BOOL &&
+ o->type != GLOBUS_L_GFS_CONFIG_BOOL &&
o->long_cmdline_option ? value : "",
o->usage,
defval);
@@ -1680,7 +1680,7 @@ globus_l_gfs_config_display_wsdl()
out = stdout;
}
for(i = 0; i < option_count; i++)
- {
+ {
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->option_name != NULL && o->public)
{
@@ -1709,7 +1709,7 @@ globus_l_gfs_config_display_wsdl()
fprintf(out, " \n");
for(i = 0; i < option_count; i++)
- {
+ {
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->option_name != NULL && o->public)
{
@@ -1750,7 +1750,7 @@ globus_l_gfs_config_display_c_service()
globus_bool_t close = GLOBUS_TRUE;
char * c_file;
GlobusGFSDebugEnter();
-
+
c_file = globus_common_create_string("%s.c",
globus_i_gfs_config_string("wsdl"));
out = fopen(c_file, "w");
@@ -1760,7 +1760,7 @@ globus_l_gfs_config_display_c_service()
out = stdout;
}
for(i = 0; i < option_count; i++)
- {
+ {
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->option_name != NULL && o->public)
{
@@ -1787,7 +1787,7 @@ globus_l_gfs_config_display_c_service()
fprintf(out, " globus_result_t result;\n");
fprintf(out, " globus_i_gfs_config_option_cb_ent_t * cb_handle;\n");
for(i = 0; i < option_count; i++)
- {
+ {
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->option_name != NULL && o->public)
{
@@ -1867,7 +1867,7 @@ globus_l_gfs_config_display_docbook_usage()
globus_l_gfs_config_option_t * o;
GlobusGFSName(globus_l_gfs_config_display_docbook_usage);
GlobusGFSDebugEnter();
-
+
printf("\n");
printf("\n"
"The list below contains the command-line options for the server, "
@@ -1879,10 +1879,10 @@ globus_l_gfs_config_display_docbook_usage()
"\n");
for(i = 0; i < option_count; i++)
- {
+ {
char * value;
char * defval;
-
+
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->option_name == NULL && o->configfile_option != NULL)
{
@@ -1911,8 +1911,8 @@ globus_l_gfs_config_display_docbook_usage()
defval = o->int_value ? "TRUE" : "FALSE";
break;
case GLOBUS_L_GFS_CONFIG_INT:
- value = "number";
- defval = o->int_value > 0 ?
+ value = "number";
+ defval = o->int_value > 0 ?
globus_common_create_string("%d", o->int_value) : NULL;
break;
case GLOBUS_L_GFS_CONFIG_STRING:
@@ -1920,11 +1920,11 @@ globus_l_gfs_config_display_docbook_usage()
defval = o->value ? o->value : NULL;
break;
default:
- value = "";
+ value = "";
defval = o->value ? o->value : NULL;
break;
}
-
+
printf(" \n");
if (o->short_cmdline_option)
{
@@ -1979,7 +1979,7 @@ globus_l_gfs_config_display_asciidoc_usage()
globus_l_gfs_config_option_t * o;
GlobusGFSName(globus_l_gfs_config_display_docbook_usage);
GlobusGFSDebugEnter();
-
+
printf("////\ngenerated by globus-gridftp-server -help -asciidoc\n////\n");
printf("The list below contains the command-line options for the server, "
"and also the name of the configuration file entry that implements "
@@ -1989,10 +1989,10 @@ globus_l_gfs_config_display_asciidoc_usage()
"\n");
for(i = 0; i < option_count; i++)
- {
+ {
char * value;
char * defval;
-
+
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->option_name == NULL && o->configfile_option != NULL)
{
@@ -2026,8 +2026,8 @@ globus_l_gfs_config_display_asciidoc_usage()
defval = o->int_value ? "TRUE" : "FALSE";
break;
case GLOBUS_L_GFS_CONFIG_INT:
- value = "number";
- defval = o->int_value > 0 ?
+ value = "number";
+ defval = o->int_value > 0 ?
globus_common_create_string("%d", o->int_value) : NULL;
break;
case GLOBUS_L_GFS_CONFIG_STRING:
@@ -2035,11 +2035,11 @@ globus_l_gfs_config_display_asciidoc_usage()
defval = o->value ? o->value : NULL;
break;
default:
- value = "";
+ value = "";
defval = o->value ? o->value : NULL;
break;
}
-
+
printf("*");
if (o->short_cmdline_option)
{
@@ -2123,16 +2123,16 @@ globus_i_gfs_config_display_long_usage()
globus_l_gfs_config_display_c_service();
}
else
- {
+ {
for(i = 0; i < option_count; i++)
- {
+ {
o = (globus_l_gfs_config_option_t *) &option_list[i];
if(o->usage == NULL)
{
continue;
}
-
- printf("%-14s %s\n%-14s %sCommand line or ENV args:",
+
+ printf("%-14s %s\n%-14s %sCommand line or ENV args:",
o->option_name, o->usage, "",
o->type == GLOBUS_L_GFS_CONFIG_BOOL ? "(FLAG) " : "");
if(o->short_cmdline_option)
@@ -2172,15 +2172,15 @@ globus_l_gfs_config_format_line(
int count;
int last;
int blanks;
-
+
len = strlen(in_str);
count = 0;
last = 0;
memset(out_buffer, 0, rows * columns);
-
+
for(i = 0; i < rows && count < len; i++)
{
- for(j = 0; j < columns - 1 && count < len; j++, count++)
+ for(j = 0; j < columns - 1 && count < len; j++, count++)
{
if(in_str[count] == ' ')
{
@@ -2205,12 +2205,12 @@ globus_l_gfs_config_format_line(
while(count < len && in_str[count] == ' ')
{
count++;
- }
+ }
}
return 0;
}
-
+
void
globus_i_gfs_config_display_usage()
{
@@ -2218,7 +2218,7 @@ globus_i_gfs_config_display_usage()
globus_l_gfs_config_option_t * o;
GlobusGFSName(globus_i_gfs_config_display_short_usage);
GlobusGFSDebugEnter();
-
+
if(globus_i_gfs_config_bool("html"))
{
globus_l_gfs_config_display_html_usage();
@@ -2237,7 +2237,7 @@ globus_i_gfs_config_display_usage()
globus_l_gfs_config_display_c_service();
}
else
- {
+ {
for(i = 0; i < option_count; i++)
{
char linebuffer[GLOBUS_GFS_HELP_ROWS * GLOBUS_GFS_HELP_COLS];
@@ -2253,7 +2253,7 @@ globus_i_gfs_config_display_usage()
{
count = 0;
printf("\n");
- len = GLOBUS_GFS_HELP_WIDTH -
+ len = GLOBUS_GFS_HELP_WIDTH -
(strlen(o->configfile_option) + 4);
if(len > 0)
{
@@ -2280,16 +2280,16 @@ globus_i_gfs_config_display_usage()
{
continue;
}
-
+
switch(o->type)
{
case GLOBUS_L_GFS_CONFIG_BOOL:
- value = "";
+ value = "";
sprintf(defval, "%s", o->int_value ? "TRUE" : "FALSE");
break;
case GLOBUS_L_GFS_CONFIG_INT:
- value = "";
- if(o->int_value > 0)
+ value = "";
+ if(o->int_value > 0)
{
sprintf(defval, "%d", o->int_value);
}
@@ -2299,16 +2299,16 @@ globus_i_gfs_config_display_usage()
}
break;
case GLOBUS_L_GFS_CONFIG_STRING:
- value = "";
- sprintf(defval, "%s",
+ value = "";
+ sprintf(defval, "%s",
o->value ? (char *) o->value : "not set");
break;
default:
- value = "";
+ value = "";
sprintf(defval, "%s", "not set");
break;
}
-
+
if(o->short_cmdline_option)
{
count += printf(" -%s", o->short_cmdline_option);
@@ -2330,16 +2330,16 @@ globus_i_gfs_config_display_usage()
usage, GLOBUS_GFS_HELP_ROWS, GLOBUS_GFS_HELP_COLS, linebuffer);
len = strlen(linebuffer);
- for(row = 0; row < GLOBUS_GFS_HELP_ROWS &&
- linebuffer[row * GLOBUS_GFS_HELP_COLS];
+ for(row = 0; row < GLOBUS_GFS_HELP_ROWS &&
+ linebuffer[row * GLOBUS_GFS_HELP_COLS];
row++)
{
if(row == 1)
{
count += printf(" Default: %s ", defval);
}
- for(col = count;
- col < GLOBUS_GFS_HELP_WIDTH - GLOBUS_GFS_HELP_COLS;
+ for(col = count;
+ col < GLOBUS_GFS_HELP_WIDTH - GLOBUS_GFS_HELP_COLS;
col++)
{
printf(" ");
@@ -2373,14 +2373,14 @@ globus_i_gfs_config_hostname_to_address_string(
globus_addrinfo_t hints;
globus_addrinfo_t * addrinfo;
globus_result_t result;
-
+
memset(&hints, 0, sizeof(globus_addrinfo_t));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = 0;
result = globus_libc_getaddrinfo(hostname, NULL, &hints, &addrinfo);
- if(result != GLOBUS_SUCCESS || addrinfo == NULL ||
+ if(result != GLOBUS_SUCCESS || addrinfo == NULL ||
addrinfo->ai_addr == NULL)
{
goto error_exit;
@@ -2396,11 +2396,11 @@ globus_i_gfs_config_hostname_to_address_string(
{
globus_libc_freeaddrinfo(addrinfo);
goto error_exit;
- }
- globus_libc_freeaddrinfo(addrinfo);
-
+ }
+ globus_libc_freeaddrinfo(addrinfo);
+
return GLOBUS_SUCCESS;
-
+
error_exit:
return result;
}
@@ -2439,7 +2439,6 @@ globus_l_gfs_config_misc()
globus_list_t * popen_list = NULL;
char * module;
char * ptr;
- int rc;
char * value;
char * data;
globus_result_t result;
@@ -2462,9 +2461,9 @@ globus_l_gfs_config_misc()
#ifdef WIN32
globus_l_gfs_config_set("fork", GLOBUS_FALSE, NULL);
-#endif
+#endif
- if(globus_i_gfs_config_bool("detach") &&
+ if(globus_i_gfs_config_bool("detach") &&
!globus_i_gfs_config_bool("daemon"))
{
globus_l_gfs_config_set("daemon", GLOBUS_TRUE, NULL);
@@ -2510,8 +2509,8 @@ globus_l_gfs_config_misc()
else if(strchr(value, ':') == NULL)
{
globus_l_gfs_config_set(
- "log_module",
- 0,
+ "log_module",
+ 0,
globus_common_create_string("%s:buffer=0", value));
globus_free(value);
}
@@ -2546,29 +2545,29 @@ globus_l_gfs_config_misc()
"control_interface", 0, globus_libc_strdup(iface));
}
}
-
- if((value =
+
+ if((value =
globus_i_gfs_config_string("control_interface")) != GLOBUS_NULL)
- {
+ {
memset(ipaddr, 0, sizeof(ipaddr));
result = globus_i_gfs_config_hostname_to_address_string(
- value, ipaddr, sizeof(ipaddr));
+ value, ipaddr, sizeof(ipaddr));
if(result != GLOBUS_SUCCESS)
- {
+ {
goto error_exit;
}
globus_l_gfs_config_set(
"control_interface", 1, globus_libc_strdup(ipaddr));
}
- if((value =
+ if((value =
globus_i_gfs_config_string("data_interface")) != GLOBUS_NULL)
- {
+ {
memset(ipaddr, 0, sizeof(ipaddr));
result = globus_i_gfs_config_hostname_to_address_string(
- value, ipaddr, sizeof(ipaddr));
+ value, ipaddr, sizeof(ipaddr));
if(result != GLOBUS_SUCCESS)
- {
+ {
goto error_exit;
}
globus_l_gfs_config_set(
@@ -2578,15 +2577,15 @@ globus_l_gfs_config_misc()
if((value = globus_i_gfs_config_string("hostname")) != GLOBUS_NULL)
{
globus_l_gfs_config_set("fqdn", 0, globus_libc_strdup(value));
-
+
memset(ipaddr, 0, sizeof(ipaddr));
result = globus_i_gfs_config_hostname_to_address_string(
- value, ipaddr, sizeof(ipaddr));
+ value, ipaddr, sizeof(ipaddr));
if(result != GLOBUS_SUCCESS)
- {
+ {
goto error_exit;
}
-
+
if(globus_i_gfs_config_string("control_interface") == NULL)
{
globus_l_gfs_config_set(
@@ -2605,18 +2604,18 @@ globus_l_gfs_config_misc()
globus_libc_gethostname(hostname, 1024);
globus_l_gfs_config_set("fqdn", 0, globus_libc_strdup(hostname));
globus_free(hostname);
- }
+ }
if((value = globus_i_gfs_config_string("version_tag")) != NULL)
{
- toolkit_version =
+ toolkit_version =
globus_common_create_string("%s %s", toolkit_id, value);
}
else
{
toolkit_version = globus_libc_strdup(toolkit_id);
}
-
+
default_banner = globus_common_create_string(
"%s GridFTP Server %d.%d (%s, %d-%d) [%s] ready.",
globus_i_gfs_config_string("fqdn"),
@@ -2626,27 +2625,27 @@ globus_l_gfs_config_misc()
local_version.timestamp,
local_version.branch_id,
toolkit_version);
-
+
data = NULL;
if(globus_i_gfs_config_bool("banner_terse"))
{
- data = globus_libc_strdup("");
+ data = globus_libc_strdup("");
}
else if((value = globus_i_gfs_config_string("banner_file")) != GLOBUS_NULL)
{
- rc = globus_l_config_loadfile(value, &data);
+ globus_l_config_loadfile(value, &data);
}
else if((value = globus_i_gfs_config_string("banner")) != GLOBUS_NULL)
{
data = globus_libc_strdup(value);
}
-
+
if(data != NULL)
{
if(globus_i_gfs_config_bool("banner_append"))
{
char * banner;
- banner =
+ banner =
globus_common_create_string("%s %s", default_banner, data);
globus_free(data);
data = banner;
@@ -2657,8 +2656,8 @@ globus_l_gfs_config_misc()
{
data = default_banner;
}
- globus_l_gfs_config_set("banner", 1, data);
-
+ globus_l_gfs_config_set("banner", 1, data);
+
data = globus_common_create_string(
"%d.%d (%s, %d-%d) [%s]",
local_version.major,
@@ -2672,15 +2671,15 @@ globus_l_gfs_config_misc()
if((value = globus_i_gfs_config_string("login_msg_file")) != GLOBUS_NULL)
{
- rc = globus_l_config_loadfile(value, &data);
- globus_l_gfs_config_set("login_msg", 0, data);
+ globus_l_config_loadfile(value, &data);
+ globus_l_gfs_config_set("login_msg", 0, data);
}
value = globus_i_gfs_config_string("load_dsi_module");
if(value != NULL)
{
char * ptr;
-
+
ptr = strchr(value, ':');
if(ptr)
{
@@ -2700,26 +2699,26 @@ globus_l_gfs_config_misc()
if(value)
{
if(globus_i_gfs_config_string("load_dsi_module") == NULL &&
- !globus_i_gfs_config_bool("data_node") &&
+ !globus_i_gfs_config_bool("data_node") &&
!globus_i_gfs_config_bool("hybrid"))
{
globus_l_gfs_config_set(
- "load_dsi_module", 0, globus_libc_strdup("remote"));
+ "load_dsi_module", 0, globus_libc_strdup("remote"));
}
-
- /* if stripe_count wasn't set, set it to the number of
+
+ /* if stripe_count wasn't set, set it to the number of
* nodes configured */
if(globus_i_gfs_config_int("stripe_count") == -1)
{
int node_count = 1;
char * ptr;
-
+
ptr = value;
while(ptr && *ptr && (ptr = strchr(ptr, ',')) != NULL)
{
ptr++;
node_count++;
- }
+ }
globus_l_gfs_config_set("stripe_count", node_count, NULL);
}
}
@@ -2731,9 +2730,9 @@ globus_l_gfs_config_misc()
globus_l_gfs_config_set("stripe_count", 1, NULL);
}
}
-
+
}
-
+
value = globus_libc_strdup(globus_i_gfs_config_string("popen_whitelist"));
if(value != NULL)
{
@@ -2741,21 +2740,21 @@ globus_l_gfs_config_misc()
while((ptr = strchr(module, ',')) != NULL)
{
*ptr = '\0';
- globus_list_insert(&popen_list, globus_libc_strdup(module));
+ globus_list_insert(&popen_list, globus_libc_strdup(module));
module = ptr + 1;
}
if(ptr == NULL)
{
- globus_list_insert(&popen_list, globus_libc_strdup(module));
- }
- globus_free(value);
+ globus_list_insert(&popen_list, globus_libc_strdup(module));
+ }
+ globus_free(value);
}
- globus_l_gfs_config_set("popen_list", 0, popen_list);
+ globus_l_gfs_config_set("popen_list", 0, popen_list);
if(globus_i_gfs_config_string("load_dsi_module") == NULL)
{
- globus_l_gfs_config_set("load_dsi_module", 0, globus_libc_strdup("file"));
- }
+ globus_l_gfs_config_set("load_dsi_module", 0, globus_libc_strdup("file"));
+ }
value = globus_libc_strdup(globus_i_gfs_config_string("allowed_modules"));
if(value != NULL)
@@ -2764,17 +2763,17 @@ globus_l_gfs_config_misc()
while((ptr = strchr(module, ',')) != NULL)
{
*ptr = '\0';
- globus_list_insert(&module_list, globus_libc_strdup(module));
+ globus_list_insert(&module_list, globus_libc_strdup(module));
module = ptr + 1;
}
if(ptr == NULL)
{
- globus_list_insert(&module_list, globus_libc_strdup(module));
- }
- globus_free(value);
+ globus_list_insert(&module_list, globus_libc_strdup(module));
+ }
+ globus_free(value);
}
- globus_l_gfs_config_set("module_list", 0, module_list);
-
+ globus_l_gfs_config_set("module_list", 0, module_list);
+
/* if auth_level is -1 it means it has not yet been touched */
switch(globus_i_gfs_config_int("auth_level"))
{
@@ -2820,7 +2819,7 @@ globus_l_gfs_config_misc()
if(globus_i_gfs_config_bool("fork"))
{
/* should log an error */
- globus_l_gfs_config_set("fork", GLOBUS_FALSE, NULL);
+ globus_l_gfs_config_set("fork", GLOBUS_FALSE, NULL);
}
/* set the convenience conf opt */
@@ -2840,9 +2839,9 @@ globus_l_gfs_config_misc()
globus_l_gfs_config_set("ipc_deny_from", 0, str);
}
}
-
- if(globus_i_gfs_config_string("remote_nodes") &&
- !globus_i_gfs_config_bool("data_node") &&
+
+ if(globus_i_gfs_config_string("remote_nodes") &&
+ !globus_i_gfs_config_bool("data_node") &&
globus_i_gfs_config_string("ipc_subject"))
{
char * ipc_dn;
@@ -2851,7 +2850,7 @@ globus_l_gfs_config_misc()
OM_uint32 maj_stat;
gss_name_t cred_name;
gss_cred_id_t cred;
-
+
ipc_dn = globus_i_gfs_config_string("ipc_subject");
if(strcasecmp(ipc_dn, "auto") == 0)
@@ -2888,11 +2887,11 @@ globus_l_gfs_config_misc()
result = min_stat;
goto error_exit;
}
- globus_l_gfs_config_set("ipc_cred", 0, cred);
+ globus_l_gfs_config_set("ipc_cred", 0, cred);
}
-
- else if(globus_i_gfs_config_string("remote_nodes") &&
- !globus_i_gfs_config_bool("data_node") &&
+
+ else if(globus_i_gfs_config_string("remote_nodes") &&
+ !globus_i_gfs_config_bool("data_node") &&
globus_i_gfs_config_string("ipc_credential"))
{
char * cred_file;
@@ -2900,13 +2899,13 @@ globus_l_gfs_config_misc()
OM_uint32 min_stat;
OM_uint32 maj_stat;
gss_cred_id_t cred;
-
+
cred_file = globus_i_gfs_config_string("ipc_credential");
buf.value = globus_common_create_string(
"X509_USER_PROXY=%s", cred_file);
buf.length = strlen(buf.value);
-
+
maj_stat = gss_import_cred(
&min_stat,
&cred,
@@ -2920,20 +2919,20 @@ globus_l_gfs_config_misc()
result = min_stat;
goto error_exit;
}
-
+
globus_free(buf.value);
-
- globus_l_gfs_config_set("ipc_cred", 0, cred);
+
+ globus_l_gfs_config_set("ipc_cred", 0, cred);
}
-
+
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
-
+
error_exit:
GlobusGFSDebugExitWithError();
return result;
}
-
+
/* logging is available in this func */
void
@@ -2944,7 +2943,7 @@ globus_i_gfs_config_post_init()
if(globus_i_gfs_config_bool("allow_udt") && globus_l_gfs_num_threads < 1)
{
- globus_gfs_log_message(GLOBUS_GFS_LOG_WARN,
+ globus_gfs_log_message(GLOBUS_GFS_LOG_WARN,
"Disabling UDT: threads must be enabled for UDT to function.\n");
globus_l_gfs_config_set("allow_udt", GLOBUS_FALSE, NULL);
@@ -2954,13 +2953,13 @@ globus_i_gfs_config_post_init()
}
/**
- * load configuration. read from defaults, file, env, and command line
+ * load configuration. read from defaults, file, env, and command line
* arguments. each overriding the other.
* this function will log error messages and exit the server if any
* errors occur.
* XXX need to allow config errors to log to syslog, stderr, etc
*/
-
+
int
globus_i_gfs_config_init_envs(
int argc,
@@ -2988,8 +2987,8 @@ globus_i_gfs_config_init_envs(
{
tmp_argv = argv;
}
-
- GLOBUS_GSI_SYSCONFIG_GET_CURRENT_WORKING_DIR(&cwd_str);
+
+ GLOBUS_GSI_SYSCONFIG_GET_CURRENT_WORKING_DIR(&cwd_str);
global_config_file = "/etc/grid-security/gridftp.conf";
local_config_file = NULL;
@@ -3002,14 +3001,14 @@ globus_i_gfs_config_init_envs(
{
argp++;
}
- if(argp[0] == 'c' && argp[1] == '\0'
+ if(argp[0] == 'c' && argp[1] == '\0'
&& tmp_argv[arg_num + 1])
{
local_config_file = strdup(tmp_argv[arg_num + 1]);
arg_num++;
cmdline_config = 1;
}
- else if(argp[0] == 'C' && argp[1] == '\0' &&
+ else if(argp[0] == 'C' && argp[1] == '\0' &&
tmp_argv[arg_num + 1])
{
conf_dir = strdup(tmp_argv[arg_num + 1]);
@@ -3021,14 +3020,14 @@ globus_i_gfs_config_init_envs(
arg_num++;
}
else if(!strcmp(argp, "threads") && tmp_argv[arg_num + 1])
- {
+ {
globus_l_gfs_num_threads = atoi(tmp_argv[arg_num + 1]);
arg_num++;
}
else if(!strcmp(argp, "inetd") || !strcmp(argp, "debug") ||
- !strcmp(argp, "i") || !strcmp(argp, "ssh") ||
+ !strcmp(argp, "i") || !strcmp(argp, "ssh") ||
!strcmp(argp, "no-fork"))
- {
+ {
globus_l_gfs_is_worker = GLOBUS_TRUE;
}
else if(!strcmp(argp, "port-range") && tmp_argv[arg_num + 1])
@@ -3042,7 +3041,7 @@ globus_i_gfs_config_init_envs(
if(local_config_file == NULL)
{
char * tmp_gl;
-
+
tmp_str = malloc(PATH_MAX);
tmp_gl = getenv("GLOBUS_LOCATION");
if(tmp_gl)
@@ -3051,10 +3050,10 @@ globus_i_gfs_config_init_envs(
if(rc > 0)
{
local_config_file = tmp_str;
- }
+ }
}
}
-
+
if(base_str)
{
free(cwd_str);
@@ -3110,7 +3109,7 @@ globus_i_gfs_config_init_envs(
{
rc = globus_l_gfs_config_load_envs_from_file(global_config_file);
}
-
+
if(globus_l_gfs_port_range)
{
setenv("GLOBUS_TCP_PORT_RANGE", globus_l_gfs_port_range, 1);
@@ -3120,12 +3119,12 @@ globus_i_gfs_config_init_envs(
/* only enable threads for real process, not daemon */
if(globus_l_gfs_num_threads > 0 && globus_l_gfs_is_worker)
{
- char nthreads[8];
+ char nthreads[11];
snprintf(nthreads, sizeof(nthreads), "%d", globus_l_gfs_num_threads);
setenv("GLOBUS_CALLBACK_POLLING_THREADS", nthreads, 1);
globus_thread_set_model("pthread");
}
-
+
if(local_config_file != NULL)
{
free(local_config_file);
@@ -3138,7 +3137,7 @@ globus_i_gfs_config_init_envs(
{
free(base_str);
}
-
+
return 0;
error:
@@ -3166,9 +3165,9 @@ globus_i_gfs_config_init(
char * base_str = NULL;
GlobusGFSName(globus_i_gfs_config_init);
GlobusGFSDebugEnter();
-
+
globus_l_gfs_common_loaded = GLOBUS_TRUE;
-
+
globus_hashtable_init(
&option_table,
256,
@@ -3185,9 +3184,9 @@ globus_i_gfs_config_init(
{
tmp_argv = argv;
}
-
- GLOBUS_GSI_SYSCONFIG_GET_CURRENT_WORKING_DIR(&cwd_str);
-
+
+ GLOBUS_GSI_SYSCONFIG_GET_CURRENT_WORKING_DIR(&cwd_str);
+
exec_name = tmp_argv[0];
/* set default exe name */
globus_location(&tmp_str);
@@ -3211,7 +3210,7 @@ globus_i_gfs_config_init(
global_config_file = "/etc/grid-security/gridftp.conf";
local_config_file = NULL;
conf_dir = NULL;
-
+
for(arg_num = 0; arg_num < argc; arg_num++)
{
argp = tmp_argv[arg_num];
@@ -3223,7 +3222,7 @@ globus_i_gfs_config_init(
{
argp++;
}
-
+
if(argp[0] == 'c' && argp[1] == '\0' && tmp_argv[arg_num + 1])
{
local_config_file = globus_libc_strdup(tmp_argv[arg_num + 1]);
@@ -3231,7 +3230,7 @@ globus_i_gfs_config_init(
arg_num++;
continue;
}
-
+
if(argp[0] == 'C' && argp[1] == '\0' && tmp_argv[arg_num + 1])
{
conf_dir = globus_libc_strdup(tmp_argv[arg_num + 1]);
@@ -3245,14 +3244,14 @@ globus_i_gfs_config_init(
continue;
}
}
-
+
if(local_config_file == NULL && !argv_only)
{
globus_eval_path("${sysconfdir}/gridftp.conf", &local_config_file);
}
globus_l_gfs_config_load_defaults();
-
+
if(base_str)
{
globus_free(cwd_str);
@@ -3279,7 +3278,7 @@ globus_i_gfs_config_init(
goto error;
}
}
-
+
if(local_config_file != NULL)
{
if(*local_config_file != '/')
@@ -3303,7 +3302,7 @@ globus_i_gfs_config_init(
{
rc = globus_l_gfs_config_load_envs_from_file(global_config_file);
}
-
+
if(!argv_only)
{
globus_l_gfs_config_load_config_env();
@@ -3313,15 +3312,15 @@ globus_i_gfs_config_init(
{
goto error;
}
-
+
result = globus_l_gfs_config_misc();
if(result != GLOBUS_SUCCESS)
{
- globus_gfs_log_exit_message("Error in post config setup:\n %s",
+ globus_gfs_log_exit_message("Error in post config setup:\n %s",
globus_error_print_friendly(globus_error_peek(result)));
goto error;
}
-
+
globus_l_gfs_config_set("exec_name", 0, exec_name);
globus_l_gfs_config_set("argv", 0, tmp_argv);
globus_l_gfs_config_set("argc", argc, NULL);
@@ -3338,7 +3337,7 @@ globus_i_gfs_config_init(
{
globus_free(base_str);
}
-
+
globus_mutex_init(&globus_i_gfs_config_mutex, NULL);
GlobusGFSDebugExit();
@@ -3354,15 +3353,15 @@ globus_i_gfs_config_int(
const char * option_name)
{
globus_l_gfs_config_option_t * option;
- int value = 0;
+ int value = 0;
GlobusGFSName(globus_i_gfs_config_int);
GlobusGFSDebugEnter();
-
- option = (globus_l_gfs_config_option_t *)
+
+ option = (globus_l_gfs_config_option_t *)
globus_hashtable_lookup(&option_table, (void *) option_name);
-
+
if(option)
- {
+ {
value = option->int_value;
}
@@ -3376,15 +3375,15 @@ globus_i_gfs_config_get(
const char * option_name)
{
globus_l_gfs_config_option_t * option;
- void * value = NULL;
+ void * value = NULL;
GlobusGFSName(globus_i_gfs_config_get);
GlobusGFSDebugEnter();
-
- option = (globus_l_gfs_config_option_t *)
+
+ option = (globus_l_gfs_config_option_t *)
globus_hashtable_lookup(&option_table, (void *) option_name);
-
+
if(option && option->value)
- {
+ {
value = option->value;
}
@@ -3418,7 +3417,7 @@ globus_i_gfs_config_is_anonymous(
valid = GLOBUS_TRUE;
}
}
-
+
GlobusGFSDebugExit();
return valid;
}
@@ -3444,7 +3443,7 @@ globus_i_gfs_config_allow_addr(
globus_i_gfs_config_string("ipc_deny_from"));
}
else
- {
+ {
allow_list = globus_libc_strdup(
globus_i_gfs_config_string("allow_from"));
deny_list = globus_libc_strdup(
@@ -3517,7 +3516,7 @@ globus_i_gfs_config_get_module_name(
GlobusGFSName(globus_i_gfs_config_get_module_name);
GlobusGFSDebugEnter();
- module_list = (globus_list_t *) globus_i_gfs_config_get("module_list");
+ module_list = (globus_list_t *) globus_i_gfs_config_get("module_list");
for(list = module_list;
!globus_list_empty(list) && !found;
list = globus_list_rest(list))
@@ -3539,7 +3538,7 @@ globus_i_gfs_config_get_module_name(
{
found = GLOBUS_TRUE;
}
- }
+ }
if(found)
{
out_module = module;
@@ -3560,7 +3559,7 @@ globus_gfs_config_get_bool(
globus_bool_t rc;
globus_mutex_lock(&globus_i_gfs_config_mutex);
- rc = globus_i_gfs_config_bool(option_name);
+ rc = globus_i_gfs_config_bool(option_name);
globus_mutex_unlock(&globus_i_gfs_config_mutex);
return rc;
}
@@ -3572,7 +3571,7 @@ globus_gfs_config_get_string(
char * rc;
globus_mutex_lock(&globus_i_gfs_config_mutex);
- rc = globus_i_gfs_config_string(option_name);
+ rc = globus_i_gfs_config_string(option_name);
globus_mutex_unlock(&globus_i_gfs_config_mutex);
return rc;
}
@@ -3584,7 +3583,7 @@ globus_gfs_config_get_list(
globus_list_t * rc;
globus_mutex_lock(&globus_i_gfs_config_mutex);
- rc = globus_i_gfs_config_list(option_name);
+ rc = globus_i_gfs_config_list(option_name);
globus_mutex_unlock(&globus_i_gfs_config_mutex);
return rc;
}
@@ -3596,7 +3595,7 @@ globus_gfs_config_get(
void * rc;
globus_mutex_lock(&globus_i_gfs_config_mutex);
- rc = globus_i_gfs_config_get(option_name);
+ rc = globus_i_gfs_config_get(option_name);
globus_mutex_unlock(&globus_i_gfs_config_mutex);
return rc;
}
@@ -3608,7 +3607,7 @@ globus_gfs_config_get_int(
int rc;
globus_mutex_lock(&globus_i_gfs_config_mutex);
- rc = globus_i_gfs_config_int(option_name);
+ rc = globus_i_gfs_config_int(option_name);
globus_mutex_unlock(&globus_i_gfs_config_mutex);
return rc;
}
diff --git a/gridftp/server/src/globus_i_gfs_control.c b/gridftp/server/src/globus_i_gfs_control.c
index e18953becc..496ef12df4 100644
--- a/gridftp/server/src/globus_i_gfs_control.c
+++ b/gridftp/server/src/globus_i_gfs_control.c
@@ -91,7 +91,7 @@ typedef struct
char * username;
globus_gridftp_server_control_t server_handle;
globus_object_t * close_error;
-
+
globus_hashtable_t custom_cmd_table;
} globus_l_gfs_server_instance_t;
@@ -105,7 +105,7 @@ typedef struct
globus_gfs_operation_type_t bounce_type;
globus_i_gfs_data_callback_t bounce_cb;
- void * bounce_info;
+ void * bounce_info;
} globus_l_gfs_request_info_t;
typedef struct globus_l_gfs_auth_info_s
@@ -123,7 +123,7 @@ static globus_bool_t globus_l_gfs_control_should_be_gone = GL
char *
globus_i_gsc_string_to_959(
int code,
- const char * in_str,
+ const char * in_str,
const char * preline);
static
@@ -133,7 +133,7 @@ globus_l_gfs_control_log(
const char * message,
int type,
void * user_arg);
-
+
static
void
globus_l_gfs_request_custom_command(
@@ -147,7 +147,7 @@ static int
globus_l_gfs_activate()
{
int rc = 0;
-
+
rc = globus_module_activate(GLOBUS_XIO_MODULE);
if(rc != 0)
{
@@ -168,7 +168,7 @@ globus_l_gfs_activate()
{
return rc;
}
-
+
GlobusDebugInit(GLOBUS_GRIDFTP_SERVER,
ERROR WARNING TRACE INTERNAL_TRACE INFO STATE INFO_VERBOSE);
@@ -248,7 +248,7 @@ globus_i_gfs_control_init()
"connections_max",
globus_l_gfs_conn_max_change_cb,
NULL);
-
+
GlobusGFSDebugExit();
}
@@ -264,12 +264,12 @@ globus_i_gfs_control_stop()
{
globus_l_gfs_control_active = GLOBUS_FALSE;
globus_l_gfs_control_should_be_gone = GLOBUS_TRUE;
-
+
for(list = globus_l_gfs_server_handle_list;
!globus_list_empty(list);
list = globus_list_rest(list))
{
- instance = (globus_l_gfs_server_instance_t *)
+ instance = (globus_l_gfs_server_instance_t *)
globus_list_first(list);
globus_gridftp_server_control_stop(instance->server_handle);
@@ -300,7 +300,7 @@ globus_l_gfs_request_info_init(
result = GlobusGFSErrorMemory("request");
goto error;
}
-
+
request->control_op = control_op;
request->instance = instance;
request->info = info_struct;
@@ -411,13 +411,13 @@ globus_l_gfs_kvstr_path(
{
new_kvstr = globus_libc_strdup(kvstr);
}
-
+
globus_free(chk_path);
globus_free(real_path);
-
+
*out_kvstr = new_kvstr;
return GLOBUS_SUCCESS;
-
+
err:
if(chk_path)
{
@@ -427,8 +427,8 @@ globus_l_gfs_kvstr_path(
{
globus_free(real_path);
}
-
- return result;
+
+ return result;
}
@@ -465,7 +465,7 @@ globus_l_gfs_channel_close_cb(
{
instance->close_func(instance->close_arg, instance->close_error);
}
-
+
if(instance->home_dir)
{
globus_free(instance->home_dir);
@@ -505,7 +505,7 @@ globus_l_gfs_done_cb(
globus_mutex_lock(&globus_l_gfs_control_mutex);
{
globus_l_gfs_control_should_be_gone = GLOBUS_TRUE;
-
+
globus_list_remove(&globus_l_gfs_server_handle_list,
globus_list_search(globus_l_gfs_server_handle_list, instance));
}
@@ -513,7 +513,7 @@ globus_l_gfs_done_cb(
globus_gridftp_server_control_destroy(instance->server_handle);
- instance->close_error =
+ instance->close_error =
(result == GLOBUS_SUCCESS ? NULL : globus_error_get(result));
result = globus_xio_register_close(
instance->xio_handle,
@@ -574,54 +574,53 @@ globus_l_gfs_auth_session_cb(
"User %s successfully authorized.\n",
reply->info.session.username);
- if(reply->info.session.home_dir != NULL &&
+ if(reply->info.session.home_dir != NULL &&
globus_i_gfs_config_bool("use_home_dirs"))
{
-#ifdef WIN32
- if(isalpha(reply->info.session.home_dir[0]) &&
+#ifdef WIN32
+ if(isalpha(reply->info.session.home_dir[0]) &&
reply->info.session.home_dir[1] == ':')
{
reply->info.session.home_dir[1] = reply->info.session.home_dir[0];
reply->info.session.home_dir[0] = '/';
- }
-#endif
+ }
+#endif
globus_gridftp_server_control_set_cwd(
auth_info->instance->server_handle,
reply->info.session.home_dir);
}
-
+
if(reply->info.session.home_dir)
{
- auth_info->instance->home_dir =
+ auth_info->instance->home_dir =
globus_libc_strdup(reply->info.session.home_dir);
}
- /*
+ /*
else
{
auth_info->instance->home_dir = globus_libc_strdup("/");
}
*/
- auth_info->instance->username =
+ auth_info->instance->username =
globus_libc_strdup(reply->info.session.username);
-
- if(reply->op_info &&
+
+ if(reply->op_info &&
!globus_hashtable_empty(&reply->op_info->custom_command_table))
{
globus_list_t * list;
- int rc;
globus_i_gfs_cmd_ent_t * cmd_ent;
-
- auth_info->instance->custom_cmd_table =
+
+ auth_info->instance->custom_cmd_table =
reply->op_info->custom_command_table;
-
- rc = globus_hashtable_to_list(
+
+ globus_hashtable_to_list(
&reply->op_info->custom_command_table, &list);
-
+
while(!globus_list_empty(list))
{
- cmd_ent = (globus_i_gfs_cmd_ent_t *)
+ cmd_ent = (globus_i_gfs_cmd_ent_t *)
globus_list_remove(&list, list);
-
+
result = globus_gsc_959_command_add(
auth_info->instance->server_handle,
cmd_ent->cmd_name,
@@ -636,7 +635,7 @@ globus_l_gfs_auth_session_cb(
char * tmp_msg;
tmp_msg = globus_error_print_friendly(
globus_error_peek(result));
-
+
globus_gfs_log_message(
GLOBUS_GFS_LOG_ERR,
"Could not register command '%s':\n%s",
@@ -729,7 +728,7 @@ globus_l_gfs_request_auth(
"session.authn",
0,
"user=%s DN=\"%s\"",
- user_name,
+ user_name,
subject ? subject : "");
result = globus_gridftp_server_control_get_data_auth(
@@ -775,7 +774,7 @@ globus_l_gfs_request_auth(
goto user_error;
}
}
-
+
auth_info = (globus_l_gfs_auth_info_t *) calloc(1,
sizeof(globus_l_gfs_auth_info_t));
if(auth_info == NULL)
@@ -832,7 +831,7 @@ globus_l_gfs_data_stat_cb(
if(reply->result != GLOBUS_SUCCESS)
{
int ftp_code;
-
+
/* use code and message from reply if set */
if(reply->code && reply->msg)
{
@@ -881,7 +880,7 @@ globus_l_gfs_data_stat_cb(
GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_SUCCESS,
GLOBUS_NULL);
}
-
+
if(reply->code / 100 != 1)
{
info = (globus_gfs_stat_info_t *) request->info;
@@ -917,7 +916,7 @@ globus_l_gfs_request_stat(
instance = (globus_l_gfs_server_instance_t *) user_arg;
- stat_info = (globus_gfs_stat_info_t *)
+ stat_info = (globus_gfs_stat_info_t *)
globus_calloc(1, sizeof(globus_gfs_stat_info_t));
result = globus_l_gfs_request_info_init(
@@ -947,11 +946,11 @@ globus_l_gfs_request_stat(
GlobusGFSDebugExit();
return;
-
+
error_init:
{
int ftp_code;
-
+
/* pull response code from error */
if((ftp_code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) == 0)
@@ -1022,7 +1021,7 @@ globus_l_gfs_data_command_cb(
globus_gsc_959_finished_command(op, msg);
globus_free(msg);
break;
-
+
case GLOBUS_GFS_CMD_SITE_CHROOT:
if(request->instance->home_dir)
{
@@ -1085,14 +1084,14 @@ globus_l_gfs_data_command_cb(
globus_gsc_959_finished_command(op, msg);
globus_free(msg);
break;
-
+
case GLOBUS_GFS_CMD_HTTP_PUT:
case GLOBUS_GFS_CMD_HTTP_GET:
if(reply->code / 100 == 1)
{
struct timeval now;
gettimeofday(&now, NULL);
-
+
switch(reply->code)
{
case 112:
@@ -1109,7 +1108,7 @@ globus_l_gfs_data_command_cb(
default:
return;
}
-
+
globus_i_gsc_cmd_intermediate_reply(op, msg);
globus_free(msg);
}
@@ -1121,7 +1120,7 @@ globus_l_gfs_data_command_cb(
_tmp = globus_common_create_string(
"OK.\n%s", reply->msg);
msg = globus_gsc_string_to_959(200, _tmp, NULL);
- }
+ }
else
{
msg = strdup("200 OK.\r\n");
@@ -1141,7 +1140,7 @@ globus_l_gfs_data_command_cb(
}
}
else
- {
+ {
globus_gsc_959_finished_command(op, "250 OK.\r\n");
}
break;
@@ -1177,10 +1176,10 @@ globus_l_gfs_data_command_cb(
globus_free(tmp_msg);
globus_free(msg);
}
-
+
if(reply->code / 100 == 1)
return;
-
+
if(info)
{
if(info->pathname)
@@ -1212,7 +1211,7 @@ globus_l_gfs_data_command_cb(
globus_free(info->op_info->argv[ctr]);
}
globus_free(info->op_info->argv);
- }
+ }
globus_free(info->op_info);
}
globus_free(info);
@@ -1254,20 +1253,20 @@ globus_l_gfs_data_internal_stat_cb(
{
globus_gfs_command_info_t * command_info;
globus_gfs_data_reply_t command_reply;
-
+
memset(&command_reply, 0, sizeof(globus_gfs_data_reply_t));
command_info = (globus_gfs_command_info_t *) request->info;
command_reply.info.command.command = command_info->command;
command_reply.result = reply->result;
-
+
request->bounce_cb(&command_reply, request);
}
break;
-
+
default:
break;
}
-
+
GlobusGFSDebugExit();
}
@@ -1297,7 +1296,7 @@ globus_l_gfs_request_custom_command(
instance = (globus_l_gfs_server_instance_t *) user_arg;
- command_info = (globus_gfs_command_info_t *)
+ command_info = (globus_gfs_command_info_t *)
globus_calloc(1, sizeof(globus_gfs_command_info_t));
result = globus_l_gfs_request_info_init(
@@ -1310,22 +1309,22 @@ globus_l_gfs_request_custom_command(
if(strcmp(cmd_array[0], "SITE") == 0)
{
char key[1024];
-
+
snprintf(key, sizeof(key), "%s %s", cmd_array[0], cmd_array[1]);
cmd_ent = globus_hashtable_lookup(
&instance->custom_cmd_table, key);
}
else
- {
+ {
cmd_ent = globus_hashtable_lookup(
&instance->custom_cmd_table, cmd_array[0]);
}
-
+
if(cmd_ent)
{
command_info->command = cmd_ent->cmd_id;
if(cmd_ent->has_pathname)
- {
+ {
switch(cmd_ent->access_type)
{
case GFS_ACL_ACTION_READ:
@@ -1340,11 +1339,11 @@ globus_l_gfs_request_custom_command(
default:
acc = GFS_L_WRITE;
break;
- }
+ }
result = globus_l_gfs_get_full_path(
- instance,
- cmd_array[argc - 1],
- &command_info->pathname,
+ instance,
+ cmd_array[argc - 1],
+ &command_info->pathname,
acc);
if(command_info->pathname == NULL)
{
@@ -1356,7 +1355,7 @@ globus_l_gfs_request_custom_command(
command_info->pathname = globus_libc_strdup(cmd_array[argc - 1]);
}
- command_info->op_info =
+ command_info->op_info =
globus_calloc(1, sizeof(globus_i_gfs_op_info_t));
command_info->op_info->cmd_ent = cmd_ent;
@@ -1364,7 +1363,7 @@ globus_l_gfs_request_custom_command(
command_info->op_info->argv = globus_calloc(argc, sizeof(char *));
for(i = 0; i < argc; i++)
{
- command_info->op_info->argv[i] =
+ command_info->op_info->argv[i] =
globus_libc_strdup(cmd_array[i]);
}
@@ -1388,23 +1387,23 @@ globus_l_gfs_request_custom_command(
globus_l_gfs_control_log(instance->server_handle, msg_for_log,
type, instance);
free(msg_for_log);
-
+
GlobusGFSDebugExit();
return;
-err:
+err:
error_init:
globus_l_gfs_control_log(instance->server_handle, msg_for_log,
GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_ERROR, instance);
free(msg_for_log);
-
+
if(result != GLOBUS_SUCCESS)
{
char * ftp_str;
char * tmp_str;
int ftp_code;
-
+
/* pull response code from error */
if((ftp_code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) == 0)
@@ -1450,7 +1449,7 @@ globus_l_gfs_request_command(
instance = (globus_l_gfs_server_instance_t *) user_arg;
- command_info = (globus_gfs_command_info_t *)
+ command_info = (globus_gfs_command_info_t *)
globus_calloc(1, sizeof(globus_gfs_command_info_t));
result = globus_l_gfs_request_info_init(
@@ -1496,7 +1495,7 @@ globus_l_gfs_request_command(
else if(strcmp(cmd_array[0], "RNFR") == 0)
{
globus_gfs_stat_info_t * stat_info;
-
+
command_info->command = GLOBUS_GFS_CMD_RNFR;
result = globus_l_gfs_get_full_path(
instance, cmd_array[1], &command_info->pathname, GFS_L_WRITE);
@@ -1504,8 +1503,8 @@ globus_l_gfs_request_command(
{
goto err;
}
-
- stat_info = (globus_gfs_stat_info_t *)
+
+ stat_info = (globus_gfs_stat_info_t *)
globus_calloc(1, sizeof(globus_gfs_stat_info_t));
stat_info->file_only = GLOBUS_TRUE;
@@ -1545,7 +1544,7 @@ globus_l_gfs_request_command(
command_info->command = GLOBUS_GFS_CMD_DCSC;
command_info->cksm_alg = globus_libc_strdup(cmd_array[1]);
command_info->pathname = globus_libc_strdup(cmd_array[2]);
- if(command_info->pathname == NULL &&
+ if(command_info->pathname == NULL &&
strcasecmp(command_info->cksm_alg, "d") != 0)
{
goto err;
@@ -1556,7 +1555,7 @@ globus_l_gfs_request_command(
{
char * freq;
int consumed;
-
+
command_info->command = GLOBUS_GFS_CMD_CKSM;
result = globus_l_gfs_get_full_path(
instance, cmd_array[4], &command_info->pathname, GFS_L_READ);
@@ -1570,7 +1569,7 @@ globus_l_gfs_request_command(
cmd_array[2],
&command_info->cksm_offset,
&consumed);
- if(rc < 1 || *(cmd_array[2] + consumed) != '\0' ||
+ if(rc < 1 || *(cmd_array[2] + consumed) != '\0' ||
command_info->cksm_offset < 0)
{
result = GlobusGFSErrorGeneric("Invalid offset.");
@@ -1581,7 +1580,7 @@ globus_l_gfs_request_command(
cmd_array[3],
&command_info->cksm_length,
&consumed);
- if(rc < 1 || *(cmd_array[3] + consumed) != '\0' ||
+ if(rc < 1 || *(cmd_array[3] + consumed) != '\0' ||
command_info->cksm_length < -1)
{
result = GlobusGFSErrorGeneric("Invalid length.");
@@ -1589,7 +1588,7 @@ globus_l_gfs_request_command(
}
type = GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_FILE_COMMANDS;
-
+
if((freq = getenv("GFS_CKSM_MARKERS")) != NULL)
{
command_info->chmod_mode = strtol(freq, NULL, 10);
@@ -1626,13 +1625,13 @@ globus_l_gfs_request_command(
}
if (strlen(cmd_array[1]) < 14)
{
- goto err;
+ goto err;
}
{
char* tz;
struct tm modtime;
memset(&modtime, 0, sizeof(modtime));
- if (sscanf(cmd_array[1], "%4d%2d%2d%2d%2d%2d",
+ if (sscanf(cmd_array[1], "%4d%2d%2d%2d%2d%2d",
&modtime.tm_year, &modtime.tm_mon, &modtime.tm_mday,
&modtime.tm_hour, &modtime.tm_min, &modtime.tm_sec) != 6)
{
@@ -1655,7 +1654,7 @@ globus_l_gfs_request_command(
if (command_info->utime_time < 0)
{
goto err;
- }
+ }
}
type = GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_SITE;
}
@@ -1707,7 +1706,7 @@ globus_l_gfs_request_command(
else if(strcmp(cmd_array[1], "VERSION") == 0)
{
char version_string[1024];
-
+
type = GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_SITE;
snprintf(version_string, sizeof(version_string),
"200 %s\r\n", globus_i_gfs_config_string("version_string"));
@@ -1769,13 +1768,13 @@ globus_l_gfs_request_command(
}
if (strlen(cmd_array[2]) < 14)
{
- goto err;
+ goto err;
}
{
char* tz;
struct tm modtime;
memset(&modtime, 0, sizeof(modtime));
- if (sscanf(cmd_array[2], "%4d%2d%2d%2d%2d%2d",
+ if (sscanf(cmd_array[2], "%4d%2d%2d%2d%2d%2d",
&modtime.tm_year, &modtime.tm_mon, &modtime.tm_mday,
&modtime.tm_hour, &modtime.tm_min, &modtime.tm_sec) != 6)
{
@@ -1802,14 +1801,14 @@ globus_l_gfs_request_command(
if (command_info->utime_time < 0)
{
goto err;
- }
+ }
}
type = GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_SITE;
}
else if(strcmp(cmd_array[1], "SYMLINKFROM") == 0)
- {
+ {
globus_gfs_stat_info_t * stat_info;
-
+
command_info->command = GLOBUS_GFS_CMD_SITE_SYMLINKFROM;
result = globus_l_gfs_get_full_path(
instance, cmd_array[2], &command_info->pathname, GFS_L_READ);
@@ -1817,10 +1816,10 @@ globus_l_gfs_request_command(
{
goto err;
}
-
- stat_info = (globus_gfs_stat_info_t *)
+
+ stat_info = (globus_gfs_stat_info_t *)
globus_calloc(1, sizeof(globus_gfs_stat_info_t));
-
+
stat_info->file_only = GLOBUS_TRUE;
stat_info->pathname = globus_libc_strdup(command_info->pathname);
request->bounce_info = stat_info;
@@ -1890,7 +1889,7 @@ globus_l_gfs_request_command(
"%s %s", cmd_array[2], tmp_path);
globus_free(tmp_path);
}
- else if(strcasecmp(cmd_array[2], "CREATE") == 0)
+ else if(strcasecmp(cmd_array[2], "CREATE") == 0)
{
char * tmp_argstr;
result = globus_l_gfs_kvstr_path(
@@ -1903,12 +1902,12 @@ globus_l_gfs_request_command(
"%s %s", cmd_array[2], tmp_argstr);
globus_free(tmp_argstr);
}
- else if(strcasecmp(cmd_array[2], "DELETE") == 0)
+ else if(strcasecmp(cmd_array[2], "DELETE") == 0)
{
command_info->pathname = globus_common_create_string(
"%s %s", cmd_array[2], cmd_array[3]);
}
-
+
if(command_info->pathname == NULL)
{
goto err;
@@ -1919,14 +1918,14 @@ globus_l_gfs_request_command(
{
command_info->command = GLOBUS_GFS_CMD_UPAS;
command_info->pathname = globus_libc_strdup(cmd_array[2]);
-
+
type = GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_TRANSFER_STATE;
}
else if(strcmp(cmd_array[1], "UPRT") == 0)
{
command_info->command = GLOBUS_GFS_CMD_UPRT;
command_info->pathname = globus_libc_strdup(cmd_array[2]);
-
+
type = GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_TRANSFER_STATE;
}
else if(strcmp(cmd_array[1], "HTTP") == 0)
@@ -1940,8 +1939,8 @@ globus_l_gfs_request_command(
{
goto err;
}
- }
- else if(strcasecmp(cmd_array[2], "DOWNLOAD") == 0)
+ }
+ else if(strcasecmp(cmd_array[2], "DOWNLOAD") == 0)
{
command_info->command = GLOBUS_GFS_CMD_HTTP_GET;
result = globus_l_gfs_kvstr_path(
@@ -1951,7 +1950,7 @@ globus_l_gfs_request_command(
goto err;
}
}
- else if(strcasecmp(cmd_array[2], "CONFIG") == 0)
+ else if(strcasecmp(cmd_array[2], "CONFIG") == 0)
{
command_info->command = GLOBUS_GFS_CMD_HTTP_CONFIG;
command_info->pathname = globus_libc_strdup(cmd_array[3]);
@@ -1972,12 +1971,12 @@ globus_l_gfs_request_command(
{
goto err;
}
-
+
rc = globus_libc_scan_off_t(
cmd_array[2],
&command_info->cksm_offset,
&consumed);
- if(rc < 1 || *(cmd_array[2] + consumed) != '\0' ||
+ if(rc < 1 || *(cmd_array[2] + consumed) != '\0' ||
command_info->cksm_offset < 0)
{
result = GlobusGFSErrorGeneric("Invalid length.");
@@ -2035,7 +2034,7 @@ globus_l_gfs_request_command(
globus_l_gfs_control_log(instance->server_handle, msg_for_log,
type, instance);
free(msg_for_log);
-
+
GlobusGFSDebugExit();
return;
@@ -2047,20 +2046,20 @@ globus_l_gfs_request_command(
globus_l_gfs_control_log(instance->server_handle, msg_for_log,
GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_ERROR, instance);
free(msg_for_log);
-
+
if(result != GLOBUS_SUCCESS)
{
char * ftp_str;
char * tmp_str;
int ftp_code;
-
+
/* pull response code from error */
if((ftp_code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) == 0)
{
ftp_code = 500;
}
- tmp_str = globus_error_print_friendly(globus_error_peek(result));
+ tmp_str = globus_error_print_friendly(globus_error_peek(result));
ftp_str = globus_gsc_string_to_959(ftp_code, tmp_str, NULL);
globus_gsc_959_finished_command(op, ftp_str);
globus_free(tmp_str);
@@ -2188,7 +2187,7 @@ globus_l_gfs_get_event_mask(
}
if(in_event_mask & GLOBUS_GFS_EVENT_TRANSFER_COMPLETE)
{
- out_event_mask |=
+ out_event_mask |=
GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_TRANSFER_COMPLETE;
}
@@ -2215,7 +2214,7 @@ globus_l_gfs_data_event_cb(
{
case GLOBUS_GFS_EVENT_TRANSFER_BEGIN:
request->event_arg = reply->event_arg;
-
+
request->transfer_events = GLOBUS_TRUE;
event_mask = globus_l_gfs_get_event_mask(reply->event_mask);
result = globus_gridftp_server_control_events_enable(
@@ -2229,27 +2228,27 @@ globus_l_gfs_data_event_cb(
/* TODO: can we ignore this */
}
break;
-
+
case GLOBUS_GFS_EVENT_TRANSFER_CONNECTED:
globus_gridftp_server_control_begin_transfer(op);
break;
-
+
case GLOBUS_GFS_EVENT_DISCONNECTED:
globus_gridftp_server_control_disconnected(
- request->instance->server_handle,
+ request->instance->server_handle,
reply->data_arg);
break;
-
+
case GLOBUS_GFS_EVENT_BYTES_RECVD:
globus_gridftp_server_control_event_send_perf(
op, reply->node_ndx, reply->recvd_bytes);
break;
-
+
case GLOBUS_GFS_EVENT_RANGES_RECVD:
globus_gridftp_server_control_event_send_restart(
op, reply->recvd_ranges);
break;
-
+
default:
globus_assert(0 && "Unexpected event type");
break;
@@ -2273,7 +2272,7 @@ globus_l_gfs_data_transfer_cb(
request = (globus_l_gfs_request_info_t *) user_arg;
op = request->control_op;
-
+
destroy_req = !request->transfer_events;
if(reply->result != GLOBUS_SUCCESS)
@@ -2281,7 +2280,7 @@ globus_l_gfs_data_transfer_cb(
char * msg;
globus_result_t result;
int ftp_code;
-
+
/* use code and message from reply if set */
if(reply->code && reply->msg)
{
@@ -2435,11 +2434,11 @@ globus_l_gfs_request_send(
GlobusGFSDebugExit();
return;
-
+
error_init:
{
int ftp_code;
-
+
/* pull response code from error */
if((ftp_code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) == 0)
@@ -2496,7 +2495,7 @@ globus_l_gfs_request_recv(
{
goto error_init;
}
-
+
/* if restart range is anything but 0-MAX then we don't trunc the file */
if(globus_range_list_size(range_list))
{
@@ -2514,9 +2513,9 @@ globus_l_gfs_request_recv(
"%"GLOBUS_OFF_T_FORMAT,
&recv_info->partial_offset);
recv_info->partial_length = -1;
-
+
/* ESTO A 0 /file is not the same as STOR /file
- ESTO doesn't truncate the file.
+ ESTO doesn't truncate the file.
*/
recv_info->truncate = GLOBUS_FALSE;
@@ -2526,7 +2525,7 @@ globus_l_gfs_request_recv(
{
recv_info->partial_offset = 0;
recv_info->partial_length = -1;
-
+
if(mod_name != NULL)
{
recv_info->module_name = globus_libc_strdup(mod_name);
@@ -2544,7 +2543,7 @@ globus_l_gfs_request_recv(
}
}
-
+
result = globus_l_gfs_get_full_path(
instance, path, &recv_info->pathname, GFS_L_WRITE);
if(result != GLOBUS_SUCCESS)
@@ -2555,7 +2554,7 @@ globus_l_gfs_request_recv(
recv_info->stripe_count = 1;
recv_info->node_count = 1;
recv_info->data_arg = data_handle;
-
+
globus_i_gfs_data_request_recv(
NULL,
instance->session_arg,
@@ -2567,11 +2566,11 @@ globus_l_gfs_request_recv(
GlobusGFSDebugExit();
return;
-
+
error_init:
{
int ftp_code;
-
+
/* pull response code from error */
if((ftp_code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) == 0)
@@ -2643,11 +2642,11 @@ globus_l_gfs_request_list(
GlobusGFSDebugExit();
return;
-
+
error_init:
{
int ftp_code;
-
+
/* pull response code from error */
if((ftp_code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) == 0)
@@ -2776,25 +2775,25 @@ globus_l_gfs_get_data_info(
NULL);
globus_assert(result == GLOBUS_SUCCESS);
- result = globus_gridftp_server_control_get_layout(
+ result = globus_gridftp_server_control_get_layout(
op,
(globus_gsc_layout_t *) &data_info->stripe_layout,
&data_info->stripe_blocksize);
globus_assert(result == GLOBUS_SUCCESS);
-
- if(data_info->stripe_blocksize == 0 ||
+
+ if(data_info->stripe_blocksize == 0 ||
globus_i_gfs_config_bool("stripe_blocksize_locked"))
{
- data_info->stripe_blocksize =
+ data_info->stripe_blocksize =
globus_i_gfs_config_int("stripe_blocksize");
}
if(globus_i_gfs_config_int("stripe_layout_locked"))
{
- data_info->stripe_layout =
+ data_info->stripe_layout =
globus_i_gfs_config_int("stripe_layout");
}
else
- {
+ {
switch(data_info->stripe_layout)
{
case GLOBUS_GSC_LAYOUT_TYPE_PARTITIONED:
@@ -2805,12 +2804,12 @@ globus_l_gfs_get_data_info(
break;
case GLOBUS_GSC_LAYOUT_TYPE_NONE:
default:
- data_info->stripe_layout =
+ data_info->stripe_layout =
globus_i_gfs_config_int("stripe_layout");
break;
}
}
-
+
data_info->blocksize = globus_i_gfs_config_int("blocksize");
GlobusGFSDebugExit();
@@ -2850,29 +2849,29 @@ globus_l_gfs_request_passive_data(
globus_l_gfs_get_data_info(op, data_info, net_prt);
- if(globus_i_gfs_config_bool("encrypt_data") &&
+ if(globus_i_gfs_config_bool("encrypt_data") &&
(data_info->prot != 'P' || data_info->dcau == 'N'))
{
tmp_str = strdup("Encryption is required.");
err_code = GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_DATA_CONN_AUTH;
goto error_postinit;
}
-
+
if(pathname)
{
- /* delayed pasv, final perm check will happen on the stor/retr */
+ /* delayed pasv, final perm check will happen on the stor/retr */
result = globus_l_gfs_get_full_path(
instance, pathname, &data_info->pathname, GFS_L_LIST);
if(result != GLOBUS_SUCCESS)
{
err_code = GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_ACTION_FAILED;
goto error_postinit;
- }
+ }
}
globus_xio_contact_parse(&parsed_contact, instance->local_contact);
data_info->max_cs = max;
data_info->interface = globus_libc_strdup(parsed_contact.host);
-
+
globus_xio_contact_destroy(&parsed_contact);
globus_i_gfs_data_request_passive(
@@ -2885,7 +2884,7 @@ globus_l_gfs_request_passive_data(
GlobusGFSDebugExit();
return;
-
+
error_postinit:
globus_l_gfs_request_info_destroy(request);
error_init:
@@ -2999,7 +2998,7 @@ globus_l_gfs_request_active_data(
}
globus_l_gfs_get_data_info(op, data_info, net_prt);
- if(globus_i_gfs_config_bool("encrypt_data") &&
+ if(globus_i_gfs_config_bool("encrypt_data") &&
(data_info->prot != 'P' || data_info->dcau == 'N'))
{
tmp_str = strdup("Encryption is required.");
@@ -3012,9 +3011,9 @@ globus_l_gfs_request_active_data(
data_info->contact_strings = cs;
data_info->cs_count = cs_count;
data_info->interface = globus_libc_strdup(parsed_contact.host);
-
+
globus_xio_contact_destroy(&parsed_contact);
-
+
globus_i_gfs_data_request_active(
NULL,
instance->session_arg,
@@ -3025,7 +3024,7 @@ globus_l_gfs_request_active_data(
GlobusGFSDebugExit();
return;
-
+
error_postinit:
globus_l_gfs_request_info_destroy(request);
error_init:
@@ -3085,7 +3084,7 @@ globus_l_gfs_control_log(
msg = globus_libc_strdup(message);
globus_i_gfs_log_tr(msg, '\"', '\'');
globus_i_gfs_log_tr(msg, '\r', ' ');
-
+
switch(type)
{
case GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_REPLY:
@@ -3124,7 +3123,7 @@ globus_l_gfs_control_log(
msg);
break;
}
-
+
globus_free(msg);
GlobusGFSDebugExit();
@@ -3538,7 +3537,7 @@ globus_l_gfs_add_commands(
{
goto error;
}
-
+
if(globus_i_gfs_config_bool("allow_udt"))
{
result = globus_gridftp_server_control_add_feature(
@@ -3601,7 +3600,7 @@ globus_l_gfs_add_commands(
if(dsi_ver)
{
feat_str = globus_common_create_string("DSI %s", dsi_ver);
-
+
result = globus_gridftp_server_control_add_feature(
control_handle, feat_str);
globus_free(feat_str);
@@ -3697,11 +3696,11 @@ globus_l_gfs_control_watchdog_check(
}
}
globus_mutex_unlock(&globus_l_gfs_control_mutex);
-
+
if(can_kill)
{
globus_reltime_t timer;
-
+
GlobusTimeReltimeSet(timer, 60, 0);
globus_callback_register_oneshot(
NULL,
@@ -3798,7 +3797,7 @@ globus_i_gfs_control_start(
idle_timeout = globus_i_gfs_config_int("control_idle_timeout");
preauth_timeout = globus_i_gfs_config_int("control_preauth_timeout");
-
+
result = globus_gridftp_server_control_attr_set_idle_time(
attr, idle_timeout, preauth_timeout);
if(result != GLOBUS_SUCCESS)
@@ -3870,7 +3869,7 @@ globus_i_gfs_control_start(
goto error_attr_setup;
}
- module_list = (globus_list_t *) globus_i_gfs_config_get("module_list");
+ module_list = (globus_list_t *) globus_i_gfs_config_get("module_list");
for(list = module_list;
!globus_list_empty(list);
list = globus_list_rest(list))
@@ -3895,7 +3894,7 @@ globus_i_gfs_control_start(
goto error_attr_setup;
}
globus_free(alias);
- }
+ }
result = globus_gridftp_server_control_attr_set_list(
attr, globus_l_gfs_request_list, instance);
@@ -3939,7 +3938,7 @@ globus_i_gfs_control_start(
goto error_add_commands;
}
-
+
/* disable commands if the user says to */
if((value = globus_i_gfs_config_string("disable_command_list")) != NULL)
@@ -3962,7 +3961,7 @@ globus_i_gfs_control_start(
{
goto error_start;
}
-
+
globus_gfs_log_event(
GLOBUS_GFS_LOG_INFO,
GLOBUS_GFS_LOG_EVENT_START,
diff --git a/gridftp/server/src/globus_i_gfs_data.c b/gridftp/server/src/globus_i_gfs_data.c
index 0bf0ea4369..4fccc9dfb5 100644
--- a/gridftp/server/src/globus_i_gfs_data.c
+++ b/gridftp/server/src/globus_i_gfs_data.c
@@ -218,10 +218,10 @@ typedef struct
globus_bool_t final;
} globus_l_gfs_data_bounce_t;
-typedef struct
+typedef struct
{
char * all;
-
+
char * modify;
globus_bool_t modify_seen;
char * checksum_md5;
@@ -271,21 +271,21 @@ typedef struct
char * client_appver;
char * client_scheme;
gss_cred_id_t dcsc_cred;
-
+
globus_bool_t upas;
globus_ftp_control_handle_t udt_data_channel;
globus_bool_t udt_data_channel_inuse;
-
+
globus_list_t ** active_rp_list;
globus_list_t * rp_list;
-
+
globus_bool_t sharing;
char * sharing_state_dir;
char * sharing_id;
char * sharing_sharee;
-
+
char * taskid;
-
+
char * s3id;
char * s3key;
gss_cred_id_t http_cred;
@@ -297,16 +297,16 @@ typedef struct
globus_xio_driver_t http_driver;
char * storattr_str;
-
+
globus_bool_t order_data;
-
+
int last_active;
globus_off_t watch_updates;
globus_bool_t watch;
globus_bool_t watch_aborted;
char * watch_op;
globus_callback_handle_t watch_handle;
-
+
globus_hashtable_t custom_cmd_table;
} globus_l_gfs_data_session_t;
@@ -357,7 +357,7 @@ typedef struct globus_l_gfs_data_operation_s
int list_depth;
int traversal_options;
globus_result_t delayed_error;
-
+
char * user_msg;
int user_code;
@@ -367,7 +367,7 @@ typedef struct globus_l_gfs_data_operation_s
globus_range_list_t recvd_ranges;
int retr_markers;
globus_bool_t markers;
-
+
globus_l_gfs_data_path_list_t * path_list;
globus_l_gfs_data_path_list_t * current_path;
globus_l_gfs_data_path_list_t * root_paths;
@@ -403,12 +403,12 @@ typedef struct globus_l_gfs_data_operation_s
/**/
globus_l_gfs_storattr_t * storattr;
-
+
char * http_response_str;
char * http_ip;
int update_interval;
-
+
void * event_arg;
int event_mask;
@@ -570,7 +570,7 @@ static
void
globus_l_gfs_data_active_kickout(
void * user_arg);
-
+
static
void
globus_l_gfs_data_passive_kickout(
@@ -594,24 +594,24 @@ globus_l_gfs_data_brain_ready_delay_cb(
void
globus_i_gfs_data_http_read_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t length,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg);
void
globus_i_gfs_data_http_write_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t length,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg);
-globus_result_t
+globus_result_t
globus_i_gfs_data_http_get(
globus_l_gfs_data_operation_t * op,
char * path,
@@ -656,13 +656,12 @@ globus_i_gfs_data_http_print_response(
char * header_str = NULL;
char * header_tmp;
globus_result_t result;
- int rc;
globus_xio_http_header_t * header;
char * b64_header = NULL;
char * b64_body = NULL;
int body_len = 0;
-
- rc = globus_hashtable_to_list(header_table, &header_list);
+
+ globus_hashtable_to_list(header_table, &header_list);
header_str = strdup("");
while(!globus_list_empty(header_list))
@@ -681,10 +680,10 @@ globus_i_gfs_data_http_print_response(
body, body_len, (globus_byte_t *) b64_body, NULL);
globus_assert(result == GLOBUS_SUCCESS);
}
-
+
b64_header = malloc(strlen(header_str) * 4 / 3 + 4);
result = globus_l_gfs_base64_encode(
- (globus_byte_t *) header_str, strlen(header_str),
+ (globus_byte_t *) header_str, strlen(header_str),
(globus_byte_t *) b64_header, NULL);
globus_assert(result == GLOBUS_SUCCESS);
@@ -712,8 +711,8 @@ globus_i_gfs_data_http_print_response(
response_code,
b64_header);
}
-
- globus_free(header_str);
+
+ globus_free(header_str);
globus_free(b64_header);
if(b64_body)
{
@@ -727,7 +726,7 @@ globus_i_gfs_data_http_print_response(
static char globus_l_gfs_base64_pad = '=';
static char * globus_l_gfs_base64_n =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static
+static
globus_result_t
globus_l_gfs_base64_decode(
const unsigned char * inbuf,
@@ -745,7 +744,7 @@ globus_l_gfs_base64_decode(
{
if((p = strchr(globus_l_gfs_base64_n, inbuf[i])) == NULL)
{
- goto err;
+ goto err;
}
D = p - globus_l_gfs_base64_n;
switch(i&3)
@@ -772,27 +771,27 @@ globus_l_gfs_base64_decode(
switch(i&3)
{
case 1:
- goto err;
-
+ goto err;
+
case 2:
if(D&15)
{
- goto err;
+ goto err;
}
if(strcmp((char *) &inbuf[i], "=="))
{
- goto err;
+ goto err;
}
break;
case 3:
if(D&3)
{
- goto err;
+ goto err;
}
if(strcmp((char *) &inbuf[i], "="))
{
- goto err;
+ goto err;
}
break;
@@ -814,7 +813,7 @@ char *
globus_l_gfs_defaulthome()
{
char * home_dir;
-#ifdef WIN32
+#ifdef WIN32
char * ptr;
if(getenv("HOMEDRIVE") && getenv("HOMEPATH"))
@@ -851,7 +850,7 @@ globus_l_gfs_defaulthome()
* for disabled accounts. Returns an error globus_result_t otherwise.
* Assumes caller has checked value of pw (i.e. pw is not NULL).
*/
-
+
static
globus_result_t
globus_l_gfs_validate_pwent(
@@ -876,7 +875,7 @@ globus_l_gfs_validate_pwent(
("shell is not a regular file: %s", pw->pw_shell));
goto err;
}
-
+
/* shell executable? */
if((statbuf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)
{
@@ -887,7 +886,7 @@ globus_l_gfs_validate_pwent(
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
-
+
err:
GlobusGFSDebugExitWithError();
return result;
@@ -987,9 +986,9 @@ globus_l_gfs_data_watchdog_check(
void * arg)
{
globus_l_gfs_data_session_t * session_handle;
-
+
session_handle = (globus_l_gfs_data_session_t *) arg;
-
+
if(!session_handle)
{
globus_gfs_log_message(GLOBUS_GFS_LOG_ERR,
@@ -998,7 +997,7 @@ globus_l_gfs_data_watchdog_check(
}
else if(session_handle->watch && session_handle->watch_aborted)
{
- if(time(NULL) >
+ if(time(NULL) >
session_handle->last_active + globus_l_gfs_watchdog_limit)
{
char * msg = globus_common_create_string(
@@ -1032,7 +1031,7 @@ globus_l_gfs_data_reset_watchdog(
session_handle->watch_op = operation;
session_handle->watch_updates = 0;
session_handle->watch_aborted = GLOBUS_FALSE;
-
+
if(session_handle->watch)
{
if(session_handle->watch_handle == 0)
@@ -1169,7 +1168,7 @@ globus_l_gfs_data_post_transfer_event_cb(
}
return remote_data_arg;
-}
+}
globus_result_t
globus_i_gfs_data_virtualize_path(
@@ -1180,28 +1179,28 @@ globus_i_gfs_data_virtualize_path(
globus_l_gfs_data_session_t * session_handle;
char * tmp_ptr;
session_handle = (globus_l_gfs_data_session_t *) session_arg;
-
+
if(!session_handle->chroot_path)
{
*ret_string = NULL;
return GLOBUS_SUCCESS;
}
-
+
tmp_ptr = strstr(in_string, session_handle->chroot_path);
-
+
if(!tmp_ptr)
{
*ret_string = NULL;
return GLOBUS_SUCCESS;
}
-
+
*ret_string = globus_malloc(
strlen(in_string) + strlen(session_handle->chroot_path));
-
+
strncpy(*ret_string, in_string, tmp_ptr - in_string);
- strcpy(*ret_string + (tmp_ptr - in_string),
+ strcpy(*ret_string + (tmp_ptr - in_string),
tmp_ptr + strlen((session_handle->chroot_path)));
-
+
return GLOBUS_SUCCESS;
}
@@ -1331,7 +1330,7 @@ globus_i_gfs_get_full_path(
result = GlobusGFSErrorGeneric("invalid pathname");
goto done;
}
-
+
#ifdef WIN32
#define WIN_CHARS_NOT_ALLOWED ":*?\"<>|"
tmp_path = in_path;
@@ -1348,10 +1347,10 @@ globus_i_gfs_get_full_path(
result = GlobusGFSErrorGeneric(
"A filename cannot contain any of the following characters: "
"\\ / : * ? \" < > |");
- goto done;
- }
+ goto done;
+ }
#endif
-
+
if(*in_path == '/')
{
strncpy(path, in_path, sizeof(path));
@@ -1362,7 +1361,7 @@ globus_i_gfs_get_full_path(
{
result = GlobusGFSErrorGeneric(
"No home directory, cannot expand ~");
- goto done;
+ goto done;
}
in_path++;
if(*in_path == '/')
@@ -1403,11 +1402,11 @@ globus_i_gfs_get_full_path(
/* XXX expand other usernames here */
result = GlobusGFSErrorGeneric(
"Cannot expand ~");
- goto done;
+ goto done;
}
-
+
cwd = globus_libc_strdup(res_pwd->pw_dir);
- }
+ }
cwd_len = strlen(cwd);
if(cwd_len > 1 && cwd[cwd_len - 1] == '/')
{
@@ -1441,7 +1440,7 @@ globus_i_gfs_get_full_path(
}
DriveLetterToWin(norm_path);
-
+
result = globus_i_gfs_data_check_path(
session_arg, norm_path, ret_path, access_type, 1);
if(result != GLOBUS_SUCCESS)
@@ -1495,7 +1494,7 @@ globus_i_gfs_data_check_path(
globus_list_t * rp_list;
GlobusGFSName(globus_i_gfs_data_check_path);
GlobusGFSDebugEnter();
-
+
session_handle = (globus_l_gfs_data_session_t *) session_arg;
if(globus_list_empty(*session_handle->active_rp_list) &&
@@ -1503,7 +1502,7 @@ globus_i_gfs_data_check_path(
{
allowed = GLOBUS_TRUE;
}
-
+
if(is_virtual && session_handle->chroot_path)
{
if(in_path[0] == '/' && in_path[1] == '\0')
@@ -1520,14 +1519,14 @@ globus_i_gfs_data_check_path(
{
start_path = in_path;
}
-
+
if(!allowed)
{
if(session_handle->dsi->descriptor & GLOBUS_GFS_DSI_DESCRIPTOR_HAS_REALPATH &&
- !globus_i_gfs_config_bool("rp_follow_symlinks") &&
- strcmp(start_path, "/") != 0 &&
+ !globus_i_gfs_config_bool("rp_follow_symlinks") &&
+ strcmp(start_path, "/") != 0 &&
session_handle->dsi->realpath_func != NULL)
- {
+ {
result = session_handle->dsi->realpath_func(
start_path, &true_path, session_handle->session_arg);
if(result != GLOBUS_SUCCESS)
@@ -1535,20 +1534,20 @@ globus_i_gfs_data_check_path(
char * true_base;
char * end_slash = "";
int path_len;
-
+
strncpy(path, start_path, sizeof(path));
path[MAXPATHLEN - 1] = '\0';
-
+
path_len = strlen(path);
if(path[path_len - 1] == '/')
{
path[--path_len] = '\0';
end_slash = "/";
}
-
+
tmp_ptr = strrchr(path, '/');
*(tmp_ptr++) = '\0';
-
+
if(*path == '\0')
{
result = GLOBUS_FAILURE;
@@ -1558,7 +1557,7 @@ globus_i_gfs_data_check_path(
result = session_handle->dsi->realpath_func(
path, &true_base, session_handle->session_arg);
}
-
+
if(result != GLOBUS_SUCCESS)
{
result = GLOBUS_SUCCESS;
@@ -1588,7 +1587,7 @@ globus_i_gfs_data_check_path(
*ret_path = NULL;
}
}
-
+
if(true_path)
{
@@ -1608,26 +1607,26 @@ globus_i_gfs_data_check_path(
rp_list = session_handle->rp_list;
}
-
+
while(!globus_list_empty(rp_list))
{
check_path = true_path;
do
{
in_path_len = strlen(check_path);
-
+
for(list = rp_list;
!globus_list_empty(list) && !allowed && !disallowed;
list = globus_list_rest(list))
- {
+ {
alias_ent = globus_list_first(list);
-
+
/* disallow if this a dir check and any contents are denied */
if(access_type & GFS_L_DIR && alias_ent->access & GFS_L_NONE)
{
if(strncmp(check_path, alias_ent->alias, in_path_len) == 0 &&
(check_path[in_path_len - 1] == '/' ||
- alias_ent->alias[in_path_len] == '\0' ||
+ alias_ent->alias[in_path_len] == '\0' ||
alias_ent->alias[in_path_len] == '/'))
{
disallowed = GLOBUS_TRUE;
@@ -1639,7 +1638,7 @@ globus_i_gfs_data_check_path(
continue;
}
}
-
+
/* check if we have an exact match */
if(strcspn(alias_ent->alias, "[*?") != alias_ent->alias_len)
{
@@ -1658,7 +1657,7 @@ globus_i_gfs_data_check_path(
}
else if(strncmp(check_path, alias_ent->alias, alias_ent->alias_len) == 0 &&
(alias_ent->alias[alias_ent->alias_len - 1] == '/' ||
- check_path[alias_ent->alias_len] == '\0' ||
+ check_path[alias_ent->alias_len] == '\0' ||
check_path[alias_ent->alias_len] == '/'))
{
if(alias_ent->access & access_type)
@@ -1670,13 +1669,13 @@ globus_i_gfs_data_check_path(
disallowed = GLOBUS_TRUE;
}
}
-
+
/* check if we are a parent of an exact match */
if(!allowed && !disallowed && access_type & GFS_L_LIST)
{
if(strncmp(check_path, alias_ent->alias, in_path_len) == 0 &&
(check_path[in_path_len - 1] == '/' ||
- alias_ent->alias[in_path_len] == '\0' ||
+ alias_ent->alias[in_path_len] == '\0' ||
alias_ent->alias[in_path_len] == '/'))
{
if(alias_ent->access & access_type)
@@ -1708,17 +1707,17 @@ globus_i_gfs_data_check_path(
check_again = GLOBUS_FALSE;
}
} while(check_again);
-
+
if(!allowed)
{
result = GlobusGFSErrorGeneric(
"Path not allowed.");
-
+
rp_list = NULL;
}
else
{
- if(rp_list == *session_handle->active_rp_list &&
+ if(rp_list == *session_handle->active_rp_list &&
!globus_list_empty(session_handle->rp_list))
{
rp_list = session_handle->rp_list;
@@ -1728,15 +1727,15 @@ globus_i_gfs_data_check_path(
{
rp_list = NULL;
}
-
+
if(!rp_list && ret_path)
{
if(alias_ent && alias_ent->realpath)
{
strncpy(path, alias_ent->realpath, alias_ent->realpath_len);
- strcpy(path + alias_ent->realpath_len,
+ strcpy(path + alias_ent->realpath_len,
true_path + alias_ent->alias_len);
-
+
*ret_path = globus_libc_strdup(path);
}
else if(session_handle->chroot_path)
@@ -1750,11 +1749,11 @@ globus_i_gfs_data_check_path(
}
}
}
-
+
globus_free(true_path);
}
-
+
if(is_virtual && session_handle->chroot_path)
{
globus_free(start_path);
@@ -1979,7 +1978,7 @@ globus_l_gfs_free_session_handle(
}
globus_free(session_handle->session_info_copy);
}
-
+
if(session_handle->custom_cmd_table)
{
globus_list_t * list;
@@ -2004,7 +2003,7 @@ globus_l_gfs_free_session_handle(
}
globus_hashtable_destroy(&session_handle->custom_cmd_table);
}
-
+
if(session_handle->https_stack)
{
globus_xio_stack_destroy(session_handle->https_stack);
@@ -2198,13 +2197,13 @@ globus_i_gfs_kv_getval(
int keylen;
char * tmp_val = NULL;
globus_bool_t done = GLOBUS_FALSE;
-
+
keylen = strlen(key);
keystart = kvstring;
keyend = strchr(kvstring, '=');
while(keyend && keystart && !done)
{
- if((keylen == keyend - keystart) &&
+ if((keylen == keyend - keystart) &&
strncasecmp(key, keystart, keyend - keystart) == 0)
{
done = GLOBUS_TRUE;
@@ -2230,7 +2229,7 @@ globus_i_gfs_kv_getval(
{
strncpy(tmp_val, valstart, valend - valstart);
tmp_val[valend - valstart] = '\0';
-
+
if(urldecode)
{
globus_url_string_hex_decode(tmp_val);
@@ -2238,7 +2237,7 @@ globus_i_gfs_kv_getval(
}
}
}
-
+
return tmp_val;
}
@@ -2258,7 +2257,7 @@ globus_i_gfs_kv_replaceval(
char save;
char * enc_val;
globus_bool_t done = GLOBUS_FALSE;
-
+
if(encode)
{
enc_val = globus_url_string_hex_encode(new_val, ";");
@@ -2271,13 +2270,13 @@ globus_i_gfs_kv_replaceval(
}
enc_val = new_val;
}
-
+
keylen = strlen(key);
keystart = kvstring;
keyend = strchr(keystart, '=');
while(keyend && keystart && !done)
{
- if((keylen == keyend - keystart) &&
+ if((keylen == keyend - keystart) &&
strncasecmp(key, keystart, keyend - keystart) == 0)
{
done = GLOBUS_TRUE;
@@ -2305,7 +2304,7 @@ globus_i_gfs_kv_replaceval(
*valstart = save;
}
}
-
+
if(encode)
{
globus_free(enc_val);
@@ -2423,16 +2422,16 @@ globus_l_gfs_authorize_cb(
{
globus_gfs_finished_info_t finished_info;
globus_l_gfs_data_operation_t * op;
-
+
op = (globus_l_gfs_data_operation_t *) user_arg;
memset(&finished_info, '\0', sizeof(globus_gfs_finished_info_t));
-
+
result = GlobusGFSErrorWrapFailed(
"authorization", result);
finished_info.result = result;
finished_info.type = op->type;
finished_info.id = op->id;
-
+
if(op->callback == NULL)
{
globus_gfs_ipc_reply_finished(
@@ -2444,7 +2443,7 @@ globus_l_gfs_authorize_cb(
&finished_info,
op->user_arg);
}
-
+
globus_mutex_lock(&op->session_handle->mutex);
{
if(op->data_handle != NULL)
@@ -2455,19 +2454,19 @@ globus_l_gfs_authorize_cb(
op->data_handle->state =
GLOBUS_L_GFS_DATA_HANDLE_VALID;
break;
-
+
case GLOBUS_L_GFS_DATA_HANDLE_CLOSING:
break;
-
+
case GLOBUS_L_GFS_DATA_HANDLE_CLOSED:
case GLOBUS_L_GFS_DATA_HANDLE_CLOSING_AND_DESTROYED:
if(!op->data_handle->is_mine)
{
- remote_data_arg =
+ remote_data_arg =
op->data_handle->remote_data_arg;
}
break;
-
+
case GLOBUS_L_GFS_DATA_HANDLE_TE_PRE_CLOSED:
case GLOBUS_L_GFS_DATA_HANDLE_TE_PRE_AND_DESTROYED:
case GLOBUS_L_GFS_DATA_HANDLE_VALID:
@@ -2480,9 +2479,9 @@ globus_l_gfs_authorize_cb(
}
globus_mutex_unlock(&op->session_handle->mutex);
globus_assert(destroy_op);
-
+
globus_l_gfs_data_fire_cb(op, remote_data_arg, destroy_session);
-
+
globus_l_gfs_data_operation_destroy(op);
}
}
@@ -2618,7 +2617,7 @@ globus_i_gfs_data_new_dsi(
globus_result_t result = GLOBUS_SUCCESS;
GlobusGFSName(globus_i_gfs_data_new_dsi);
GlobusGFSDebugEnter();
-
+
if(check_name)
{
module_name = globus_i_gfs_config_get_module_name(dsi_name);
@@ -2652,7 +2651,7 @@ globus_i_gfs_data_new_dsi(
goto err;
}
}
-
+
/* check again */
new_dsi = (globus_gfs_storage_iface_t *) globus_extension_lookup(
dsi_handle, GLOBUS_GFS_DSI_REGISTRY, (void *) module_name);
@@ -2665,7 +2664,7 @@ globus_i_gfs_data_new_dsi(
*dsi_iface = new_dsi;
return GLOBUS_SUCCESS;
-
+
err:
*dsi_iface = NULL;
GlobusGFSDebugExit();
@@ -2679,7 +2678,6 @@ globus_l_gfs_data_new_dsi(
const char * in_module_name)
{
const char * module_name;
- globus_result_t result;
GlobusGFSName(globus_l_gfs_data_new_dsi);
GlobusGFSDebugEnter();
@@ -2708,7 +2706,7 @@ globus_l_gfs_data_new_dsi(
globus_extension_release(session_handle->mod_dsi_handle);
session_handle->mod_dsi_name = globus_libc_strdup(module_name);
- result = globus_i_gfs_data_new_dsi(
+ globus_i_gfs_data_new_dsi(
&session_handle->mod_dsi_handle,
session_handle->mod_dsi_name,
&session_handle->mod_dsi,
@@ -2722,7 +2720,7 @@ globus_l_gfs_data_new_dsi(
else
{
session_handle->mod_dsi_name = globus_libc_strdup(module_name);
- result = globus_i_gfs_data_new_dsi(
+ globus_i_gfs_data_new_dsi(
&session_handle->mod_dsi_handle,
session_handle->mod_dsi_name,
&session_handle->mod_dsi,
@@ -2813,7 +2811,7 @@ globus_l_gfs_data_brain_ready_delay_cb(
globus_free(op->session_handle->home_dir);
}
op->session_handle->home_dir = strdup("/");
- }
+ }
finished_info.info.session.home_dir = op->session_handle->home_dir;
@@ -2830,7 +2828,7 @@ globus_l_gfs_data_brain_ready_delay_cb(
op->user_arg);
}
globus_l_gfs_data_reset_watchdog(op->session_handle, NULL);
-
+
globus_mutex_lock(&op->session_handle->mutex);
{
GFSDataOpDec(op, destroy_op, destroy_session);
@@ -2942,9 +2940,9 @@ globus_l_libc_initgroups_cb(
{
globus_l_libc_initgroups_info_t * info;
int rc;
-
+
info = (globus_l_libc_initgroups_info_t *) user_arg;
-
+
globus_mutex_lock(&info->mutex);
{
rc = initgroups(info->username, info->gid);
@@ -2952,7 +2950,7 @@ globus_l_libc_initgroups_cb(
{
info->rc = rc;
}
-
+
info->count--;
if(info->count == 0)
{
@@ -2977,7 +2975,7 @@ globus_libc_initgroups(
int threads;
char * tmp;
- threads = 2; /* XXX include globus_callback_threads.c to get #define? */
+ threads = 2; /* XXX include globus_callback_threads.c to get #define? */
if((tmp = globus_module_getenv("GLOBUS_CALLBACK_POLLING_THREADS")) != NULL)
{
rc = atoi(tmp);
@@ -2987,7 +2985,7 @@ globus_libc_initgroups(
}
}
- info = (globus_l_libc_initgroups_info_t *)
+ info = (globus_l_libc_initgroups_info_t *)
globus_malloc(sizeof(globus_l_libc_initgroups_info_t));
globus_mutex_init(&info->mutex, NULL);
@@ -3008,14 +3006,14 @@ globus_libc_initgroups(
info);
info->count++;
}
-
+
while(info->count > 0)
{
globus_cond_wait(&info->cond, &info->mutex);
}
}
globus_mutex_unlock(&info->mutex);
-
+
tmprc = info->rc;
globus_mutex_destroy(&info->mutex);
globus_cond_destroy(&info->cond);
@@ -3028,13 +3026,13 @@ globus_libc_initgroups(
{
rc = tmprc;
}
-
+
return rc;
}
int
globus_list_cmp_alias_ent(
- void * a,
+ void * a,
void * b,
void * arg)
{
@@ -3045,7 +3043,7 @@ globus_list_cmp_alias_ent(
char b_tmp[b_ent->alias_len+1];
size_t a_i;
size_t b_i;
-
+
strcpy(a_tmp, a_ent->alias ? a_ent->alias : "");
strcpy(b_tmp, b_ent->alias ? b_ent->alias : "");
@@ -3060,14 +3058,14 @@ globus_list_cmp_alias_ent(
case '*':
a_tmp[a_i] = 1;
break;
- case '?':
+ case '?':
a_tmp[a_i] = 2;
break;
- case '[':
+ case '[':
a_tmp[a_i] = 3;
break;
}
- }
+ }
b_i = strcspn(b_tmp, "[*?");
if(b_i < b_ent->alias_len)
@@ -3077,15 +3075,15 @@ globus_list_cmp_alias_ent(
case '*':
b_tmp[b_i] = 1;
break;
- case '?':
+ case '?':
b_tmp[b_i] = 2;
break;
- case '[':
+ case '[':
b_tmp[b_i] = 3;
break;
}
}
-
+
return strcmp(a_tmp, b_tmp) >= 0;
}
@@ -3102,7 +3100,7 @@ globus_l_gfs_data_update_var_path(
GlobusGFSDebugEnter();
path = globus_libc_strdup(in_path);
-
+
if((var = strstr(path, "$USER")) != NULL)
{
*var = '\0';
@@ -3123,9 +3121,9 @@ globus_l_gfs_data_update_var_path(
}
if((var = strstr(path, "~")) != NULL)
{
- char * tmp_home;
-
- tmp_home = session_handle->home_dir ?
+ char * tmp_home;
+
+ tmp_home = session_handle->home_dir ?
session_handle->home_dir : session_handle->true_home;
*var = '\0';
var += 1;
@@ -3134,10 +3132,10 @@ globus_l_gfs_data_update_var_path(
globus_free(path);
path = new_path;
}
-
+
return path;
-}
-
+}
+
static
void
globus_l_gfs_data_update_restricted_paths(
@@ -3150,27 +3148,27 @@ globus_l_gfs_data_update_restricted_paths(
char * var_path;
GlobusGFSName(globus_l_gfs_data_update_restricted_paths);
GlobusGFSDebugEnter();
-
-
+
+
if(!globus_list_empty(*rp_list))
- {
+ {
for(list = *rp_list;
!globus_list_empty(list);
list = globus_list_rest(list))
- {
+ {
alias_ent = globus_list_first(list);
-
+
if(alias_ent->alias[0] == '~' || strchr(alias_ent->alias, '$'))
{
var_path = globus_l_gfs_data_update_var_path(
session_handle, alias_ent->alias);
-
+
globus_free(alias_ent->alias);
- alias_ent->alias = var_path;
+ alias_ent->alias = var_path;
alias_ent->alias_len = strlen(alias_ent->alias);
resort = GLOBUS_TRUE;
-
+
#ifdef WIN32
for(var_path = alias_ent->alias; *var_path != '\0'; var_path++)
{
@@ -3179,15 +3177,15 @@ globus_l_gfs_data_update_restricted_paths(
#endif
}
- if(alias_ent->realpath &&
+ if(alias_ent->realpath &&
(alias_ent->realpath[0] == '~' || strchr(alias_ent->realpath, '$')))
{
var_path = globus_l_gfs_data_update_var_path(
session_handle, alias_ent->realpath);
-
+
globus_free(alias_ent->realpath);
- alias_ent->realpath = var_path;
- alias_ent->realpath_len = strlen(alias_ent->realpath);
+ alias_ent->realpath = var_path;
+ alias_ent->realpath_len = strlen(alias_ent->realpath);
#ifdef WIN32
for(var_path = alias_ent->realpath; *var_path != '\0'; var_path++)
@@ -3197,7 +3195,7 @@ globus_l_gfs_data_update_restricted_paths(
#endif
}
}
-
+
if(resort)
{
*rp_list = globus_list_sort_destructive(
@@ -3218,31 +3216,31 @@ globus_l_gfs_data_update_restricted_paths_symlinks(
globus_bool_t resort = GLOBUS_FALSE;
GlobusGFSName(globus_l_gfs_data_update_restricted_paths);
GlobusGFSDebugEnter();
-
+
if(!globus_i_gfs_config_bool("rp_follow_symlinks") && session_handle &&
session_handle->dsi->descriptor & GLOBUS_GFS_DSI_DESCRIPTOR_HAS_REALPATH &&
session_handle->dsi->realpath_func)
{
if(!globus_list_empty(*rp_list))
- {
+ {
for(list = *rp_list;
!globus_list_empty(list);
list = globus_list_rest(list))
- {
+ {
char * real_path = NULL;
globus_bool_t result;
-
+
alias_ent = globus_list_first(list);
-
+
result = session_handle->dsi->realpath_func(
alias_ent->alias, &real_path, session_handle->session_arg);
-
+
if(result == GLOBUS_SUCCESS && real_path)
{
if(strcmp(real_path, alias_ent->alias) != 0)
{
globus_l_gfs_alias_ent_t * new_ent;
-
+
new_ent = (globus_l_gfs_alias_ent_t *)
globus_calloc(1, sizeof(globus_l_gfs_alias_ent_t));
new_ent->access = alias_ent->access;
@@ -3253,9 +3251,9 @@ globus_l_gfs_data_update_restricted_paths_symlinks(
new_ent->realpath = strdup(alias_ent->realpath);
new_ent->realpath_len = alias_ent->realpath_len;
}
-
+
globus_list_insert(&new_list, new_ent);
-
+
resort = GLOBUS_TRUE;
}
else
@@ -3263,15 +3261,15 @@ globus_l_gfs_data_update_restricted_paths_symlinks(
globus_free(real_path);
real_path = NULL;
}
- }
+ }
}
-
+
if(resort)
{
while(!globus_list_empty(new_list))
{
globus_list_insert(
- rp_list,
+ rp_list,
globus_list_remove(&new_list, new_list));
}
@@ -3298,20 +3296,20 @@ globus_l_gfs_data_parse_restricted_paths(
char * chroot_path_esc = NULL;
GlobusGFSName(globus_l_gfs_data_parse_restricted_paths);
GlobusGFSDebugEnter();
-
+
list = globus_list_from_string(restrict_paths, ',', NULL);
-
+
/* escape glob chars in chroot */
if(is_virtual && session_handle && session_handle->chroot_path &&
- strcspn(session_handle->chroot_path, "[*?") !=
+ strcspn(session_handle->chroot_path, "[*?") !=
strlen(session_handle->chroot_path))
{
char * ptr;
char * ptr_esc;
-
- chroot_path_esc =
+
+ chroot_path_esc =
(char *) malloc(2 * strlen(session_handle->chroot_path) + 1);
-
+
ptr = session_handle->chroot_path;
ptr_esc = chroot_path_esc;
while(*ptr)
@@ -3324,7 +3322,7 @@ globus_l_gfs_data_parse_restricted_paths(
case ']':
case '\\':
*ptr_esc++ = '\\';
-
+
default:
*ptr_esc++ = *ptr++;
break;
@@ -3344,13 +3342,13 @@ globus_l_gfs_data_parse_restricted_paths(
char * ptr;
char * alias;
globus_bool_t done;
-
+
ent = (globus_l_gfs_alias_ent_t *)
globus_malloc(sizeof(globus_l_gfs_alias_ent_t));
ent->access = 0;
-
- ent_str = (char *) globus_list_remove(&list, list);
-
+
+ ent_str = (char *) globus_list_remove(&list, list);
+
ptr = ent_str;
done = GLOBUS_FALSE;
while(*ptr && !done)
@@ -3362,7 +3360,7 @@ globus_l_gfs_data_parse_restricted_paths(
ent->access |= GFS_L_READ;
ptr++;
break;
-
+
case 'w':
case 'W':
ent->access |= GFS_L_WRITE;
@@ -3374,7 +3372,7 @@ globus_l_gfs_data_parse_restricted_paths(
ent->access |= GFS_L_NONE;
ptr++;
break;
-
+
case '/':
case '~':
case '$':
@@ -3387,7 +3385,7 @@ globus_l_gfs_data_parse_restricted_paths(
}
done = GLOBUS_TRUE;
break;
-
+
default:
done = GLOBUS_TRUE;
GlobusGFSErrorGenericStr(result,
@@ -3396,24 +3394,24 @@ globus_l_gfs_data_parse_restricted_paths(
"The entry '%s' is invalid.\n", ent_str));
return result;
break;
- }
+ }
}
ent->access |= GFS_L_LIST;
-
+
if(ent->access & GFS_L_NONE)
{
ent->access = GFS_L_NONE;
}
-
+
if((alias = strchr(ptr, ':')) != NULL)
{
*alias = '\0';
alias++;
-
+
ent->alias = globus_libc_strdup(alias);
globus_url_string_hex_decode(ent->alias);
ent->alias_len = strlen(ent->alias);
-
+
ent->realpath = globus_libc_strdup(ptr);
globus_url_string_hex_decode(ent->realpath);
ent->realpath_len = strlen(ent->realpath);
@@ -3423,7 +3421,7 @@ globus_l_gfs_data_parse_restricted_paths(
ent->alias = globus_libc_strdup(ptr);
globus_url_string_hex_decode(ent->alias);
ent->alias_len = strlen(ent->alias);
-
+
ent->realpath = NULL;
ent->realpath_len = 0;
}
@@ -3431,7 +3429,7 @@ globus_l_gfs_data_parse_restricted_paths(
if(strchr(GFS_RP_LEAD_CHARS, *ent->alias) == NULL ||
(ent->realpath && strchr(GFS_RP_LEAD_CHARS, *ent->alias) == NULL))
- {
+ {
globus_free(ent->alias);
if(ent->realpath)
{
@@ -3442,22 +3440,22 @@ globus_l_gfs_data_parse_restricted_paths(
else
{
if(is_virtual)
- {
+ {
char * tmp_path;
-
+
if(ent->realpath)
{
globus_free(ent->realpath);
ent->realpath = NULL;
ent->realpath_len = 0;
}
-
+
if(ent->alias[0] == '~')
{
tmp_path = globus_common_create_string(
- "%s%s",
- chroot_path_esc ?
- "/" : session_handle->home_dir,
+ "%s%s",
+ chroot_path_esc ?
+ "/" : session_handle->home_dir,
ent->alias + 1);
globus_free(ent->alias);
ent->alias = tmp_path;
@@ -3466,15 +3464,15 @@ globus_l_gfs_data_parse_restricted_paths(
else
{
if(chroot_path_esc)
- {
- tmp_path = globus_common_create_string("%s%s",
+ {
+ tmp_path = globus_common_create_string("%s%s",
chroot_path_esc, ent->alias);
globus_free(ent->alias);
ent->alias = tmp_path;
ent->alias_len = strlen(ent->alias);
}
}
-
+
if(ent->alias_len > 1 && ent->alias[ent->alias_len - 1] == '/')
{
ent->alias[ent->alias_len - 1] = '\0';
@@ -3485,12 +3483,12 @@ globus_l_gfs_data_parse_restricted_paths(
#ifdef WIN32
globus_l_gfs_alias_ent_t * new_ent;
char * tmp_ptr;
-
+
for(tmp_ptr = ent->alias; *tmp_ptr != '\0'; tmp_ptr++)
{
*tmp_ptr = tolower(*tmp_ptr);
}
-
+
if(ent->realpath)
{
for(tmp_ptr = ent->realpath; *tmp_ptr != '\0'; tmp_ptr++)
@@ -3500,7 +3498,7 @@ globus_l_gfs_data_parse_restricted_paths(
}
#endif
globus_list_insert(&tmp_list, ent);
-
+
#ifdef WIN32
/* now store driveletter:/path form of the ent */
if(ent->alias[0] == '/' && ent->alias[1] == '\0')
@@ -3508,7 +3506,7 @@ globus_l_gfs_data_parse_restricted_paths(
/* the root path needs to mean every drive letter */
DWORD drivemask;
char drive[] = "a";
-
+
drivemask = GetLogicalDrives();
while(drivemask && *drive <= 'z')
{
@@ -3520,7 +3518,7 @@ globus_l_gfs_data_parse_restricted_paths(
new_ent->alias_len = strlen("_:/");
new_ent->alias = strdup("_:/");
new_ent->alias[0] = *drive;
-
+
globus_list_insert(&tmp_list, new_ent);
}
(*drive)++;
@@ -3535,7 +3533,7 @@ globus_l_gfs_data_parse_restricted_paths(
new_ent->alias = globus_libc_strdup(ent->alias);
new_ent->realpath = globus_libc_strdup(ent->realpath);
ent = new_ent;
-
+
if(!ent->realpath && ent->alias[0] == '/' &&
isalpha(ent->alias[1]))
{
@@ -3549,7 +3547,7 @@ globus_l_gfs_data_parse_restricted_paths(
ent->alias_len = 3;
}
}
-
+
if(ent->realpath && ent->realpath[0] == '/' &&
isalpha(ent->realpath[1]))
{
@@ -3566,11 +3564,11 @@ globus_l_gfs_data_parse_restricted_paths(
globus_list_insert(&tmp_list, ent);
}
#endif
- }
+ }
}
}
-
+
if(!globus_list_empty(tmp_list))
{
*out_list = globus_list_sort_destructive(
@@ -3580,7 +3578,7 @@ globus_l_gfs_data_parse_restricted_paths(
{
result = GlobusGFSErrorGeneric("No valid paths added to restricted list.");
}
-
+
GlobusGFSDebugExit();
return result;
}
@@ -3631,7 +3629,7 @@ globus_l_gfs_data_read_share_file(
res = GlobusGFSErrorGeneric("Problem allocating memory.\n");
goto error_mem;
}
-
+
while(fgets(linebuf, linebuflen, fptr) != NULL)
{
p = linebuf;
@@ -3650,7 +3648,7 @@ globus_l_gfs_data_read_share_file(
goto error_mem;
}
strncat(linebuf, part_line, linebuflen);
-
+
optionbuf = globus_realloc(optionbuf, linebuflen);
if(!optionbuf)
{
@@ -3667,7 +3665,7 @@ globus_l_gfs_data_read_share_file(
}
line_num++;
p = linebuf;
- optlen = 0;
+ optlen = 0;
while(*p && isspace(*p))
{
p++;
@@ -3679,7 +3677,7 @@ globus_l_gfs_data_read_share_file(
if(*p == '#')
{
continue;
- }
+ }
if(*p == '"')
{
@@ -3689,14 +3687,14 @@ globus_l_gfs_data_read_share_file(
else
{
rc = sscanf(p, "%s", optionbuf);
- }
+ }
if(rc != 1)
- {
+ {
goto error_parse;
}
optlen += strlen(optionbuf);
p = p + optlen;
-
+
optlen = 0;
while(*p && isspace(*p))
{
@@ -3710,13 +3708,13 @@ globus_l_gfs_data_read_share_file(
else
{
rc = sscanf(p, "%s", valuebuf);
- }
+ }
if(rc != 1)
- {
+ {
goto error_parse;
- }
+ }
optlen += strlen(valuebuf);
- p = p + optlen;
+ p = p + optlen;
while(*p && isspace(*p))
{
p++;
@@ -3725,7 +3723,7 @@ globus_l_gfs_data_read_share_file(
{
goto error_parse;
}
-
+
if(!strcmp(optionbuf, "share_path"))
{
*share_path = strdup(valuebuf);
@@ -3734,11 +3732,11 @@ globus_l_gfs_data_read_share_file(
}
fclose(fptr);
-
+
globus_free(linebuf);
globus_free(valuebuf);
globus_free(optionbuf);
-
+
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
@@ -3769,7 +3767,7 @@ globus_l_gfs_data_check_sharing_perms(
owned by user; must have no group and world perms */
if(statbuf.st_uid == session_handle->uid)
{
- if((statbuf.st_mode &
+ if((statbuf.st_mode &
(S_IRGRP | S_IXGRP | S_IWGRP | S_IROTH | S_IWOTH | S_IXOTH)) == 0)
{
rc = 0;
@@ -3783,7 +3781,7 @@ globus_l_gfs_data_check_sharing_perms(
dir);
}
}
-
+
/* case 2: community state directory
world or group writable
not world or group readable
@@ -3791,7 +3789,7 @@ globus_l_gfs_data_check_sharing_perms(
#ifndef WIN32
else if((statbuf.st_mode & (S_IWGRP | S_IWOTH)) != 0)
{
- if(statbuf.st_uid == 0 && ((statbuf.st_mode & S_ISVTX) != 0) &&
+ if(statbuf.st_uid == 0 && ((statbuf.st_mode & S_ISVTX) != 0) &&
((statbuf.st_mode & (S_IRGRP | S_IROTH)) == 0))
{
rc = 0;
@@ -3825,7 +3823,7 @@ globus_l_gfs_data_check_sharing_perms(
"accessed.\n",
dir);
}
-
+
return rc;
}
@@ -3861,7 +3859,7 @@ globus_l_gfs_data_check_sharing_allowed(
* if the deny list includes the user, he is immediately denied.
* if the allow list includes the user, he is immediately allowed.
* if the allow list is unset, he is allowed pending the group check.
- * if the allow list is set and does not include the user, he is denied
+ * if the allow list is set and does not include the user, he is denied
pending the group check.
*/
if(user_allow == NULL)
@@ -3873,7 +3871,7 @@ globus_l_gfs_data_check_sharing_allowed(
{
allowed = GLOBUS_FALSE;
explicitly = GLOBUS_FALSE;
-
+
user = user_allow;
while((ptr = strchr(user, ',')) != NULL && !allowed)
{
@@ -3917,13 +3915,13 @@ globus_l_gfs_data_check_sharing_allowed(
}
}
globus_free(user_deny);
- }
+ }
if(explicitly)
{
goto finish;
}
-
+
group_deny = globus_libc_strdup(
globus_gfs_config_get_string("sharing_groups_deny"));
@@ -3942,7 +3940,7 @@ globus_l_gfs_data_check_sharing_allowed(
while((ptr = strchr(group, ',')) != NULL && !allowed)
{
*ptr = '\0';
-
+
grent = getgrnam(group);
if(grent)
{
@@ -4021,7 +4019,7 @@ globus_l_gfs_data_check_sharing_allowed(
}
}
}
- }
+ }
if(group_deny)
{
globus_free(group_deny);
@@ -4078,18 +4076,18 @@ globus_l_gfs_data_authorize(
auth_level = globus_i_gfs_config_int("auth_level");
pw_file = (char *) globus_i_gfs_config_string("pw_file");
process_username = globus_i_gfs_config_string("process_user");
- /* if there is a subject or del cred we are using gsi,
+ /* if there is a subject or del cred we are using gsi,
look it up in the gridmap */
sharing_dn = globus_i_gfs_config_string("sharing_dn");
op->session_handle->sharing = (sharing_dn != NULL);
-
+
if(session_info->subject != NULL || session_info->del_cred != NULL)
{
if(sharing_dn && !strcmp(sharing_dn, session_info->subject))
{
- if(session_info->username &&
- strncmp(session_info->username,
- GLOBUS_SHARING_PREFIX,
+ if(session_info->username &&
+ strncmp(session_info->username,
+ GLOBUS_SHARING_PREFIX,
strlen(GLOBUS_SHARING_PREFIX)) == 0)
{
char * usr_tmp;
@@ -4099,13 +4097,13 @@ globus_l_gfs_data_authorize(
globus_size_t cert_len = 0;
char * tmp;
globus_gsi_cred_handle_t tmp_cred_handle;
-
- shared_user_str =
+
+ shared_user_str =
session_info->username + strlen(GLOBUS_SHARING_PREFIX);
ptr = shared_user_str;
-
+
if((usr_tmp = globus_i_gfs_kv_getval(ptr, "USER", 1)) != NULL)
- {
+ {
session_info->map_user = GLOBUS_FALSE;
}
else
@@ -4114,7 +4112,7 @@ globus_l_gfs_data_authorize(
session_info->map_user = GLOBUS_TRUE;
}
- if((op->session_handle->sharing_id =
+ if((op->session_handle->sharing_id =
globus_i_gfs_kv_getval(ptr, "ID", 1)) == NULL)
{
res = GlobusGFSErrorGeneric(
@@ -4135,7 +4133,7 @@ globus_l_gfs_data_authorize(
}
if((crt_tmp = globus_i_gfs_kv_getval(ptr, "CERT", 0)) != NULL)
- {
+ {
desired_user_cert = malloc(strlen(crt_tmp + 1));
res = globus_l_gfs_base64_decode(
(globus_byte_t *) crt_tmp,
@@ -4158,7 +4156,7 @@ globus_l_gfs_data_authorize(
{
goto pwent_error;
}
-
+
globus_gfs_log_message(
GLOBUS_GFS_LOG_INFO,
"DN %s has provided sharing credentials for DN %s.\n",
@@ -4182,31 +4180,31 @@ globus_l_gfs_data_authorize(
"Invalid arguments for " GLOBUS_SHARING_PREFIX ". Missing SHAREE.");
goto pwent_error;
}
-
+
globus_free(session_info->username);
session_info->username = usr_tmp;
sharing_attempted = GLOBUS_TRUE;
- }
+ }
}
- if(!sharing_attempted && session_info->username &&
- strncmp(session_info->username,
- GLOBUS_SHARING_PREFIX,
+ if(!sharing_attempted && session_info->username &&
+ strncmp(session_info->username,
+ GLOBUS_SHARING_PREFIX,
strlen(GLOBUS_SHARING_PREFIX)) == 0)
{
GlobusGFSErrorGenericStr(res,
("Sharing not allowed with DN %s", session_info->subject));
goto pwent_error;
}
-
+
if(!(auth_level & GLOBUS_L_GFS_AUTH_NOGRIDMAP))
{
- if(globus_i_gfs_config_bool("cas") &&
+ if(globus_i_gfs_config_bool("cas") &&
(context || sharing_attempted))
{
globus_bool_t free_usr = GLOBUS_FALSE;
-
+
if(session_info->map_user)
{
usr = NULL;
@@ -4217,7 +4215,7 @@ globus_l_gfs_data_authorize(
}
*authz_usr = '\0';
-
+
if(sharing_attempted)
{
res = globus_gss_assist_map_and_authorize_sharing(
@@ -4226,7 +4224,7 @@ globus_l_gfs_data_authorize(
usr,
authz_usr,
USER_NAME_MAX);
-
+
globus_free(desired_user_cert);
desired_user_cert = NULL;
}
@@ -4515,7 +4513,7 @@ globus_l_gfs_data_authorize(
res = GlobusGFSErrorGeneric("Access denied by configuration.");
goto pwent_error;
}
-
+
/* check that account is not disabled */
if(pwent && !globus_i_gfs_config_bool("allow_disabled_login"))
{
@@ -4526,7 +4524,7 @@ globus_l_gfs_data_authorize(
errmsg = globus_error_print_friendly(globus_error_peek(res));
globus_gfs_log_message(
GLOBUS_GFS_LOG_ERR,
- "Access denied for user '%s': %s\n",
+ "Access denied for user '%s': %s\n",
session_info->username, errmsg);
globus_free(errmsg);
res = GlobusGFSErrorGeneric(
@@ -4566,7 +4564,7 @@ globus_l_gfs_data_authorize(
goto uid_error;
}
}
-
+
if(pwent->pw_uid == 0 && !globus_i_gfs_config_bool("allow_root"))
{
@@ -4626,23 +4624,23 @@ globus_l_gfs_data_authorize(
var_dir = globus_l_gfs_data_update_var_path(
op->session_handle, custom_home_dir);
-
+
op->session_handle->home_dir = var_dir;
}
else
{
- op->session_handle->home_dir =
+ op->session_handle->home_dir =
globus_libc_strdup(op->session_handle->true_home);
}
-
+
if(sharing_dn)
{
char * sharing_state;
-
+
sharing_state = globus_i_gfs_config_string("sharing_state_dir");
- op->session_handle->sharing_state_dir =
+ op->session_handle->sharing_state_dir =
globus_l_gfs_data_update_var_path(
- op->session_handle,
+ op->session_handle,
sharing_state ? sharing_state : "$HOME/.globus/sharing");
if(!op->session_handle->sharing_state_dir)
@@ -4650,7 +4648,7 @@ globus_l_gfs_data_authorize(
res = GlobusGFSErrorMemory("sharing state dir");
goto pwent_error;
}
-
+
if(sharing_attempted)
{
char * share_path = NULL;
@@ -4665,7 +4663,7 @@ globus_l_gfs_data_authorize(
session_info->username));
goto pwent_error;
}
-
+
share_file = globus_common_create_string(
"%s/share-%s",
op->session_handle->sharing_state_dir,
@@ -4745,16 +4743,16 @@ globus_l_gfs_data_authorize(
}
globus_free(share_file);
share_file = NULL;
-
+
globus_gfs_log_message(
GLOBUS_GFS_LOG_INFO,
"Access allowed for sharing of user '%s' from share id '%s'. "
"Sharee '%s' is restricted to '%s'.\n",
- session_info->username,
- op->session_handle->sharing_id,
- op->session_handle->sharing_sharee,
+ session_info->username,
+ op->session_handle->sharing_id,
+ op->session_handle->sharing_sharee,
op->session_handle->chroot_path);
-
+
if(op->session_handle->chroot_path[1] == '\0')
{
globus_free(op->session_handle->chroot_path);
@@ -4772,13 +4770,13 @@ globus_l_gfs_data_authorize(
{
tmp_restrict = globus_common_create_string(
"RW/,N%s,N~/.*", op->session_handle->sharing_state_dir);
- }
+ }
#ifdef WIN32
if(strstr(tmp_restrict, ":/"))
{
char * tp;
tp = strstr(tmp_restrict, ":/");
- tp--;
+ tp--;
tp[1] = tp[0];
tp[0] = '/';
}
@@ -4788,18 +4786,18 @@ globus_l_gfs_data_authorize(
while(!globus_list_empty(tmp_list))
{
globus_list_insert(
- &globus_l_gfs_path_alias_list_sharing,
+ &globus_l_gfs_path_alias_list_sharing,
globus_list_remove(&tmp_list, tmp_list));
}
globus_free(tmp_restrict);
-
+
if(res != GLOBUS_SUCCESS)
{
goto pwent_error;
}
}
}
-
+
globus_l_gfs_data_update_restricted_paths(
op->session_handle, &globus_l_gfs_path_alias_list_base);
globus_l_gfs_data_update_restricted_paths(
@@ -4821,8 +4819,8 @@ globus_l_gfs_data_authorize(
{
op->session_handle->active_rp_list = &globus_l_gfs_path_alias_list_base;
}
-
- if(!globus_i_gfs_config_bool("use_home_dirs") ||
+
+ if(!globus_i_gfs_config_bool("use_home_dirs") ||
op->session_handle->home_dir == NULL)
{
if(op->session_handle->home_dir)
@@ -4830,22 +4828,22 @@ globus_l_gfs_data_authorize(
globus_free(op->session_handle->home_dir);
}
op->session_handle->home_dir = strdup("/");
- }
+ }
if(op->session_handle->real_username == NULL)
{
- if(pwent)
+ if(pwent)
{
- op->session_handle->real_username =
+ op->session_handle->real_username =
globus_libc_strdup(pwent->pw_name);
}
else
{
- op->session_handle->real_username =
+ op->session_handle->real_username =
globus_libc_strdup(op->session_handle->username);
}
}
-
+
globus_gfs_log_event(
GLOBUS_GFS_LOG_INFO,
GLOBUS_GFS_LOG_EVENT_END,
@@ -4992,7 +4990,7 @@ globus_l_gfs_load_safe(
GLOBUS_GFS_LOG_ERR,
"Some network stack drivers failed to load: %s\n",
msg = globus_error_print_friendly(globus_error_peek(result)));
-
+
if(msg)
{
globus_free(msg);
@@ -5071,7 +5069,7 @@ globus_i_gfs_data_dsi_checksum_support(
}
-char *
+char *
globus_i_gfs_data_dsi_version()
{
int rc;
@@ -5080,15 +5078,15 @@ globus_i_gfs_data_dsi_version()
GlobusGFSName(globus_i_gfs_data_init);
GlobusGFSDebugEnter();
-
+
rc = globus_extension_get_module_version(
globus_l_gfs_active_dsi_handle, &version);
if(rc == GLOBUS_SUCCESS)
{
str = globus_common_create_string(
- "%s-%d.%d",
- globus_l_gfs_active_dsi_name,
- version.major,
+ "%s-%d.%d",
+ globus_l_gfs_active_dsi_name,
+ version.major,
version.minor);
}
@@ -5107,19 +5105,19 @@ globus_i_gfs_data_init()
globus_extension_register_builtins(local_extensions);
- globus_l_gfs_active_dsi_name =
+ globus_l_gfs_active_dsi_name =
globus_i_gfs_config_string("load_dsi_module");
result = globus_i_gfs_data_new_dsi(
- &globus_l_gfs_active_dsi_handle,
+ &globus_l_gfs_active_dsi_handle,
globus_l_gfs_active_dsi_name,
- &globus_l_gfs_dsi,
+ &globus_l_gfs_dsi,
GLOBUS_FALSE);
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_exit_message(
- "Couldn't load '%s'. %s\n", globus_l_gfs_active_dsi_name,
+ "Couldn't load '%s'. %s\n", globus_l_gfs_active_dsi_name,
globus_error_print_friendly(globus_error_peek(result)));
exit(1);
}
@@ -5158,7 +5156,7 @@ globus_i_gfs_data_init()
{
result = globus_l_gfs_data_parse_restricted_paths(
NULL, restrict_path, &globus_l_gfs_path_alias_list_sharing, 0);
-
+
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_exit_result("Error parsing sharing restricted paths", result);
@@ -5171,7 +5169,7 @@ globus_i_gfs_data_init()
{
result = globus_l_gfs_data_parse_restricted_paths(
NULL, restrict_path, &globus_l_gfs_path_alias_list_sharing, 0);
-
+
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_exit_result("Error parsing restricted paths", result);
@@ -5184,14 +5182,14 @@ globus_i_gfs_data_init()
{
result = globus_l_gfs_data_parse_restricted_paths(
NULL, restrict_path, &globus_l_gfs_path_alias_list_base, 0);
-
+
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_exit_result("Error parsing restricted paths", result);
exit(1);
}
}
-
+
if(globus_i_gfs_config_bool("inetd"))
{
globus_l_gfs_watchdog_limit = globus_i_gfs_config_int("control_idle_timeout");
@@ -5200,30 +5198,30 @@ globus_i_gfs_data_init()
globus_l_gfs_watchdog_limit = 300;
}
}
-
+
if(globus_i_gfs_config_bool("allow_udt"))
{
result = globus_xio_driver_load("udt", &globus_l_gfs_udt_driver_preload);
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_result(
- GLOBUS_GFS_LOG_INFO,
+ GLOBUS_GFS_LOG_INFO,
"Unable to load UDT driver", result);
globus_gfs_config_set_bool("allow_udt", GLOBUS_FALSE);
}
}
-
+
if((globus_i_gfs_config_string("netmgr")) != NULL)
{
result = globus_xio_driver_load("net_manager", &globus_l_gfs_netmgr_driver);
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_result(
- GLOBUS_GFS_LOG_INFO,
+ GLOBUS_GFS_LOG_INFO,
"Unable to load Network Manager driver", result);
}
- }
-
+ }
+
GlobusGFSDebugExit();
}
@@ -5454,7 +5452,7 @@ globus_l_gfs_data_stat_kickout(
{
reply.code = 100;
}
-
+
reply.type = GLOBUS_GFS_OP_STAT;
reply.id = bounce_info->op->id;
reply.result = bounce_info->error ?
@@ -5466,7 +5464,7 @@ globus_l_gfs_data_stat_kickout(
reply.info.stat.gid_array = (int *)bounce_info->op->session_handle->gid_array;
/* pull response code from error */
- if(bounce_info->final_stat && reply.result != GLOBUS_SUCCESS &&
+ if(bounce_info->final_stat && reply.result != GLOBUS_SUCCESS &&
(code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(reply.result))) != 0)
{
@@ -5499,13 +5497,13 @@ globus_l_gfs_data_stat_kickout(
bounce_info->op->session_handle, bounce_info->op->data_handle);
}
globus_mutex_unlock(&bounce_info->op->session_handle->mutex);
-
+
globus_assert(destroy_op);
globus_l_gfs_data_fire_cb(
bounce_info->op, remote_data_arg, destroy_session);
globus_l_gfs_data_operation_destroy(bounce_info->op);
}
-
+
if(bounce_info->stat_array)
{
for(i = 0; i < bounce_info->stat_count; i++)
@@ -5563,7 +5561,7 @@ globus_l_gfs_data_approve_popen(
result = GlobusGFSErrorGeneric("small malloc failure.");
goto error;
}
-
+
end = cmd;
while(end && (ptr = strstr(end, "popen:")))
{
@@ -5574,23 +5572,23 @@ globus_l_gfs_data_approve_popen(
result = GlobusGFSErrorGeneric("popen argv not supplied.");
goto error;
}
-
+
ptr += 5;
-
+
delim = *ptr;
- *ptr = '\0';
+ *ptr = '\0';
ptr++;
-
+
endchars[0] = delim;
end = strpbrk(ptr, endchars);
-
+
if(end != NULL)
{
end_delim = *end;
*end = '\0';
end++;
}
-
+
for(found = GLOBUS_FALSE,
list = (globus_list_t *) globus_i_gfs_config_get("popen_list");
!globus_list_empty(list) && !found;
@@ -5608,14 +5606,14 @@ globus_l_gfs_data_approve_popen(
{
size = strlen(alias);
prog = alias;
-
+
}
if((strncmp(alias, ptr, size) == 0 && strlen(ptr) == size) ||
strcmp(prog, ptr) == 0)
{
found = GLOBUS_TRUE;
}
- }
+ }
if(found)
{
if(access(prog, R_OK | X_OK) < 0)
@@ -5639,7 +5637,7 @@ globus_l_gfs_data_approve_popen(
}
else
{
- tmp = globus_common_create_string("%s%s%c%s",
+ tmp = globus_common_create_string("%s%s%c%s",
out ? out : "", start, delim, prog);
if(out)
{
@@ -5668,9 +5666,9 @@ globus_l_gfs_data_approve_popen(
globus_free(cmd);
}
-
+
*out_cmd = out;
-
+
GlobusGFSDebugExit();
return result;
@@ -5702,7 +5700,7 @@ globus_l_gfs_data_load_stack(
globus_result_t result = GLOBUS_SUCCESS;
GlobusGFSName(globus_l_gfs_data_load_stack);
GlobusGFSDebugEnter();
-
+
if(*driver_list_out)
{
globus_xio_driver_list_destroy(*driver_list_out, GLOBUS_FALSE);
@@ -5710,14 +5708,14 @@ globus_l_gfs_data_load_stack(
}
if(strcasecmp(driver_string_in, "default") == 0)
- {
+ {
driver_string = default_stack;
}
else
{
driver_string = driver_string_in;
}
-
+
if(driver_string)
{
result = globus_l_gfs_data_approve_popen(
@@ -5733,9 +5731,9 @@ globus_l_gfs_data_load_stack(
parsed_driver_string,
driver_list_out,
allowed_drivers);
-
+
globus_free(parsed_driver_string);
-
+
if(subst_io_drivers)
{
globus_xio_driver_list_ent_t * ent;
@@ -5764,7 +5762,7 @@ globus_l_gfs_data_load_stack(
}
}
}
-
+
GlobusGFSDebugExit();
return result;
}
@@ -5867,14 +5865,14 @@ globus_i_gfs_data_request_command(
else if(strcasecmp(cmd_info->cksm_alg, "P") == 0)
{
globus_size_t dcsc_len;
- OM_uint32 major_status;
+ OM_uint32 major_status;
OM_uint32 minor_status;
- gss_buffer_desc buf;
+ gss_buffer_desc buf;
gss_cred_id_t cred;
-
+
dcsc_len = strlen(cmd_info->pathname);
buf.value = calloc(1, dcsc_len);
-
+
rc = globus_l_gfs_base64_decode(
(globus_byte_t *) cmd_info->pathname, buf.value, &dcsc_len);
if(rc != GLOBUS_SUCCESS)
@@ -5884,7 +5882,7 @@ globus_i_gfs_data_request_command(
"Invalid base64 input for credential type P.");
}
else
- {
+ {
buf.length = strlen(buf.value);
major_status = gss_import_cred(
&minor_status,
@@ -5908,7 +5906,7 @@ globus_i_gfs_data_request_command(
gss_release_cred(
&min_rc, &op->session_handle->dcsc_cred);
}
-
+
op->session_handle->dcsc_cred = cred;
}
}
@@ -5926,7 +5924,7 @@ globus_i_gfs_data_request_command(
globus_byte_t * tmp_val;
globus_byte_t * ca_pem = NULL;
globus_size_t ca_pem_len = 0;
-
+
op->session_handle->http_config_called = GLOBUS_TRUE;
if((tmp_val = (globus_byte_t *)
globus_i_gfs_kv_getval(
@@ -5943,8 +5941,8 @@ globus_i_gfs_data_request_command(
"Invalid base64 input for CA_CERTS.");
}
else
- {
- result = GLOBUS_SUCCESS;
+ {
+ result = GLOBUS_SUCCESS;
if(op->session_handle->http_ca_certs)
{
globus_free(op->session_handle->http_ca_certs);
@@ -5952,20 +5950,20 @@ globus_i_gfs_data_request_command(
op->session_handle->http_ca_certs = (char *) ca_pem;
}
}
-
+
call = GLOBUS_FALSE;
globus_gridftp_server_finished_command(op, result, NULL);
break;
}
-
+
case GLOBUS_GFS_CMD_HTTP_PUT:
- {
+ {
char * request;
char * path;
globus_off_t offset;
- globus_off_t length;
-
+ globus_off_t length;
+
result = globus_i_gfs_data_http_parse_args(
cmd_info->pathname, &path, &request, &offset, &length);
if(result == GLOBUS_SUCCESS)
@@ -5982,12 +5980,12 @@ globus_i_gfs_data_request_command(
break;
case GLOBUS_GFS_CMD_HTTP_GET:
- {
+ {
char * request;
char * path;
globus_off_t offset;
- globus_off_t length;
-
+ globus_off_t length;
+
result = globus_i_gfs_data_http_parse_args(
cmd_info->pathname, &path, &request, &offset, &length);
if(result == GLOBUS_SUCCESS)
@@ -6030,7 +6028,7 @@ globus_i_gfs_data_request_command(
break;
case GLOBUS_GFS_CMD_SITE_SETDISKSTACK:
- if(session_handle->dsi->descriptor &
+ if(session_handle->dsi->descriptor &
GLOBUS_GFS_DSI_DESCRIPTOR_SENDER)
{
result = globus_l_gfs_data_load_stack(
@@ -6068,14 +6066,14 @@ globus_i_gfs_data_request_command(
result = GlobusGFSErrorGeneric(
"Sharing control is not allowed.");
}
-
+
else if(!strncasecmp(cmd_info->pathname, "CREATE", 6))
{
char * share_args;
char * share_path = NULL;
char * share_id = NULL;
char * share_file = NULL;
-
+
share_args = strchr(cmd_info->pathname, ' ');
if(!share_args)
{
@@ -6083,7 +6081,7 @@ globus_i_gfs_data_request_command(
goto share_create_error;
}
share_args++;
- if((share_id =
+ if((share_id =
globus_i_gfs_kv_getval(share_args, "ID", 1)) == NULL)
{
result = GlobusGFSErrorGeneric(
@@ -6102,7 +6100,7 @@ globus_i_gfs_data_request_command(
}
tmp++;
}
- if((share_path =
+ if((share_path =
globus_i_gfs_kv_getval(share_args, "PATH", 1)) == NULL)
{
result = GlobusGFSErrorGeneric(
@@ -6117,12 +6115,12 @@ globus_i_gfs_data_request_command(
"Sharing is not allowed for the current user.");
goto share_create_error;
}
-
+
share_file = globus_common_create_string(
"%s/share-%s",
op->session_handle->sharing_state_dir,
share_id);
-
+
/* check if path will be accessible */
if(result == GLOBUS_SUCCESS)
{
@@ -6162,14 +6160,14 @@ globus_i_gfs_data_request_command(
if(access(share_file, F_OK) < 0)
{
int sharingfd;
-
+
/* create state dir if default and doesn't exist */
- if(strstr(op->session_handle->sharing_state_dir, "/.globus/sharing") &&
+ if(strstr(op->session_handle->sharing_state_dir, "/.globus/sharing") &&
access(op->session_handle->sharing_state_dir, F_OK) < 0)
{
char * tmp_dir;
char * ptr;
-
+
tmp_dir = strdup(op->session_handle->sharing_state_dir);
ptr = strrchr(tmp_dir, '/');
if(ptr)
@@ -6181,15 +6179,15 @@ globus_i_gfs_data_request_command(
mkdir(tmp_dir, 0700);
free(tmp_dir);
}
-
+
if(globus_l_gfs_data_check_sharing_perms(op->session_handle) != 0)
{
result = GlobusGFSErrorGeneric(
"Sharing state dir has invalid permissions.");
goto share_create_error;
- }
+ }
- sharingfd =
+ sharingfd =
open(share_file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
if(sharingfd < 0)
{
@@ -6201,7 +6199,7 @@ globus_i_gfs_data_request_command(
char * tmp_content;
char * tmp_enc;
int save_rc = 0;
-#ifdef WIN32
+#ifdef WIN32
if(isalpha(share_path[0]) && share_path[1] == ':')
{
share_path[1] = share_path[0];
@@ -6213,8 +6211,8 @@ globus_i_gfs_data_request_command(
}
#endif
tmp_enc = globus_url_string_hex_encode(share_path, "\"");
-
- tmp_content = globus_common_create_string(
+
+ tmp_content = globus_common_create_string(
"#\n# This file is required in order to enable GridFTP file sharing.\n"
"# If you remove this file, file sharing will no longer work.\n#\n\n"
"share_path \"%s\"\n", tmp_enc);
@@ -6233,14 +6231,14 @@ globus_i_gfs_data_request_command(
"Enabling sharing (close)", errno);
save_rc = rc;
}
-
+
rc = chmod(share_file, S_IRUSR);
if(rc < 0 && !save_rc)
{
result = GlobusGFSErrorSystemError(
"Enabling sharing (chmod)", errno);
}
-
+
globus_free(tmp_enc);
globus_free(tmp_content);
}
@@ -6270,7 +6268,7 @@ globus_i_gfs_data_request_command(
{
char * share_file = NULL;
char * share_id = NULL;
-
+
share_id = strchr(cmd_info->pathname, ' ');
if(!share_id)
{
@@ -6290,7 +6288,7 @@ globus_i_gfs_data_request_command(
}
tmp++;
}
-
+
share_file = globus_common_create_string(
"%s/share-%s",
op->session_handle->sharing_state_dir,
@@ -6340,9 +6338,9 @@ globus_i_gfs_data_request_command(
result = GlobusGFSErrorGeneric("Missing path argument.");
goto share_test_error;
}
-
+
share_path++;
-
+
/** check if sharing can be enabled **/
/* creation disabled */
if(!globus_i_gfs_config_bool("sharing_control"))
@@ -6350,7 +6348,7 @@ globus_i_gfs_data_request_command(
result = GlobusGFSErrorGeneric(
"Sharing control is not enabled.");
}
-
+
/* check allow/deny config */
else if(!globus_l_gfs_data_check_sharing_allowed(op->session_handle))
{
@@ -6362,12 +6360,12 @@ globus_i_gfs_data_request_command(
else
{
/* create state dir if default and doesn't exist */
- if(strstr(op->session_handle->sharing_state_dir, "/.globus/sharing") &&
+ if(strstr(op->session_handle->sharing_state_dir, "/.globus/sharing") &&
access(op->session_handle->sharing_state_dir, F_OK) < 0)
{
char * tmp_dir;
char * ptr;
-
+
tmp_dir = strdup(op->session_handle->sharing_state_dir);
ptr = strrchr(tmp_dir, '/');
if(ptr)
@@ -6379,14 +6377,14 @@ globus_i_gfs_data_request_command(
mkdir(tmp_dir, 0700);
free(tmp_dir);
}
-
+
if(globus_l_gfs_data_check_sharing_perms(op->session_handle) != 0)
{
result = GlobusGFSErrorGeneric(
"Sharing state dir has invalid permissions.");
goto share_test_error;
- }
-
+ }
+
if(access(op->session_handle->sharing_state_dir, W_OK) == 0)
{
result = GLOBUS_SUCCESS;
@@ -6427,9 +6425,9 @@ globus_i_gfs_data_request_command(
}
globus_gridftp_server_finished_command(op, result, NULL);
call = GLOBUS_FALSE;
-
+
break;
-
+
case GLOBUS_GFS_CMD_SITE_RESTRICT:
if(!globus_list_empty(session_handle->rp_list))
{
@@ -6441,10 +6439,10 @@ globus_i_gfs_data_request_command(
result = globus_l_gfs_data_parse_restricted_paths(
session_handle, cmd_info->pathname, &session_handle->rp_list, 1);
}
-
+
globus_l_gfs_data_update_restricted_paths_symlinks(
session_handle, &session_handle->rp_list);
-
+
globus_gridftp_server_finished_command(op, result, NULL);
@@ -6463,11 +6461,11 @@ globus_i_gfs_data_request_command(
}
else
{
- session_handle->chroot_path =
+ session_handle->chroot_path =
globus_libc_strdup(cmd_info->pathname);
result = GLOBUS_SUCCESS;
}
-
+
globus_gridftp_server_finished_command(op, result, NULL);
call = GLOBUS_FALSE;
@@ -6479,7 +6477,7 @@ globus_i_gfs_data_request_command(
{
result = GlobusGFSErrorGeneric(
"Controller parameter must be 0 or 1.");
-
+
globus_gridftp_server_finished_command(op, result, NULL);
}
@@ -6489,13 +6487,13 @@ globus_i_gfs_data_request_command(
char * stunserver;
globus_xio_driver_list_ent_t * ent;
globus_xio_attr_t xio_attr;
-
+
if(session_handle->net_stack_list == NULL)
{
result = globus_l_gfs_data_load_stack(
op->session_handle->subject ? "udt,gsi" : "udt",
&op->session_handle->net_stack_list,
- globus_i_gfs_config_bool("allow_udt") ?
+ globus_i_gfs_config_bool("allow_udt") ?
NULL : &gfs_l_data_net_allowed_drivers,
NULL,
GLOBUS_TRUE);
@@ -6505,10 +6503,10 @@ globus_i_gfs_data_request_command(
"Setting data channel driver stack", result);
}
}
-
+
ent = globus_xio_driver_list_find_driver(
session_handle->net_stack_list, "udt");
-
+
if(ent)
{
if(session_handle->udt_data_channel_inuse)
@@ -6517,7 +6515,7 @@ globus_i_gfs_data_request_command(
&session_handle->udt_data_channel);
session_handle->udt_data_channel_inuse = GLOBUS_FALSE;
}
-
+
result = globus_ftp_control_handle_init(
&session_handle->udt_data_channel);
if(result != GLOBUS_SUCCESS)
@@ -6527,7 +6525,7 @@ globus_i_gfs_data_request_command(
goto error_upas;
}
session_handle->udt_data_channel_inuse = GLOBUS_TRUE;
-
+
result = globus_i_ftp_control_data_get_attr(
&session_handle->udt_data_channel,
&xio_attr);
@@ -6557,7 +6555,7 @@ globus_i_gfs_data_request_command(
error_upas:
globus_gridftp_server_finished_command(op, result, candidates);
}
-
+
call = GLOBUS_FALSE;
break;
@@ -6565,7 +6563,7 @@ globus_i_gfs_data_request_command(
{
globus_xio_driver_list_ent_t * ent;
globus_xio_attr_t xio_attr;
-
+
ent = globus_xio_driver_list_find_driver(
session_handle->net_stack_list, "udt");
if(ent)
@@ -6577,25 +6575,25 @@ globus_i_gfs_data_request_command(
{
goto error_uprt;
}
-
+
result = globus_xio_attr_cntl(
xio_attr,
ent->driver,
18 /* GLOBUS_XIO_UDT_SET_REMOTE_CANDIDATES */,
cmd_info->pathname);
-
+
session_handle->upas = GLOBUS_TRUE;
}
else
{
result = GlobusGFSErrorWrapFailed(
"Setting data channel driver stack", result);
- }
+ }
error_uprt:
globus_gridftp_server_finished_command(op, result, NULL);
}
-
+
call = GLOBUS_FALSE;
break;
@@ -6682,7 +6680,7 @@ globus_i_gfs_data_request_command(
call = GLOBUS_FALSE;
globus_gridftp_server_finished_command(op, result, NULL);
break;
-
+
case GLOBUS_GFS_CMD_SITE_TASKID:
if(op->session_handle->taskid)
{
@@ -6699,7 +6697,7 @@ globus_i_gfs_data_request_command(
{
globus_free(op->session_handle->storattr_str);
}
- op->session_handle->storattr_str =
+ op->session_handle->storattr_str =
globus_libc_strdup(cmd_info->pathname);
call = GLOBUS_FALSE;
@@ -6749,15 +6747,15 @@ globus_i_gfs_data_request_command(
case GLOBUS_GFS_CMD_SITE_CHGRP:
action = GFS_ACL_ACTION_WRITE;
break;
-
+
case GLOBUS_GFS_CMD_SITE_UTIME:
action = GFS_ACL_ACTION_WRITE;
break;
-
+
case GLOBUS_GFS_CMD_SITE_SYMLINK:
action = GFS_ACL_ACTION_CREATE;
break;
-
+
case GLOBUS_GFS_CMD_SITE_AUTHZ_ASSERT:
/*
* A new action to provide authorization assertions received
@@ -6783,7 +6781,7 @@ globus_i_gfs_data_request_command(
default:
if(cmd_info->command >= GLOBUS_GFS_MIN_CUSTOM_CMD)
{
- if(cmd_info->op_info && cmd_info->op_info->cmd_ent &&
+ if(cmd_info->op_info && cmd_info->op_info->cmd_ent &&
cmd_info->op_info->cmd_ent->access_type)
{
action = cmd_info->op_info->cmd_ent->access_type;
@@ -6890,12 +6888,12 @@ globus_l_gfs_data_handle_init(
if(session_handle->udt_data_channel_inuse)
{
- memcpy(&handle->data_channel, &session_handle->udt_data_channel,
+ memcpy(&handle->data_channel, &session_handle->udt_data_channel,
sizeof(globus_ftp_control_handle_t));
session_handle->udt_data_channel_inuse = GLOBUS_FALSE;
}
else
- {
+ {
result = globus_ftp_control_handle_init(&handle->data_channel);
if(result != GLOBUS_SUCCESS)
{
@@ -6964,7 +6962,7 @@ globus_l_gfs_data_handle_init(
{
handle->info.nstreams = 1;
}
-
+
if(handle->info.mode == 'S')
{
handle->info.nstreams = 1;
@@ -7032,7 +7030,7 @@ globus_l_gfs_data_handle_init(
dcau.mode = handle->info.dcau;
dcau.subject.mode = handle->info.dcau;
dcau.subject.subject = handle->info.subject;
-
+
if(session_handle->dcsc_cred != GSS_C_NO_CREDENTIAL)
{
globus_xio_attr_t xio_attr;
@@ -7068,7 +7066,7 @@ globus_l_gfs_data_handle_init(
{
cred = handle->info.del_cred;
}
-
+
result = globus_ftp_control_local_dcau(
&handle->data_channel, &dcau, cred);
if(result != GLOBUS_SUCCESS)
@@ -7099,13 +7097,13 @@ globus_l_gfs_data_handle_init(
goto error_control;
}
}
-
+
/* create a default stack that we can add the netmgr driver to */
if(globus_l_gfs_netmgr_driver && globus_list_empty(net_stack_list))
{
globus_xio_driver_list_ent_t * ent;
globus_list_t ** tailp = &net_stack_list;
-
+
ent = malloc(sizeof(globus_xio_driver_list_ent_t));
ent->driver = globus_io_compat_get_tcp_driver();
ent->driver_name = strdup("tcp");
@@ -7114,7 +7112,7 @@ globus_l_gfs_data_handle_init(
ent->loaded = GLOBUS_TRUE;
globus_list_insert(tailp, ent);
tailp = globus_list_rest_ref(*tailp);
-
+
ent = malloc(sizeof(globus_xio_driver_list_ent_t));
ent->driver = globus_io_compat_get_gsi_driver();
ent->driver_name = strdup("gsi");
@@ -7124,7 +7122,7 @@ globus_l_gfs_data_handle_init(
globus_list_insert(tailp, ent);
tailp = globus_list_rest_ref(*tailp);
}
-
+
if(!globus_list_empty(net_stack_list))
{
globus_xio_stack_t stack;
@@ -7144,7 +7142,7 @@ globus_l_gfs_data_handle_init(
globus_error_print_friendly(globus_error_peek(result)));
goto error_control;
}
-
+
for (p = net_stack_list; !globus_list_empty(p); p = globus_list_rest(p))
{
@@ -7160,7 +7158,7 @@ globus_l_gfs_data_handle_init(
}
globus_xio_stack_init(&stack, NULL);
-
+
result = globus_xio_driver_list_to_stack_attr(
new_net_stack_list, stack, xio_attr);
globus_list_free(new_net_stack_list);
@@ -7179,10 +7177,10 @@ globus_l_gfs_data_handle_init(
char * opt_str;
globus_xio_stack_push_driver(stack, globus_l_gfs_netmgr_driver);
-
+
opt_str = globus_common_create_string(
- "service=gridftp-data;task-id=%s;%s",
- session_handle->taskid ? session_handle->taskid : "none",
+ "service=gridftp-data;task-id=%s;%s",
+ session_handle->taskid ? session_handle->taskid : "none",
globus_i_gfs_config_string("netmgr"));
result = globus_xio_attr_cntl(
@@ -7197,13 +7195,13 @@ globus_l_gfs_data_handle_init(
"Setting network manager options \"%s\": %s\n",
opt_str,
globus_error_print_friendly(globus_error_peek(result)));
- globus_free(opt_str);
+ globus_free(opt_str);
goto error_control;
}
globus_free(opt_str);
}
-
+
result = globus_i_ftp_control_data_set_stack(
&handle->data_channel, stack);
if(result != GLOBUS_SUCCESS)
@@ -7720,7 +7718,7 @@ globus_l_gfs_data_hybrid_session_start_cb(
{
globus_l_gfs_data_operation_t * op;
globus_l_gfs_data_operation_t * hybrid_op;
-
+
op = user_arg;
if(op && op->hybrid_op)
{
@@ -7754,7 +7752,7 @@ globus_l_gfs_data_hybrid_session_start_cb(
globus_l_gfs_data_passive_kickout,
bounce_info);
}
-
+
else
{
globus_i_gfs_data_request_passive(
@@ -7790,7 +7788,7 @@ globus_l_gfs_data_hybrid_session_start_cb(
globus_l_gfs_data_active_kickout,
bounce_info);
}
-
+
else
{
globus_i_gfs_data_request_active(
@@ -7836,7 +7834,7 @@ globus_l_gfs_data_passive_kickout(
bounce_info->handle->is_mine = GLOBUS_TRUE;
bounce_info->handle->state = GLOBUS_L_GFS_DATA_HANDLE_VALID;
- reply.info.data.data_arg = (void *) (intptr_t)
+ reply.info.data.data_arg = (void *) (intptr_t)
globus_handle_table_insert(
&bounce_info->handle->session_handle->handle_table,
bounce_info->handle,
@@ -7901,16 +7899,16 @@ globus_i_gfs_data_request_passive(
session_handle = (globus_l_gfs_data_session_t *) session_arg;
globus_l_gfs_data_reset_watchdog(session_handle, NULL);
- if(session_handle->hybrid && data_info->max_cs != 1 &&
+ if(session_handle->hybrid && data_info->max_cs != 1 &&
session_handle->dsi != globus_l_gfs_dsi_hybrid)
{
globus_l_gfs_data_operation_t * hybrid_op;
result = globus_i_gfs_data_new_dsi(
- &globus_l_gfs_active_dsi_handle,
- "remote",
- &globus_l_gfs_dsi_hybrid,
+ &globus_l_gfs_active_dsi_handle,
+ "remote",
+ &globus_l_gfs_dsi_hybrid,
GLOBUS_FALSE);
-
+
if(!globus_l_gfs_dsi_hybrid)
{
goto error_op;
@@ -7925,7 +7923,7 @@ globus_i_gfs_data_request_passive(
}
session_handle->dsi = globus_l_gfs_dsi_hybrid;
-
+
result = globus_l_gfs_data_operation_init(&op, session_handle);
if(result != GLOBUS_SUCCESS)
{
@@ -7933,7 +7931,7 @@ globus_i_gfs_data_request_passive(
"globus_l_gfs_data_operation_init", result);
goto error_op;
}
-
+
result = globus_l_gfs_data_operation_init(
(globus_l_gfs_data_operation_t **) &op->hybrid_op, session_handle);
if(result != GLOBUS_SUCCESS)
@@ -7952,8 +7950,8 @@ globus_i_gfs_data_request_passive(
hybrid_op->session_handle = session_handle;
hybrid_op->info_struct = data_info;
-
-
+
+
op->callback = globus_l_gfs_data_hybrid_session_start_cb;
op->user_arg = op;
op->session_handle = session_handle;
@@ -7962,10 +7960,10 @@ globus_i_gfs_data_request_passive(
op->type = GLOBUS_L_GFS_DATA_INFO_TYPE_PASSIVE;
globus_l_gfs_data_auth_init_cb(
NULL, GFS_ACL_ACTION_INIT, op, GLOBUS_SUCCESS);
-
+
return;
}
-
+
if(session_handle->dsi->passive_func != NULL)
{
result = globus_l_gfs_data_operation_init(&op, session_handle);
@@ -8009,7 +8007,7 @@ globus_i_gfs_data_request_passive(
data_info->del_cred = session_handle->del_cred;
}
else
- {
+ {
session_handle->dcsc_cred = data_info->del_cred;
data_info->del_cred = NULL;
}
@@ -8035,7 +8033,7 @@ globus_i_gfs_data_request_passive(
"globus_ftp_control_local_pasv", result);
goto error_control;
}
-
+
/* XXX This needs to be smarter. The address should be the same one
* the user is connected to on the control channel (at least when
@@ -8232,17 +8230,17 @@ globus_i_gfs_data_request_active(
session_handle = (globus_l_gfs_data_session_t *) session_arg;
globus_l_gfs_data_reset_watchdog(session_handle, NULL);
- if(session_handle->hybrid && data_info->cs_count != 1 &&
+ if(session_handle->hybrid && data_info->cs_count != 1 &&
session_handle->dsi != globus_l_gfs_dsi_hybrid)
{
globus_l_gfs_data_operation_t * hybrid_op;
-
+
result = globus_i_gfs_data_new_dsi(
&globus_l_gfs_active_dsi_handle,
"remote",
&globus_l_gfs_dsi_hybrid,
GLOBUS_FALSE);
-
+
if(!globus_l_gfs_dsi_hybrid)
{
goto error_op;
@@ -8257,7 +8255,7 @@ globus_i_gfs_data_request_active(
}
session_handle->dsi = globus_l_gfs_dsi_hybrid;
-
+
result = globus_l_gfs_data_operation_init(&op, session_handle);
if(result != GLOBUS_SUCCESS)
{
@@ -8265,7 +8263,7 @@ globus_i_gfs_data_request_active(
"globus_l_gfs_data_operation_init", result);
goto error_op;
}
-
+
result = globus_l_gfs_data_operation_init(
(globus_l_gfs_data_operation_t **) &op->hybrid_op, session_handle);
if(result != GLOBUS_SUCCESS)
@@ -8284,8 +8282,8 @@ globus_i_gfs_data_request_active(
hybrid_op->session_handle = session_handle;
hybrid_op->info_struct = data_info;
-
-
+
+
op->callback = globus_l_gfs_data_hybrid_session_start_cb;
op->user_arg = op;
op->session_handle = session_handle;
@@ -8294,10 +8292,10 @@ globus_i_gfs_data_request_active(
op->type = GLOBUS_L_GFS_DATA_INFO_TYPE_ACTIVE;
globus_l_gfs_data_auth_init_cb(
NULL, GFS_ACL_ACTION_INIT, op, GLOBUS_SUCCESS);
-
+
return;
}
-
+
if(session_handle->dsi->active_func != NULL)
{
result = globus_l_gfs_data_operation_init(&op, session_handle);
@@ -8489,7 +8487,7 @@ globus_i_gfs_data_request_recv(
session_handle = (globus_l_gfs_data_session_t *) session_arg;
globus_l_gfs_data_reset_watchdog(session_handle, "RECV");
-
+
/* YOU ARE ENTERING THE UGLY HACK ZONE */
globus_mutex_lock(&session_handle->mutex);
{
@@ -8517,7 +8515,7 @@ globus_i_gfs_data_request_recv(
"globus_l_gfs_data_operation_init", result);
goto error_op;
}
-
+
op->ipc_handle = ipc_handle;
op->session_handle = session_handle;
op->type = GLOBUS_L_GFS_DATA_INFO_TYPE_RECV;
@@ -8539,14 +8537,14 @@ globus_i_gfs_data_request_recv(
op->markers = globus_i_gfs_config_bool("always_send_markers");
if(session_handle->storattr_str)
{
- op->storattr = (globus_l_gfs_storattr_t *)
+ op->storattr = (globus_l_gfs_storattr_t *)
globus_calloc(1, sizeof(globus_l_gfs_storattr_t));
op->storattr->all = session_handle->storattr_str;
session_handle->storattr_str = NULL;
op->storattr->modify = globus_i_gfs_kv_getval(
op->storattr->all, "modify", 0);
-
+
op->storattr->checksum_md5 = globus_i_gfs_kv_getval(
op->storattr->all, "x.checksum.md5", 0);
if(!op->storattr->checksum_md5)
@@ -8554,11 +8552,11 @@ globus_i_gfs_data_request_recv(
op->storattr->checksum_md5 = globus_i_gfs_kv_getval(
op->storattr->all, "checksum.md5", 0);
}
-
+
if(op->storattr->checksum_md5 && !recv_info->expected_checksum)
{
recv_info->expected_checksum_alg = globus_libc_strdup("md5");
- recv_info->expected_checksum =
+ recv_info->expected_checksum =
globus_libc_strdup(op->storattr->checksum_md5);
}
}
@@ -8568,7 +8566,7 @@ globus_i_gfs_data_request_recv(
{
/* globus_assert(data_handle->outstanding_op == NULL); */
data_handle->outstanding_op = op;
- globus_assert(data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_VALID ||
+ globus_assert(data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_VALID ||
data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_TE_VALID);
data_handle->state = GLOBUS_L_GFS_DATA_HANDLE_INUSE;
}
@@ -8577,7 +8575,7 @@ globus_i_gfs_data_request_recv(
{
op->http_ip = data_handle->http_ip;
data_handle->http_ip = NULL;
-
+
op->op_info_id = globus_l_gfs_op_info_ctr++;
if(!recv_info->op_info)
{
@@ -8748,7 +8746,7 @@ globus_i_gfs_data_request_send(
{
/*globus_assert(data_handle->outstanding_op == NULL); */
data_handle->outstanding_op = op;
- globus_assert(data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_VALID ||
+ globus_assert(data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_VALID ||
data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_TE_VALID);
data_handle->state = GLOBUS_L_GFS_DATA_HANDLE_INUSE;
}
@@ -8757,7 +8755,7 @@ globus_i_gfs_data_request_send(
{
op->http_ip = data_handle->http_ip;
data_handle->http_ip = NULL;
-
+
op->op_info_id = globus_l_gfs_op_info_ctr++;
if(!send_info->op_info)
{
@@ -8774,7 +8772,7 @@ globus_i_gfs_data_request_send(
char * full_pathname = NULL;
chdir_to = globus_i_gfs_config_string("chdir_to");
-
+
result = globus_i_gfs_get_full_path(
session_handle->home_dir,
chdir_to ? chdir_to : "/", // XXX
@@ -8853,7 +8851,7 @@ globus_i_gfs_data_request_send(
static
void
globus_l_gfs_data_list_done(
- globus_l_gfs_data_operation_t* op,
+ globus_l_gfs_data_operation_t* op,
globus_result_t result)
{
while(op->path_list)
@@ -8871,7 +8869,7 @@ globus_l_gfs_data_list_done(
globus_free(tofree->pathname);
globus_free(tofree);
}
-
+
op->current_path = NULL;
globus_free(op->stat_wrapper);
globus_gridftp_server_finished_transfer(op, result);
@@ -8899,18 +8897,18 @@ globus_l_gfs_data_request_next_path(
orig_op->current_path = NULL;
free(stat_info->pathname);
}
-
+
nextpath = orig_op->path_list;
if(nextpath)
{
orig_op->path_list = nextpath->next;
-
+
result = globus_l_gfs_data_operation_init(&op, orig_op->session_handle);
if(result != GLOBUS_SUCCESS)
{
goto error_op;
- }
-
+ }
+
op->uid = getuid();
op->state = GLOBUS_L_GFS_DATA_REQUESTING;
op->callback = globus_l_gfs_data_list_stat_cb;
@@ -8918,15 +8916,15 @@ globus_l_gfs_data_request_next_path(
op->session_handle = orig_op->session_handle;
op->info_struct = orig_op->stat_wrapper;
op->type = GLOBUS_L_GFS_DATA_INFO_TYPE_STAT;
-
+
stat_info->pathname = nextpath->pathname;
-
+
globus_callback_register_oneshot(
NULL,
NULL,
globus_l_gfs_blocking_dispatch_kickout,
op);
-
+
orig_op->current_path = nextpath;
}
@@ -8965,21 +8963,21 @@ globus_l_gfs_data_list_write_cb(
{
globus_free(bounce_info->list_response);
}
-
+
globus_mutex_lock(&op->stat_lock);
if(bounce_info->final_stat && !globus_l_gfs_data_request_next_path(op))
{
finish = GLOBUS_TRUE;
}
globus_mutex_unlock(&op->stat_lock);
-
+
globus_free(bounce_info);
if(op->delayed_error != GLOBUS_SUCCESS)
{
result = op->delayed_error;
}
-
+
if(finish)
{
globus_l_gfs_data_list_done(op, result);
@@ -9007,7 +9005,7 @@ globus_l_gfs_data_list_stat_cb(
int i;
int dirlen;
int baselen;
-
+
GlobusGFSName(globus_l_gfs_data_list_stat_cb);
GlobusGFSDebugEnter();
@@ -9025,7 +9023,7 @@ globus_l_gfs_data_list_stat_cb(
result = reply->result;
goto error;
}
- if (!(op->traversal_options & GLOBUS_GFS_TRAVERSAL_CONTINUE))
+ if (!(op->traversal_options & GLOBUS_GFS_TRAVERSAL_CONTINUE))
{
/** MLSR failure. We want to write out the information for
* this directory and then fail. */
@@ -9036,13 +9034,13 @@ globus_l_gfs_data_list_stat_cb(
stat_array = reply->info.stat.stat_array;
stat_count = reply->info.stat.stat_count;
file_count = stat_count;
-
+
if(op->list_depth != 0)
{
/** Skip the first entry if we are including the directory itself in the listing */
int base_entry = 0;
-
- /** Correct for path which pointed to a single file */
+
+ /** Correct for path which pointed to a single file */
if(stat_count == 1 && op->current_path && op->current_path->subpath)
{
int plen = strlen(op->current_path->subpath);
@@ -9050,12 +9048,12 @@ globus_l_gfs_data_list_stat_cb(
if(plen > nlen && strcmp(&op->current_path->subpath[plen-nlen], stat_array[0].name) == 0)
{
op->current_path->subpath[plen-nlen-1] = '\0';
- }
+ }
}
if (stat_info->include_path_stat && stat_count > 0 && S_ISDIR(stat_array[0].mode))
{
- if (op->current_path)
+ if (op->current_path)
{
stat_array[0].name[0] = '\0';
}
@@ -9066,11 +9064,11 @@ globus_l_gfs_data_list_stat_cb(
}
++base_entry;
}
-
+
/** Move unwanted directory entries to the end and add them to the path */
for (i = base_entry; i < file_count;)
{
- if (S_ISDIR(stat_array[i].mode) &&
+ if (S_ISDIR(stat_array[i].mode) &&
(stat_info->include_path_stat ||
(stat_array[i].name[0] == '.' &&
(stat_array[i].name[1] == '\0' || (stat_array[i].name[1] == '.' && stat_array[i].name[2] == '\0')))))
@@ -9081,29 +9079,29 @@ globus_l_gfs_data_list_stat_cb(
memcpy(&stat_array[i], &stat_array[file_count-1], sizeof(globus_gfs_stat_t));
memcpy(&stat_array[file_count-1], &stat_temp, sizeof(globus_gfs_stat_t));
/** Decrement effective count */
- --file_count;
+ --file_count;
}
else
{
++i;
- }
+ }
}
-
+
dirlen = strlen(stat_info->pathname);
- baselen = op->current_path ?
- (strlen(op->current_path->pathname) - strlen(op->current_path->subpath)) :
+ baselen = op->current_path ?
+ (strlen(op->current_path->pathname) - strlen(op->current_path->subpath)) :
(dirlen + 1);
-
+
/** Add directories, minus the current (.) and parent (..), to the list
* of paths to be explored. Paths should be added at the end of the list. */
for (i = base_entry; i < stat_count; ++i)
{
globus_l_gfs_data_path_list_t* newpath = NULL;
-
+
/** If we are to follow symbolic links, create a new traversal path for each */
- if ((op->traversal_options & GLOBUS_GFS_TRAVERSAL_FOLLOW_SYMLINKS) &&
+ if ((op->traversal_options & GLOBUS_GFS_TRAVERSAL_FOLLOW_SYMLINKS) &&
stat_array[i].symlink_target &&
- stat_array[i].error != GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_INVALIDLINK)
+ stat_array[i].error != GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_INVALIDLINK)
{
newpath = (globus_l_gfs_data_path_list_t*)globus_malloc(sizeof(globus_l_gfs_data_path_list_t));
if (newpath)
@@ -9114,19 +9112,19 @@ globus_l_gfs_data_list_stat_cb(
else
{
goto error;
- }
- }
+ }
+ }
/** Create new traversal paths for subdirectories (ignore . and ..) */
else if (S_ISDIR(stat_array[i].mode) &&
- (stat_array[i].name[0] != '.' ||
+ (stat_array[i].name[0] != '.' ||
(stat_array[i].name[1] != '\0' && (stat_array[i].name[1] != '.' || stat_array[i].name[2] != '\0'))))
{
newpath = (globus_l_gfs_data_path_list_t*)globus_malloc(sizeof(globus_l_gfs_data_path_list_t));
if (newpath)
{
- newpath->pathname = (char *)globus_malloc(dirlen + strlen(stat_array[i].name) + 2);
+ newpath->pathname = (char *)globus_malloc(dirlen + strlen(stat_array[i].name) + 2);
sprintf(newpath->pathname, "%s/%s", stat_info->pathname, stat_array[i].name);
- newpath->subpath = &newpath->pathname[baselen];
+ newpath->subpath = &newpath->pathname[baselen];
}
else
{
@@ -9134,20 +9132,20 @@ globus_l_gfs_data_list_stat_cb(
}
}
- if (newpath)
+ if (newpath)
{
/*
* This section does cycle and duplicate path detection. We only need to do
* this when symbolic link traversal is on (shouldn't happen otherwise, unless
* someone's done something nasty with hard links).
- *
+ *
* We check symbolic link targets against a set of "root paths", which are either
- * the base root the MLSR was started with, or other link targets. If a root is
+ * the base root the MLSR was started with, or other link targets. If a root is
* entirely contained in a target, we'll already catch it, so no need to add it.
- *
- * If the target is entirely contained in a root, then we have a cycle, and we
- * mark the path as such.
- *
+ *
+ * If the target is entirely contained in a root, then we have a cycle, and we
+ * mark the path as such.
+ *
* When expanding directories, if the parent is marked as having a cycle, we
* check the subdirectory. If the subdirectory still has a cycle, it is marked
* as such--however, if it doesn't then we can avoid the cycle check for future
@@ -9158,11 +9156,11 @@ globus_l_gfs_data_list_stat_cb(
*/
if (op->traversal_options & GLOBUS_GFS_TRAVERSAL_FOLLOW_SYMLINKS)
{
- globus_l_gfs_data_path_list_t* iter;
- int newpathlen = strlen(newpath->pathname);
-
+ globus_l_gfs_data_path_list_t* iter;
+ int newpathlen = strlen(newpath->pathname);
+
newpath->has_cycle = GLOBUS_FALSE;
-
+
/** For symbolic links, validate the path--we don't want any duplicated paths */
if (stat_array[i].symlink_target)
{
@@ -9181,7 +9179,7 @@ globus_l_gfs_data_list_stat_cb(
(iter->pathname[newpathlen] == '/' || iter->pathname[newpathlen] == '\0'))
{
/** This target has a cycle */
- newpath->has_cycle = GLOBUS_TRUE;
+ newpath->has_cycle = GLOBUS_TRUE;
}
}
}
@@ -9196,7 +9194,7 @@ globus_l_gfs_data_list_stat_cb(
globus_free(newpath->pathname);
globus_free(newpath);
newpath = NULL;
- }
+ }
else if(strncmp(iter->pathname, newpath->pathname, newpathlen) == 0 &&
(iter->pathname[newpathlen] == '/' || iter->pathname[newpathlen] == '\0'))
{
@@ -9205,19 +9203,19 @@ globus_l_gfs_data_list_stat_cb(
}
}
}
-
+
/** Add the path to the traversal list */
- if (newpath)
+ if (newpath)
{
if (stat_array[i].symlink_target)
{
globus_l_gfs_data_path_list_t** ppiter;
-
+
/** Append symlink targets to the end of the traversal queue */
- newpath->next = NULL;
+ newpath->next = NULL;
for (ppiter = &op->path_list; *ppiter; ppiter = &((*ppiter)->next)) ;
- *ppiter = newpath;
-
+ *ppiter = newpath;
+
/** Symbolic links to directories should be added to the root list. */
if (S_ISDIR(stat_array[i].link_mode))
{
@@ -9228,37 +9226,37 @@ globus_l_gfs_data_list_stat_cb(
newroot->pathname = globus_libc_strdup(newpath->pathname);
newroot->subpath = NULL;
newroot->next = op->root_paths;
- op->root_paths = newroot;
- }
+ op->root_paths = newroot;
+ }
else
{
goto error;
}
}
- }
- else
+ }
+ else
{
/** Prepend directory expansion targets to the head of the queue */
newpath->next = op->path_list;
op->path_list = newpath;
}
- }
+ }
}
}
}
-
+
globus_mutex_lock(&op->stat_lock);
if(!op->begin_called)
{
op->begin_called = GLOBUS_TRUE;
globus_gridftp_server_begin_transfer(op, 0, NULL);
}
-
+
list_buffer = NULL;
buffer_len = 0;
-
- if(file_count > 0)
- {
+
+ if(file_count > 0)
+ {
result = globus_gridftp_server_control_list_buffer_alloc(
op->list_type,
op->uid,
@@ -9273,7 +9271,7 @@ globus_l_gfs_data_list_stat_cb(
"globus_gridftp_server_control_list_buffer_alloc", result);
goto error;
}
- }
+ }
else if(op->delayed_error != GLOBUS_SUCCESS || !globus_l_gfs_data_request_next_path(op))
{
list_buffer = (globus_byte_t *) globus_libc_strdup("\r");
@@ -9289,12 +9287,12 @@ globus_l_gfs_data_list_stat_cb(
result = GlobusGFSErrorMemory("bounce_info");
goto error;
}
-
+
if(reply->code != 100)
{
bounce_info->final_stat = GLOBUS_TRUE;
}
-
+
result = globus_gridftp_server_register_write(
op,
list_buffer,
@@ -9312,8 +9310,8 @@ globus_l_gfs_data_list_stat_cb(
goto error;
}
op->list_buffer_offset += buffer_len;
- }
-
+ }
+
globus_mutex_unlock(&op->stat_lock);
GlobusGFSDebugExit();
@@ -9355,7 +9353,7 @@ globus_gridftp_server_finished_stat_custom_list(
result = GlobusGFSErrorMemory("bounce_info");
goto error;
}
-
+
bounce_info->custom_list = GLOBUS_TRUE;
bounce_info->free_buffer = free_buffer;
if(free_buffer)
@@ -9519,7 +9517,7 @@ globus_i_gfs_data_request_list(
stat_info->pathname = list_info->pathname;
stat_info->file_only = GLOBUS_FALSE;
stat_info->use_symlink_info = data_op->list_depth != 0;
- stat_info->include_path_stat = data_op->list_depth != 0;
+ stat_info->include_path_stat = data_op->list_depth != 0;
data_op->info_struct = list_info;
data_op->stat_wrapper = stat_info;
@@ -9536,7 +9534,7 @@ globus_i_gfs_data_request_list(
/**
*** Trim any trailing '/'
- **/
+ **/
len = strlen(stat_info->pathname);
if(len > 0 && stat_info->pathname[len - 1] == '/')
{
@@ -9801,7 +9799,7 @@ globus_l_gfs_data_begin_cb(
op->data_handle->info.tcp_bufsize = sndbuf;
}
}
-
+
globus_gfs_log_message(
GLOBUS_GFS_LOG_INFO,
"Starting to transfer \"%s\".\n",
@@ -9835,7 +9833,7 @@ globus_l_gfs_data_begin_cb(
event_reply.type = GLOBUS_GFS_EVENT_TRANSFER_CONNECTED;
event_reply.id = op->id;
event_reply.event_arg = op;
-
+
if(op->event_callback != NULL)
{
op->event_callback(&event_reply, op->user_arg);
@@ -9846,14 +9844,14 @@ globus_l_gfs_data_begin_cb(
event_reply.op_info->remote_ip = globus_libc_strdup(op->remote_ip);
globus_gfs_ipc_reply_event(op->ipc_handle, &event_reply);
-
+
if(event_reply.op_info->remote_ip)
{
globus_free(event_reply.op_info->remote_ip);
}
globus_free(event_reply.op_info);
}
-
+
if((!op->writing || op->retr_markers)
&& (op->data_handle->info.mode == 'E' || op->markers))
{
@@ -10041,7 +10039,7 @@ globus_l_gfs_data_end_transfer_kickout(
memset(&reply, '\0', sizeof(globus_gfs_finished_info_t));
- if(op->cached_res == GLOBUS_SUCCESS &&
+ if(op->cached_res == GLOBUS_SUCCESS &&
op->writing && op->data_handle->http_handle)
{
globus_xio_data_descriptor_t descriptor;
@@ -10054,12 +10052,12 @@ globus_l_gfs_data_end_transfer_kickout(
globus_hashtable_t header_table = NULL;
globus_bool_t eof = 0;
-
+
globus_xio_handle_cntl(
handle,
op->session_handle->http_driver,
GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY);
-
+
result = globus_xio_data_descriptor_init(&descriptor, handle);
globus_assert(result == GLOBUS_SUCCESS);
@@ -10104,7 +10102,7 @@ globus_l_gfs_data_end_transfer_kickout(
body_buffer = malloc(buflen+1);
do
- {
+ {
body_nbytes = 0;
result = globus_xio_read(
handle,
@@ -10131,13 +10129,13 @@ globus_l_gfs_data_end_transfer_kickout(
else
{
waitfor = GLOBUS_MIN(1024, buflen-total_nbytes);
- }
+ }
} while(!eof);
-
+
body_buffer[total_nbytes] = '\0';
globus_i_gfs_data_http_print_response(
status_code, &header_table, body_buffer, &header_str);
-
+
err_str = globus_common_create_string(
"HTTP PUT failed with \"%03d %s\"\n%s",
status_code,
@@ -10145,7 +10143,7 @@ globus_l_gfs_data_end_transfer_kickout(
header_str);
result = GlobusGFSErrorGeneric(err_str);
-
+
globus_free(err_str);
globus_free(header_str);
globus_free(body_buffer);
@@ -10181,7 +10179,7 @@ globus_l_gfs_data_end_transfer_kickout(
eof = GLOBUS_TRUE;
}
total_nbytes += body_nbytes;
-
+
if(body_nbytes == 0 || total_nbytes == buflen)
{
eof = GLOBUS_TRUE;
@@ -10189,14 +10187,14 @@ globus_l_gfs_data_end_transfer_kickout(
else
{
waitfor = GLOBUS_MIN(1024, buflen-total_nbytes);
- }
+ }
}
result = GLOBUS_SUCCESS;
globus_free(body_buffer);
globus_i_gfs_data_http_print_response(
status_code, &header_table, NULL, &op->data_handle->http_response_str);
}
-
+
}
response_exit:
if(op->cached_res == GLOBUS_SUCCESS)
@@ -10450,7 +10448,7 @@ globus_l_gfs_data_end_transfer_kickout(
{
globus_free(retransmit_str);
}
-
+
/* XXX sc process bytes transferred count */
{
char * names[5] =
@@ -10495,7 +10493,7 @@ globus_l_gfs_data_end_transfer_kickout(
reply.result = op->cached_res;
/* pull response code from error */
- if(reply.result != GLOBUS_SUCCESS &&
+ if(reply.result != GLOBUS_SUCCESS &&
(reply.code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(reply.result))) != 0)
{
@@ -10506,9 +10504,9 @@ globus_l_gfs_data_end_transfer_kickout(
{
reply.code = op->user_code;
- /* DO NETLOGGER STUFF
+ /* DO NETLOGGER STUFF
* XXX unless user has a message -- will only be a problem if a DSI
- * is sending messages to the control channel, in which case they
+ * is sending messages to the control channel, in which case they
* just aren't compatible with the netlogger bottleneck reporting
*/
if(op->user_msg == NULL)
@@ -10533,7 +10531,7 @@ globus_l_gfs_data_end_transfer_kickout(
&reply);
}
globus_l_gfs_data_reset_watchdog(op->session_handle, NULL);
-
+
/* remove the reference for this callback. It is possible that before
acquiring this lock the completing state occurred and we are
ready to finish */
@@ -10688,7 +10686,7 @@ globus_l_gfs_data_end_read_kickout(
}
globus_mutex_lock(&op->session_handle->mutex);
- {
+ {
switch(op->data_handle->state)
{
case GLOBUS_L_GFS_DATA_HANDLE_INUSE:
@@ -10715,7 +10713,7 @@ globus_l_gfs_data_end_read_kickout(
default:
break;
}
-
+
recv_info = op->info_struct;
object.name = recv_info->pathname;
object.size = op->bytes_transferred;
@@ -10788,7 +10786,7 @@ void
globus_l_gfs_data_send_eof_cb(
void * callback_arg,
struct globus_ftp_control_handle_s * handle,
- globus_object_t * error)
+ globus_object_t * error)
{
globus_l_gfs_data_operation_t * op;
GlobusGFSName(globus_l_gfs_data_send_eof_cb);
@@ -11102,7 +11100,7 @@ globus_l_gfs_data_trev_kickout(
bounce_info->op->recvd_bytes = 0;
event_reply->type = GLOBUS_GFS_EVENT_BYTES_RECVD;
break;
-
+
case GLOBUS_GFS_EVENT_RANGES_RECVD:
event_reply->type = GLOBUS_GFS_EVENT_RANGES_RECVD;
globus_range_list_copy(
@@ -11111,7 +11109,7 @@ globus_l_gfs_data_trev_kickout(
globus_range_list_remove(
bounce_info->op->recvd_ranges, 0, GLOBUS_RANGE_LIST_MAX);
break;
-
+
default:
globus_assert(0 && "invalid state, not possible");
break;
@@ -11378,7 +11376,7 @@ globus_i_gfs_data_request_transfer_event(
GlobusGFSDebugEnter();
session_handle = (globus_l_gfs_data_session_t *) session_arg;
- op = (globus_l_gfs_data_operation_t *)
+ op = (globus_l_gfs_data_operation_t *)
globus_handle_table_lookup(
&session_handle->handle_table, (intptr_t) event_info->event_arg);
if(op == NULL)
@@ -11561,7 +11559,7 @@ globus_i_gfs_data_request_transfer_event(
globus_mutex_unlock(&op->session_handle->mutex);
/*
- if(event_info->type == GLOBUS_GFS_EVENT_TRANSFER_COMPLETE &&
+ if(event_info->type == GLOBUS_GFS_EVENT_TRANSFER_COMPLETE &&
op->data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_TE_VALID)
{
op->data_handle->state = GLOBUS_L_GFS_DATA_HANDLE_VALID;
@@ -11603,7 +11601,7 @@ globus_i_gfs_data_session_start(
session_handle->del_cred = session_info->del_cred;
session_handle->context = context;
session_handle->dcsc_cred = GSS_C_NO_CREDENTIAL;
- session_handle->order_data = session_handle->dsi->descriptor &
+ session_handle->order_data = session_handle->dsi->descriptor &
GLOBUS_GFS_DSI_DESCRIPTOR_REQUIRES_ORDERED_DATA;
result = globus_l_gfs_data_operation_init(&op, session_handle);
if(result != GLOBUS_SUCCESS)
@@ -11619,7 +11617,7 @@ globus_i_gfs_data_session_start(
op->callback = cb;
op->user_arg = user_arg;
op->info_struct = session_info;
-
+
result = globus_l_gfs_data_load_stack(
"default",
&op->session_handle->net_stack_list,
@@ -11657,11 +11655,11 @@ globus_i_gfs_data_session_start(
if(globus_i_gfs_config_int("auth_level") & GLOBUS_L_GFS_AUTH_IDENTIFY)
{
globus_l_gfs_data_authorize(op, context, session_info);
-
+
if(globus_i_gfs_config_bool("hybrid"))
{
globus_gfs_session_info_t * session_info_copy;
-
+
session_info_copy = (globus_gfs_session_info_t *)
globus_malloc(sizeof(globus_gfs_session_info_t));
session_info_copy->del_cred = session_info->del_cred;
@@ -11672,7 +11670,7 @@ globus_i_gfs_data_session_start(
session_info_copy->subject = globus_libc_strdup(session_info->subject);
session_info_copy->cookie = globus_libc_strdup(session_info->cookie);
session_info_copy->host_id = globus_libc_strdup(session_info->host_id);
-
+
session_handle->session_info_copy = session_info_copy;
session_handle->hybrid = GLOBUS_TRUE;
}
@@ -11694,7 +11692,7 @@ globus_i_gfs_data_session_start(
op->session_handle->gid_array);
}
- op->session_handle->username =
+ op->session_handle->username =
globus_libc_strdup(session_info->username);
pwent = getpwuid(op->session_handle->uid);
@@ -11706,30 +11704,30 @@ globus_i_gfs_data_session_start(
{
op->session_handle->true_home = globus_l_gfs_defaulthome();
}
-
+
custom_home_dir = globus_i_gfs_config_string("home_dir");
if(custom_home_dir)
{
char * var_dir;
-
+
var_dir = globus_l_gfs_data_update_var_path(
op->session_handle, custom_home_dir);
-
+
op->session_handle->home_dir = var_dir;
}
else
{
- op->session_handle->home_dir =
+ op->session_handle->home_dir =
globus_libc_strdup(op->session_handle->true_home);
}
-
+
globus_l_gfs_data_update_restricted_paths(
op->session_handle, &globus_l_gfs_path_alias_list_base);
globus_l_gfs_data_update_restricted_paths(
op->session_handle, &globus_l_gfs_path_alias_list_sharing);
op->session_handle->active_rp_list = &globus_l_gfs_path_alias_list_base;
-
- if(!globus_i_gfs_config_bool("use_home_dirs") ||
+
+ if(!globus_i_gfs_config_bool("use_home_dirs") ||
op->session_handle->home_dir == NULL)
{
if(op->session_handle->home_dir)
@@ -11737,12 +11735,12 @@ globus_i_gfs_data_session_start(
globus_free(op->session_handle->home_dir);
}
op->session_handle->home_dir = strdup("/");
- }
+ }
if(globus_i_gfs_config_bool("hybrid"))
{
globus_gfs_session_info_t * session_info_copy;
-
+
session_info_copy = (globus_gfs_session_info_t *)
globus_malloc(sizeof(globus_gfs_session_info_t));
session_info_copy->del_cred = session_info->del_cred;
@@ -11753,18 +11751,18 @@ globus_i_gfs_data_session_start(
session_info_copy->subject = globus_libc_strdup(session_info->subject);
session_info_copy->cookie = globus_libc_strdup(session_info->cookie);
session_info_copy->host_id = globus_libc_strdup(session_info->host_id);
-
+
session_handle->session_info_copy = session_info_copy;
session_handle->hybrid = GLOBUS_TRUE;
}
-
+
globus_l_gfs_data_auth_init_cb(
NULL, GFS_ACL_ACTION_INIT, op, GLOBUS_SUCCESS);
}
GlobusGFSDebugExit();
}
-
+
void
globus_i_gfs_data_session_stop(
globus_gfs_ipc_handle_t ipc_handle,
@@ -11830,7 +11828,7 @@ globus_i_gfs_data_session_stop(
globus_gfs_log_message(
GLOBUS_GFS_LOG_INFO,
"Called main session_stop after %d ticks.\n", waitcnt - 1);
- }
+ }
}
if(globus_l_gfs_watchdog_limit)
@@ -11860,7 +11858,7 @@ globus_l_gfs_finished_command_kickout(
bounce = (globus_l_gfs_data_cmd_bounce_t *) user_arg;
op = bounce->op;
-
+
if(op->callback != NULL)
{
op->callback(
@@ -11873,7 +11871,7 @@ globus_l_gfs_finished_command_kickout(
op->ipc_handle,
&bounce->reply);
}
-
+
if(bounce->reply.info.command.checksum)
{
globus_free(bounce->reply.info.command.checksum);
@@ -11906,7 +11904,7 @@ globus_l_gfs_finished_command_kickout(
globus_assert(destroy_op);
globus_l_gfs_data_fire_cb(op, remote_data_arg, destroy_session);
globus_l_gfs_data_operation_destroy(op);
-
+
globus_free(bounce);
}
@@ -11969,7 +11967,7 @@ globus_gridftp_server_finished_command(
}
op->cached_res = result;
- bounce = (globus_l_gfs_data_cmd_bounce_t *)
+ bounce = (globus_l_gfs_data_cmd_bounce_t *)
globus_calloc(1, sizeof(globus_l_gfs_data_cmd_bounce_t));
bounce->op = op;
@@ -11980,7 +11978,7 @@ globus_gridftp_server_finished_command(
bounce->reply.info.command.checksum = globus_libc_strdup(op->cksm_response);
/* pull response code from error */
- if(result != GLOBUS_SUCCESS &&
+ if(result != GLOBUS_SUCCESS &&
(code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) != 0)
{
@@ -12003,7 +12001,7 @@ globus_gridftp_server_finished_command(
bounce->reply.info.command.created_dir = globus_libc_strdup(op->pathname);
}
}
-
+
result = globus_callback_register_oneshot(
NULL,
NULL,
@@ -12038,9 +12036,9 @@ globus_gridftp_server_finished_stat_partial(
globus_mutex_lock(&op->stat_lock);
if(result == GLOBUS_SUCCESS)
- {
+ {
stat_info = (globus_gfs_stat_info_t *) op->info_struct;
-
+
stat_copy = (globus_gfs_stat_t *)
globus_malloc(sizeof(globus_gfs_stat_t) * stat_count);
if(stat_copy == NULL)
@@ -12048,9 +12046,9 @@ globus_gridftp_server_finished_stat_partial(
result = GlobusGFSErrorMemory("stat_copy");
}
}
-
+
if(result == GLOBUS_SUCCESS)
- {
+ {
base_path = stat_info->pathname;
/* if we have explicit access on the base path, no need to prune */
if(stat_info->file_only || globus_i_gfs_data_check_path(op->session_handle,
@@ -12082,7 +12080,7 @@ globus_gridftp_server_finished_stat_partial(
char * nam;
char * full_path;
char * slash;
-
+
if(base_path[strlen(base_path) - 1] != '/')
{
slash = "/";
@@ -12096,21 +12094,21 @@ globus_gridftp_server_finished_stat_partial(
nam = stat_array[i].name;
full_path = globus_common_create_string(
"%s%s%s", base_path, slash, nam);
- if(nam && ((nam[0] == '.' &&
+ if(nam && ((nam[0] == '.' &&
(nam[1] == '\0' || (nam[1] == '.' && nam[2] == '\0'))) ||
(globus_i_gfs_data_check_path(op->session_handle,
full_path, NULL, GFS_L_LIST, 0) == GLOBUS_SUCCESS)))
{
memcpy(
- &stat_copy[pruned_stat_count],
+ &stat_copy[pruned_stat_count],
&stat_array[i],
sizeof(globus_gfs_stat_t));
-
- stat_copy[pruned_stat_count].name =
+
+ stat_copy[pruned_stat_count].name =
globus_libc_strdup(stat_array[i].name);
stat_copy[pruned_stat_count].symlink_target =
globus_libc_strdup(stat_array[i].symlink_target);
-
+
pruned_stat_count++;
}
globus_free(full_path);
@@ -12121,7 +12119,7 @@ globus_gridftp_server_finished_stat_partial(
stat_copy[0].nlink = pruned_stat_count;
}
}
-
+
}
else
{
@@ -12143,7 +12141,7 @@ globus_gridftp_server_finished_stat_partial(
bounce_info->stat_count = stat_count;
bounce_info->stat_array = stat_copy;
bounce_info->final_stat = GLOBUS_FALSE;
-
+
result = globus_callback_register_oneshot(
GLOBUS_NULL,
GLOBUS_NULL,
@@ -12158,7 +12156,7 @@ globus_gridftp_server_finished_stat_partial(
globus_mutex_unlock(&op->stat_lock);
globus_poll();
-
+
GlobusGFSDebugExit();
return;
@@ -12185,7 +12183,7 @@ globus_gridftp_server_intermediate_command(
globus_l_gfs_data_alive(op->session_handle);
- bounce = (globus_l_gfs_data_cmd_bounce_t *)
+ bounce = (globus_l_gfs_data_cmd_bounce_t *)
globus_calloc(1, sizeof(globus_l_gfs_data_cmd_bounce_t));
switch(op->command)
@@ -12194,7 +12192,7 @@ globus_gridftp_server_intermediate_command(
bounce->reply.info.command.checksum = globus_libc_strdup(command_data);
bounce->reply.code = 113;
break;
-
+
case GLOBUS_GFS_CMD_HTTP_PUT:
case GLOBUS_GFS_CMD_HTTP_GET:
bounce->reply.info.command.checksum = globus_libc_strdup(command_data);
@@ -12248,7 +12246,7 @@ globus_gridftp_server_finished_stat(
GlobusGFSDebugEnter();
globus_l_gfs_data_alive(op->session_handle);
-
+
globus_mutex_lock(&op->stat_lock);
if(stat_array != NULL && stat_count > 0)
{
@@ -12261,7 +12259,7 @@ globus_gridftp_server_finished_stat(
result = GlobusGFSErrorMemory("stat_copy");
goto error_alloc;
}
-
+
base_path = stat_info->pathname;
/* if we have explicit access on the base path, no need to prune */
if(stat_info->file_only || globus_i_gfs_data_check_path(op->session_handle,
@@ -12293,7 +12291,7 @@ globus_gridftp_server_finished_stat(
char * nam;
char * full_path;
char * slash;
-
+
if(base_path[strlen(base_path) - 1] != '/')
{
slash = "/";
@@ -12307,21 +12305,21 @@ globus_gridftp_server_finished_stat(
nam = stat_array[i].name;
full_path = globus_common_create_string(
"%s%s%s", base_path, slash, nam);
- if(nam && ((nam[0] == '.' &&
+ if(nam && ((nam[0] == '.' &&
(nam[1] == '\0' || (nam[1] == '.' && nam[2] == '\0'))) ||
(globus_i_gfs_data_check_path(op->session_handle,
full_path, NULL, GFS_L_LIST, 0) == GLOBUS_SUCCESS)))
{
memcpy(
- &stat_copy[pruned_stat_count],
+ &stat_copy[pruned_stat_count],
&stat_array[i],
sizeof(globus_gfs_stat_t));
-
- stat_copy[pruned_stat_count].name =
+
+ stat_copy[pruned_stat_count].name =
globus_libc_strdup(stat_array[i].name);
stat_copy[pruned_stat_count].symlink_target =
globus_libc_strdup(stat_array[i].symlink_target);
-
+
pruned_stat_count++;
}
globus_free(full_path);
@@ -12332,7 +12330,7 @@ globus_gridftp_server_finished_stat(
stat_copy[0].nlink = pruned_stat_count;
}
}
-
+
}
else
{
@@ -12354,7 +12352,7 @@ globus_gridftp_server_finished_stat(
bounce_info->stat_count = stat_count;
bounce_info->stat_array = stat_copy;
bounce_info->final_stat = GLOBUS_TRUE;
-
+
result = globus_callback_register_oneshot(
GLOBUS_NULL,
GLOBUS_NULL,
@@ -12477,7 +12475,7 @@ globus_gridftp_server_begin_transfer(
{
GlobusGFSDebugInfo(
"globus_ftp_control_data_connect_read");
-
+
if(op->order_data && op->data_handle->info.mode == 'E')
{
result = globus_ftp_control_set_force_order(
@@ -12748,7 +12746,7 @@ globus_l_gfs_operation_finished_kickout(
if(bounce->finished_info->type == GLOBUS_GFS_OP_SESSION_START)
{
/* update home dir based on restricted paths */
-
+
/* reset home dir to / if chroot. */
if(op->session_handle->chroot_path)
{
@@ -12775,7 +12773,7 @@ globus_l_gfs_operation_finished_kickout(
globus_free(op->session_handle->home_dir);
}
op->session_handle->home_dir = strdup("/");
-
+
bounce->finished_info->info.session.home_dir =
op->session_handle->home_dir;
}
@@ -12861,9 +12859,9 @@ globus_gridftp_server_operation_finished(
break;
case GLOBUS_GFS_OP_STAT:
globus_gridftp_server_finished_stat_partial(
- op,
- result,
- finished_info->info.stat.stat_array,
+ op,
+ result,
+ finished_info->info.stat.stat_array,
finished_info->info.stat.stat_count);
return;
default:
@@ -12881,13 +12879,13 @@ globus_gridftp_server_operation_finished(
finished_info->id = op->id;
finished_info->result = result;
-
+
if(finished_info->msg != NULL)
{
op->user_msg = globus_libc_strdup(finished_info->msg);
}
op->user_code = finished_info->code;
-
+
switch(finished_info->type)
{
case GLOBUS_GFS_OP_RECV:
@@ -12925,23 +12923,23 @@ globus_gridftp_server_operation_finished(
{
globus_free(op->session_handle->home_dir);
}
- op->session_handle->home_dir =
+ op->session_handle->home_dir =
strdup(finished_info->info.session.home_dir);
}
-
+
if(globus_hashtable_empty(&op->session_handle->custom_cmd_table))
{
finished_info->op_info = NULL;
}
- if(op->callback != NULL &&
+ if(op->callback != NULL &&
!globus_hashtable_empty(
&op->session_handle->custom_cmd_table))
{
finished_info->op_info = globus_calloc(1, sizeof(globus_i_gfs_op_info_t));
- finished_info->op_info->custom_command_table =
+ finished_info->op_info->custom_command_table =
op->session_handle->custom_cmd_table;
}
-
+
break;
case GLOBUS_GFS_OP_PASSIVE:
@@ -13071,7 +13069,7 @@ globus_gridftp_server_update_bytes_recvd(
globus_mutex_lock(&op->session_handle->mutex);
{
op->recvd_bytes += length;
-
+
if(op->data_handle->http_handle)
{
op->data_handle->http_transferred += length;
@@ -13119,7 +13117,7 @@ globus_gridftp_server_update_bytes_written(
op->recvd_bytes += length;
globus_range_list_insert(
op->recvd_ranges, offset + op->transfer_delta, length);
-
+
if(op->data_handle->http_handle)
{
op->data_handle->http_transferred += length;
@@ -13144,9 +13142,9 @@ globus_gridftp_server_get_optimal_concurrency(
return;
}
if(!op->writing)
- {
+ {
globus_mutex_lock(&op->session_handle->mutex);
- if(op->data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_INUSE &&
+ if(op->data_handle->state == GLOBUS_L_GFS_DATA_HANDLE_INUSE &&
op->data_handle->is_mine)
{
unsigned int num_streams;
@@ -13353,7 +13351,7 @@ globus_gridftp_server_query_op_info(
{
globus_result_t res = GLOBUS_SUCCESS;
va_list ap;
-
+
char *** argv;
int * argc;
GlobusGFSName(globus_gridftp_server_query_op_info);
@@ -13374,16 +13372,16 @@ globus_gridftp_server_query_op_info(
case GLOBUS_GFS_OP_INFO_CMD_ARGS:
argv = va_arg(ap, char ***);
argc = va_arg(ap, int *);
-
+
*argv = op_info->argv;
*argc = op_info->argc;
break;
-
+
default:
res = GlobusGFSErrorGeneric("Invalid query parameter.");
break;
}
-
+
va_end(ap);
if(res != GLOBUS_SUCCESS)
@@ -13397,7 +13395,7 @@ globus_gridftp_server_query_op_info(
err:
GlobusGFSDebugExitWithError();
return res;
-}
+}
globus_result_t
globus_gridftp_server_set_checksum_support(
@@ -13441,7 +13439,7 @@ globus_gridftp_server_add_command(
result = GlobusGFSErrorGeneric("Invalid cmd_id.");;
goto err;
}
-
+
if(op->session_handle->custom_cmd_table == NULL)
{
globus_hashtable_init(
@@ -13450,10 +13448,10 @@ globus_gridftp_server_add_command(
globus_hashtable_string_hash,
globus_hashtable_string_keyeq);
}
-
+
cmd_ent = (globus_i_gfs_cmd_ent_t *)
globus_calloc(1, sizeof(globus_i_gfs_cmd_ent_t));
-
+
cmd_ent->cmd_name = globus_libc_strdup(command_name);
ptr = cmd_ent->cmd_name;
while(ptr && *ptr)
@@ -13467,7 +13465,7 @@ globus_gridftp_server_add_command(
cmd_ent->help_str = globus_libc_strdup(help_string);
cmd_ent->has_pathname = has_pathname;
cmd_ent->access_type = access_type;
-
+
rc = globus_hashtable_insert(
&op->session_handle->custom_cmd_table, cmd_ent->cmd_name, cmd_ent);
@@ -13476,15 +13474,15 @@ globus_gridftp_server_add_command(
result = GlobusGFSErrorGeneric("Could not store command entry.");
goto err;
}
-
- GlobusGFSDebugExit();
+
+ GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
-
+
err:
- GlobusGFSDebugExitWithError();
+ GlobusGFSDebugExitWithError();
return result;
}
-
+
/* this is used to translate the restart and partial offset/lengths into
a sets of ranges to transfer... storage interface shouldn't know about
@@ -13503,7 +13501,6 @@ globus_gridftp_server_get_write_range(
globus_off_t tmp_len = -1;
globus_off_t tmp_write = 0;
globus_off_t tmp_transfer = 0;
- int rc;
GlobusGFSName(globus_gridftp_server_get_write_range);
GlobusGFSDebugEnter();
@@ -13511,7 +13508,7 @@ globus_gridftp_server_get_write_range(
if(globus_range_list_size(op->range_list))
{
- rc = globus_range_list_remove_at(
+ globus_range_list_remove_at(
op->range_list,
0,
&tmp_off,
@@ -13551,7 +13548,6 @@ globus_gridftp_server_get_read_range(
globus_off_t tmp_off = 0;
globus_off_t tmp_len = -1;
globus_off_t tmp_write = 0;
- int rc;
globus_off_t start_offset;
globus_off_t end_offset;
globus_off_t stripe_block_size;
@@ -13561,9 +13557,9 @@ globus_gridftp_server_get_read_range(
globus_off_t part_size;
GlobusGFSName(globus_gridftp_server_get_read_range);
GlobusGFSDebugEnter();
-
+
globus_l_gfs_data_alive(op->session_handle);
-
+
/* this whole function is crazy ugly and inneffiecient...
needs rethinking */
globus_mutex_lock(&op->session_handle->mutex);
@@ -13604,7 +13600,7 @@ globus_gridftp_server_get_read_range(
if(globus_range_list_size(op->stripe_range_list))
{
- rc = globus_range_list_remove_at(
+ globus_range_list_remove_at(
op->stripe_range_list,
0,
&tmp_off,
@@ -13616,7 +13612,7 @@ globus_gridftp_server_get_read_range(
{
for(i = 0; i < size; i++)
{
- rc = globus_range_list_at(
+ globus_range_list_at(
op->range_list,
i,
&tmp_off,
@@ -13656,7 +13652,7 @@ globus_gridftp_server_get_read_range(
if(globus_range_list_size(op->stripe_range_list))
{
- rc = globus_range_list_remove_at(
+ globus_range_list_remove_at(
op->stripe_range_list,
0,
&tmp_off,
@@ -13678,7 +13674,7 @@ globus_gridftp_server_get_read_range(
}
else if(globus_range_list_size(op->range_list))
{
- rc = globus_range_list_remove_at(
+ globus_range_list_remove_at(
op->range_list,
0,
&tmp_off,
@@ -13733,7 +13729,7 @@ globus_result_t
globus_gridftp_server_get_recv_modification_time(
globus_gfs_operation_t op,
time_t * out_time)
-{
+{
globus_result_t result;
time_t tmp_time = -1;
GlobusGFSName(globus_gridftp_server_get_recv_modification_time);
@@ -13744,13 +13740,13 @@ globus_gridftp_server_get_recv_modification_time(
result = GlobusGFSErrorGeneric("Invalid parameters.");
goto error;
}
-
+
if(op->storattr && op->storattr->modify)
{
char* tz;
struct tm modtime;
memset(&modtime, 0, sizeof(modtime));
- if (sscanf(op->storattr->modify, "%4d%2d%2d%2d%2d%2d",
+ if (sscanf(op->storattr->modify, "%4d%2d%2d%2d%2d%2d",
&modtime.tm_year, &modtime.tm_mon, &modtime.tm_mday,
&modtime.tm_hour, &modtime.tm_min, &modtime.tm_sec) != 6)
{
@@ -13771,11 +13767,11 @@ globus_gridftp_server_get_recv_modification_time(
else
globus_libc_unsetenv("TZ");
tzset();
-
+
op->storattr->modify_seen = GLOBUS_TRUE;
}
*out_time = tmp_time;
-
+
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
@@ -13784,8 +13780,8 @@ globus_gridftp_server_get_recv_modification_time(
*out_time = -1;
return result;
}
-
-
+
+
globus_result_t
globus_gridftp_server_get_recv_attr_string(
@@ -13804,7 +13800,7 @@ globus_gridftp_server_get_recv_attr_string(
result = GlobusGFSErrorGeneric("Invalid parameters.");
goto error;
}
-
+
if(op->storattr)
{
if(requested_attr)
@@ -13838,7 +13834,7 @@ globus_gridftp_server_get_recv_attr_string(
}
}
*out_value = tmp_val;
-
+
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
@@ -13846,7 +13842,7 @@ globus_gridftp_server_get_recv_attr_string(
GlobusGFSDebugExitWithError();
return result;
}
-
+
globus_result_t
globus_gridftp_server_register_read(
@@ -14046,7 +14042,7 @@ globus_gridftp_server_finished_session_start(
finished_info.info.session.home_dir = home_dir;
/* pull response code from error */
- if(result != GLOBUS_SUCCESS &&
+ if(result != GLOBUS_SUCCESS &&
(code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) != 0)
{
@@ -14084,7 +14080,7 @@ globus_gridftp_server_finished_active_data(
finished_info.info.data.bi_directional = bi_directional;
/* pull response code from error */
- if(result != GLOBUS_SUCCESS &&
+ if(result != GLOBUS_SUCCESS &&
(code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) != 0)
{
@@ -14126,7 +14122,7 @@ globus_gridftp_server_finished_passive_data(
finished_info.info.data.cs_count = cs_count;
/* pull response code from error */
- if(result != GLOBUS_SUCCESS &&
+ if(result != GLOBUS_SUCCESS &&
(code = globus_gfs_error_get_ftp_response_code(
globus_error_peek(result))) != 0)
{
@@ -14155,7 +14151,7 @@ globus_i_gfs_data_request_set_cred(
session_handle = (globus_l_gfs_data_session_t *) session_arg;
globus_l_gfs_data_reset_watchdog(session_handle, NULL);
-
+
if(del_cred != NULL)
{
session_handle->del_cred = del_cred;
@@ -14186,7 +14182,7 @@ globus_i_gfs_data_request_buffer_send(
session_handle = (globus_l_gfs_data_session_t *) session_arg;
globus_l_gfs_data_reset_watchdog(session_handle, NULL);
-
+
if(buffer_type & GLOBUS_GFS_BUFFER_SERVER_DEFINED)
{
switch(buffer_type)
@@ -14215,11 +14211,11 @@ globus_i_gfs_data_request_buffer_send(
void
globus_i_gfs_data_http_read_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t length,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg)
{
@@ -14232,11 +14228,11 @@ globus_i_gfs_data_http_read_cb(
offset = bounce_info->op->bytes_transferred;
bounce_info->op->bytes_transferred += nbytes;
-
+
eof = globus_xio_error_is_eof(result);
if(eof)
- {
- if(bounce_info->op->bytes_transferred <
+ {
+ if(bounce_info->op->bytes_transferred <
bounce_info->op->data_handle->http_length)
{
result = GlobusGFSErrorGeneric(
@@ -14247,7 +14243,7 @@ globus_i_gfs_data_http_read_cb(
result = GLOBUS_SUCCESS;
}
}
- if(bounce_info->op->bytes_transferred >
+ if(bounce_info->op->bytes_transferred >
bounce_info->op->data_handle->http_length)
{
result = GlobusGFSErrorGeneric(
@@ -14271,11 +14267,11 @@ globus_i_gfs_data_http_read_cb(
void
globus_i_gfs_data_http_write_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t length,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg)
{
@@ -14316,9 +14312,9 @@ globus_l_gfs_data_http_perf(
void * arg)
{
globus_l_gfs_data_operation_t * op;
-
+
op = (globus_l_gfs_data_operation_t *) arg;
-
+
if(op->data_handle)
{
globus_gfs_event_info_t event_reply;
@@ -14350,14 +14346,14 @@ globus_l_gfs_data_http_transfer_cb(
globus_mutex_unlock(&op->session_handle->mutex);
globus_assert(!destroy_op);
}
-
+
if(op->data_handle->perf_handle != GLOBUS_NULL_HANDLE)
{
globus_callback_unregister(
op->data_handle->perf_handle, NULL, NULL, NULL);
op->data_handle->perf_handle = GLOBUS_NULL_HANDLE;
}
-
+
globus_xio_close(op->data_handle->http_handle, NULL);
globus_libc_unsetenv("GLOBUS_GFS_EXTRA_CA_CERTS");
@@ -14369,7 +14365,7 @@ globus_l_gfs_data_http_transfer_cb(
{
char * count;
globus_mutex_lock(&op->session_handle->mutex);
- {
+ {
count = globus_common_create_string("%"GLOBUS_OFF_T_FORMAT,
op->data_handle->http_transferred);
op->data_handle->http_transferred = 0;
@@ -14393,7 +14389,7 @@ globus_l_gfs_data_http_event_cb(
globus_result_t result = GLOBUS_SUCCESS;
char * count;
globus_l_gfs_data_operation_t * op;
-
+
GlobusGFSName(globus_l_gfs_data_http_event_cb);
GlobusGFSDebugEnter();
@@ -14403,7 +14399,7 @@ globus_l_gfs_data_http_event_cb(
{
case GLOBUS_GFS_EVENT_TRANSFER_BEGIN:
globus_gridftp_server_intermediate_command(op, result, "0");
-
+
if(op->data_handle->perf_handle == GLOBUS_NULL_HANDLE)
{
globus_reltime_t timer;
@@ -14416,16 +14412,16 @@ globus_l_gfs_data_http_event_cb(
(void *) op);
}
break;
-
+
case GLOBUS_GFS_EVENT_TRANSFER_CONNECTED:
break;
-
+
case GLOBUS_GFS_EVENT_DISCONNECTED:
break;
-
+
case GLOBUS_GFS_EVENT_BYTES_RECVD:
globus_mutex_lock(&op->session_handle->mutex);
- {
+ {
count = globus_common_create_string("%"GLOBUS_OFF_T_FORMAT,
op->data_handle->http_transferred);
}
@@ -14435,10 +14431,10 @@ globus_l_gfs_data_http_event_cb(
globus_free(count);
break;
-
+
case GLOBUS_GFS_EVENT_RANGES_RECVD:
break;
-
+
default:
globus_assert(0 && "Unexpected event type");
break;
@@ -14466,7 +14462,7 @@ globus_i_gfs_data_http_parse_args(
int tmp_consume;
GlobusGFSName(globus_i_gfs_data_http_parse_args);
GlobusGFSDebugEnter();
-
+
if((tmp_val = globus_i_gfs_kv_getval(argstring, "OFFSET", 0)) == NULL)
{
result = GlobusGFSErrorGeneric(
@@ -14480,7 +14476,7 @@ globus_i_gfs_data_http_parse_args(
"Invalid arguments: Invalid OFFSET.");
goto err;
}
-
+
if((tmp_val = globus_i_gfs_kv_getval(argstring, "LENGTH", 0)) == NULL)
{
result = GlobusGFSErrorGeneric(
@@ -14515,7 +14511,7 @@ globus_i_gfs_data_http_parse_args(
*length = tmp_len;
*request = tmp_req;
*path = tmp_path;
-
+
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
@@ -14553,7 +14549,7 @@ globus_i_gfs_data_http_init(
globus_l_gfs_data_session_t * session_handle,
globus_bool_t https,
globus_xio_handle_t * handle,
- globus_xio_attr_t * attr,
+ globus_xio_attr_t * attr,
globus_xio_data_descriptor_t * descriptor)
{
globus_result_t result;
@@ -14583,7 +14579,7 @@ globus_i_gfs_data_http_init(
if(!session_handle->http_stack)
{
globus_xio_stack_init(&session_handle->http_stack, NULL);
-
+
result = globus_xio_stack_push_driver(
session_handle->http_stack,
gfs_l_tcp_driver);
@@ -14600,7 +14596,7 @@ globus_i_gfs_data_http_init(
if(!session_handle->https_stack)
{
globus_xio_stack_init(&session_handle->https_stack, NULL);
-
+
result = globus_xio_stack_push_driver(
session_handle->https_stack,
gfs_l_tcp_driver);
@@ -14630,7 +14626,7 @@ globus_i_gfs_data_http_init(
result = globus_xio_handle_create(
handle, session_handle->http_stack);
}
-
+
globus_assert(result == GLOBUS_SUCCESS);
}
if(attr)
@@ -14646,25 +14642,25 @@ globus_i_gfs_data_http_init(
if(https)
{
result = globus_xio_attr_cntl(
- *attr,
- gfs_l_gsi_driver,
+ *attr,
+ gfs_l_gsi_driver,
GLOBUS_XIO_GSI_SET_SSL_COMPATIBLE,
GLOBUS_TRUE);
globus_assert(result == GLOBUS_SUCCESS);
result = globus_xio_attr_cntl(
- *attr,
- gfs_l_gsi_driver,
+ *attr,
+ gfs_l_gsi_driver,
GLOBUS_XIO_GSI_SET_PROTECTION_LEVEL,
GLOBUS_XIO_GSI_PROTECTION_LEVEL_PRIVACY);
globus_assert(result == GLOBUS_SUCCESS);
result = globus_xio_attr_cntl(
- *attr,
- gfs_l_gsi_driver,
+ *attr,
+ gfs_l_gsi_driver,
GLOBUS_XIO_GSI_SET_ANON);
globus_assert(result == GLOBUS_SUCCESS);
result = globus_xio_attr_cntl(
- *attr,
- gfs_l_gsi_driver,
+ *attr,
+ gfs_l_gsi_driver,
GLOBUS_XIO_GSI_SET_ALLOW_MISSING_SIGNING_POLICY,
GLOBUS_TRUE);
globus_assert(result == GLOBUS_SUCCESS);
@@ -14674,7 +14670,7 @@ globus_i_gfs_data_http_init(
}
else if(session_handle->http_ca_certs)
{
- globus_libc_setenv("GLOBUS_GFS_EXTRA_CA_CERTS",
+ globus_libc_setenv("GLOBUS_GFS_EXTRA_CA_CERTS",
session_handle->http_ca_certs, 1);
}
}
@@ -14682,7 +14678,7 @@ globus_i_gfs_data_http_init(
result = globus_xio_data_descriptor_init(descriptor, *handle);
globus_assert(result == GLOBUS_SUCCESS);
-
+
GlobusGFSDebugExit();
return GLOBUS_SUCCESS;
}
@@ -14695,7 +14691,7 @@ globus_i_gfs_http_data_parse_request(
globus_bool_t * https,
int * http_ver,
char ** method,
- globus_xio_http_header_t ** headers,
+ globus_xio_http_header_t ** headers,
int * count)
{
globus_result_t res;
@@ -14725,11 +14721,11 @@ globus_i_gfs_http_data_parse_request(
res = GlobusGFSErrorGeneric("Could not decode.");
goto err;
}
-
+
res = -1;
-
- /*
- parse from
+
+ /*
+ parse from
VERB {http|https}://hostname[:port]/url-encoded-path[?qs] HTTP/1.1\r\n
*/
line = d_req;
@@ -14746,7 +14742,7 @@ globus_i_gfs_http_data_parse_request(
goto err;
}
*ptr++ = 0;
- tmp_method = strdup(line);
+ tmp_method = strdup(line);
tmp_url = strdup(ptr);
ptr = strchr(tmp_url, ' ');
if(!ptr)
@@ -14759,7 +14755,7 @@ globus_i_gfs_http_data_parse_request(
{
tmp_ver = GLOBUS_XIO_HTTP_VERSION_1_1;
}
-
+
tmp_headers = globus_malloc(cnt * sizeof(globus_xio_http_header_t));
/* parse headers
Header-1: foo \r\n
@@ -14781,7 +14777,7 @@ globus_i_gfs_http_data_parse_request(
*ptr = 0;
next_line = ptr + 2;
}
-
+
ptr = strchr(line, ':');
if(!ptr)
{
@@ -14793,19 +14789,19 @@ globus_i_gfs_http_data_parse_request(
ptr++;
tmp_hname = strdup(line);
tmp_hval = strdup(ptr);
-
+
if(i >= cnt)
{
cnt += 20;
tmp_headers = globus_realloc(
tmp_headers, cnt * sizeof(globus_xio_http_header_t));
}
-
+
tmp_headers[i].name = tmp_hname;
tmp_headers[i].value = tmp_hval;
i++;
-
-
+
+
line = next_line;
}
@@ -14817,7 +14813,7 @@ globus_i_gfs_http_data_parse_request(
{
*https = GLOBUS_FALSE;
}
-
+
/* find third / in scheme://host/ to get path */
ptr = strchr(tmp_url, '/');
if(!ptr)
@@ -14839,7 +14835,7 @@ globus_i_gfs_http_data_parse_request(
res = GlobusGFSErrorGeneric("Invalid URI.");
goto err;
}
-
+
/* urlencode path in because xio will decode it */
enc_path = globus_url_string_hex_encode(ptr, "<>:@");
*ptr = 0;
@@ -14850,20 +14846,20 @@ globus_i_gfs_http_data_parse_request(
*count = i;
*method = tmp_method;
*http_ver = tmp_ver;
-
+
globus_free(tmp_url);
globus_free(d_req);
GlobusGFSDebugExit();
-
+
return GLOBUS_SUCCESS;
err:
GlobusGFSDebugExitWithError();
- return res;
+ return res;
}
-globus_result_t
+globus_result_t
globus_i_gfs_data_http_get(
globus_l_gfs_data_operation_t * op,
char * path,
@@ -14896,7 +14892,7 @@ globus_i_gfs_data_http_get(
char * ptr;
GlobusGFSName(globus_l_gfs_data_http_get);
GlobusGFSDebugEnter();
-
+
/* parse url, headers */
result = globus_i_gfs_http_data_parse_request(
request, &url, &https, &http_ver, &method, &headers, &count);
@@ -14905,7 +14901,7 @@ globus_i_gfs_data_http_get(
result = GlobusGFSErrorWrapFailed("Invalid request. Parsing", result);
goto response_exit;
}
-
+
handle = op->session_handle->http_handle;
result = globus_i_gfs_data_http_init(op->session_handle,
https, &handle, &attr, &descriptor);
@@ -14913,7 +14909,7 @@ globus_i_gfs_data_http_get(
{
goto response_exit;
}
-
+
result = globus_xio_attr_cntl(
attr,
op->session_handle->http_driver,
@@ -14933,8 +14929,8 @@ globus_i_gfs_data_http_get(
{
goto response_exit;
}
-
- /* set individual headers */
+
+ /* set individual headers */
for (i = 0; i < count; i++)
{
result = globus_xio_attr_cntl(
@@ -14954,9 +14950,9 @@ globus_i_gfs_data_http_get(
{
retry = do_retry && (globus_error_get_type(globus_error_peek(result)) ==
GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED);
-
+
if(!retry)
- {
+ {
result = GlobusGFSErrorWrapFailed("HTTP connection", result);
goto response_exit;
}
@@ -14990,7 +14986,7 @@ globus_i_gfs_data_http_get(
{
*ptr = '\0';
}
-
+
/* read response, no data */
result = globus_xio_read(
handle,
@@ -15009,7 +15005,7 @@ globus_i_gfs_data_http_get(
result = GLOBUS_SUCCESS;
}
}
-
+
if(retry)
{
globus_xio_close(op->session_handle->http_handle, NULL);
@@ -15030,7 +15026,7 @@ globus_i_gfs_data_http_get(
return globus_i_gfs_data_http_get(
op, path, request, offset, length, GLOBUS_FALSE);
}
-
+
if(result != GLOBUS_SUCCESS)
{
result = GlobusGFSErrorWrapFailed("Before getting response, HTTP connection", result);
@@ -15090,9 +15086,9 @@ globus_i_gfs_data_http_get(
else
{
waitfor = GLOBUS_MIN(1024, buflen-total_nbytes);
- }
+ }
} while(!eof);
-
+
body_buffer[total_nbytes] = '\0';
globus_i_gfs_data_http_print_response(
status_code, &header_table, body_buffer, &header_str);
@@ -15104,7 +15100,7 @@ globus_i_gfs_data_http_get(
header_str);
result = GlobusGFSErrorGeneric(err_str);
-
+
globus_free(err_str);
globus_free(header_str);
globus_free(body_buffer);
@@ -15115,10 +15111,10 @@ globus_i_gfs_data_http_get(
{
globus_i_gfs_data_http_print_response(
status_code, &header_table, NULL, &op->user_msg);
- }
-
-
- /* set up internal file recv request */
+ }
+
+
+ /* set up internal file recv request */
recv_info = (globus_gfs_transfer_info_t *)
globus_calloc(1, sizeof(globus_gfs_transfer_info_t));
recv_info->alloc_size = length;
@@ -15148,7 +15144,7 @@ globus_i_gfs_data_http_get(
&data_handle->session_handle->handle_table,
data_handle,
1);
-
+
data_handle->http_handle = handle;
data_handle->http_length = length;
data_handle->http_ip = globus_libc_strdup(op->http_ip);
@@ -15163,8 +15159,8 @@ globus_i_gfs_data_http_get(
globus_l_gfs_data_http_transfer_cb,
globus_l_gfs_data_http_event_cb,
op);
-
-
+
+
return GLOBUS_SUCCESS;
open_exit:
@@ -15173,10 +15169,10 @@ globus_i_gfs_data_http_get(
GlobusGFSDebugExit();
return result;
-
+
}
-globus_result_t
+globus_result_t
globus_i_gfs_data_http_put(
globus_l_gfs_data_operation_t * op,
char * path,
@@ -15209,7 +15205,7 @@ globus_i_gfs_data_http_put(
char * ptr;
GlobusGFSName(globus_l_gfs_data_http_put);
GlobusGFSDebugEnter();
-
+
/* parse url, headers */
result = globus_i_gfs_http_data_parse_request(
request, &url, &https, &http_ver, &method, &headers, &count);
@@ -15226,7 +15222,7 @@ globus_i_gfs_data_http_put(
{
goto response_exit;
}
-
+
result = globus_xio_attr_cntl(
attr,
op->session_handle->http_driver,
@@ -15246,8 +15242,8 @@ globus_i_gfs_data_http_put(
{
goto response_exit;
}
-
- /* set individual headers */
+
+ /* set individual headers */
for (i = 0; i < count; i++)
{
result = globus_xio_attr_cntl(
@@ -15289,7 +15285,7 @@ globus_i_gfs_data_http_put(
goto response_exit;
}
}
-
+
result = globus_xio_open(handle, url, attr);
if(result != GLOBUS_SUCCESS)
{
@@ -15327,7 +15323,7 @@ globus_i_gfs_data_http_put(
result = GLOBUS_SUCCESS;
}
}
-
+
if(retry)
{
globus_xio_close(op->session_handle->http_handle, NULL);
@@ -15347,7 +15343,7 @@ globus_i_gfs_data_http_put(
return globus_i_gfs_data_http_put(
op, path, request, offset, length, GLOBUS_FALSE);
}
-
+
if(result != GLOBUS_SUCCESS)
{
result = GlobusGFSErrorWrapFailed("Before getting response, HTTP connection", result);
@@ -15376,7 +15372,7 @@ globus_i_gfs_data_http_put(
globus_size_t total_nbytes = 0;
globus_bool_t eof;
globus_size_t waitfor = 0;
-
+
body_buffer = malloc(buflen+1);
do
{
@@ -15399,7 +15395,7 @@ globus_i_gfs_data_http_put(
eof = GLOBUS_TRUE;
}
total_nbytes += body_nbytes;
-
+
if(body_nbytes == 0 || total_nbytes == buflen)
{
eof = GLOBUS_TRUE;
@@ -15407,25 +15403,25 @@ globus_i_gfs_data_http_put(
else
{
waitfor = GLOBUS_MIN(1024, buflen-total_nbytes);
- }
+ }
} while(!eof);
-
+
body_buffer[total_nbytes] = '\0';
globus_i_gfs_data_http_print_response(
status_code, &header_table, body_buffer, &header_str);
-
+
err_str = globus_common_create_string(
"HTTP PUT failed with \"%03d %s\"\n%s",
status_code,
reason_phrase,
header_str);
-
+
result = GlobusGFSErrorGeneric(err_str);
-
+
globus_free(err_str);
globus_free(header_str);
globus_free(body_buffer);
-
+
goto open_exit;
}
}
@@ -15460,12 +15456,12 @@ globus_i_gfs_data_http_put(
&data_handle->session_handle->handle_table,
data_handle,
1);
-
+
data_handle->http_handle = handle;
data_handle->http_length = length;
data_handle->http_ip = globus_libc_strdup(op->http_ip);
op->data_handle = data_handle;
-
+
op->ref++;
globus_i_gfs_data_request_send(
NULL,
@@ -15475,11 +15471,11 @@ globus_i_gfs_data_http_put(
globus_l_gfs_data_http_transfer_cb,
globus_l_gfs_data_http_event_cb,
op);
-
-
+
+
return GLOBUS_SUCCESS;
-open_exit:
+open_exit:
response_exit:
GlobusGFSDebugExit();
return result;
diff --git a/gridftp/server/src/globus_i_gfs_default_brain.c b/gridftp/server/src/globus_i_gfs_default_brain.c
index d476d224d6..ae456da66e 100644
--- a/gridftp/server/src/globus_i_gfs_default_brain.c
+++ b/gridftp/server/src/globus_i_gfs_default_brain.c
@@ -84,7 +84,7 @@ gfs_l_db_node_cmp(
}
/* if the total number of connections is capped and we have exceded
the cap send it to the back */
- if(n1->total_max_connections > 0
+ if(n1->total_max_connections > 0
&& n1->total_connections >= n1->total_max_connections)
{
return 1;
@@ -121,7 +121,7 @@ gfs_l_db_parse_string_list(
{
return NULL;
}
-
+
tmp_str = globus_libc_strdup(str_list);
last_str = tmp_str;
while((p = strchr(last_str, ',')) != NULL)
@@ -131,7 +131,7 @@ gfs_l_db_parse_string_list(
last_str = p + 1;
}
globus_list_insert(&list, strdup(last_str));
-
+
globus_free(tmp_str);
return list;
@@ -156,7 +156,7 @@ globus_l_brain_log_socket(
{
peer_contact = strdup("could get peer addr");
}
-
+
globus_gfs_log_message(
GLOBUS_GFS_LOG_WARN,
"[%s] %s", peer_contact, msg);
@@ -242,7 +242,7 @@ globus_l_gfs_gfork_dyn_reg(
repo = (gfs_l_db_repo_t *) calloc(1, sizeof(gfs_l_db_repo_t));
globus_priority_q_init(&repo->node_q, gfs_l_db_node_cmp);
globus_hashtable_init(
- &repo->node_table,
+ &repo->node_table,
32,
globus_hashtable_string_hash,
globus_hashtable_string_keyeq);
@@ -257,7 +257,7 @@ globus_l_gfs_gfork_dyn_reg(
}
if(node == NULL)
- {
+ {
node = (gfs_l_db_node_t*)globus_calloc(1, sizeof(gfs_l_db_node_t));
node->host_id = strdup(cs);
node->cookie_id = cookie_id;
@@ -326,7 +326,6 @@ globus_l_gfs_mem_limit_release_cb(
void * user_arg)
{
globus_xio_iovec_t iov[1];
- globus_result_t result;
globus_byte_t * buffer;
uint32_t tmp32;
@@ -343,7 +342,7 @@ globus_l_gfs_mem_limit_release_cb(
iov[0].iov_base = buffer;
iov[0].iov_len = GF_RELEASE_MSG_LEN;
- result = globus_gfork_send(
+ globus_gfork_send(
globus_l_gfs_gfork_handle,
-1, /* to the master */
iov,
@@ -407,14 +406,14 @@ globus_l_gfs_gfork_incoming_cb(
{
globus_gfs_log_message(
GLOBUS_GFS_LOG_ERR,
- "[%s] error in dyn reg size\n",
+ "[%s] error in dyn reg size\n",
"globus_l_gfs_gfork_incoming_cb()");
}
else
{
globus_gfs_log_message(
GLOBUS_GFS_LOG_INFO,
- "[%s] registering a new backend %d\n",
+ "[%s] registering a new backend %d\n",
"globus_l_gfs_gfork_incoming_cb()",
n32);
globus_l_gfs_gfork_dyn_reg(
@@ -476,9 +475,9 @@ globus_l_gfs_gfork_incoming_cb(
default:
globus_gfs_log_message(
- GLOBUS_GFS_LOG_WARN,
+ GLOBUS_GFS_LOG_WARN,
"Unknown GFork message type received.\n");
- break;
+ break;
}
}
globus_mutex_unlock(&globus_l_brain_mutex);
@@ -520,7 +519,7 @@ globus_l_gfs_default_brain_init(
GFS_DB_REPO_SIZE,
globus_hashtable_string_hash,
globus_hashtable_string_keyeq);
-
+
remote_list = globus_i_gfs_config_string("remote_nodes");
list = gfs_l_db_parse_string_list(remote_list);
@@ -531,7 +530,7 @@ globus_l_gfs_default_brain_init(
globus_priority_q_init(&default_repo->node_q, gfs_l_db_node_cmp);
globus_hashtable_init(
- &gfs_l_db_default_repo->node_table,
+ &gfs_l_db_default_repo->node_table,
32,
globus_hashtable_string_hash,
globus_hashtable_string_keyeq);
@@ -574,7 +573,7 @@ globus_l_gfs_default_brain_init(
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_result(
- GLOBUS_GFS_LOG_DUMP,
+ GLOBUS_GFS_LOG_DUMP,
"GFork functionality not enabled.",
result);
@@ -615,7 +614,7 @@ globus_l_gfs_default_brain_available(
int * count)
{
int size;
-
+
size = globus_priority_q_size(&gfs_l_db_default_repo->node_q);
*count = size;
@@ -690,7 +689,7 @@ globus_l_gfs_default_brain_select_nodes(
}
count = 0;
e_count = count;
-
+
do
{
loop_count = 0;
@@ -709,7 +708,7 @@ globus_l_gfs_default_brain_select_nodes(
else if(
(node->current_connection >= node->max_connection &&
node->max_connection < 0) ||
- (node->total_max_connections > 0 &&
+ (node->total_max_connections > 0 &&
node->total_connections >= node->total_max_connections))
{
/* need to up everything for sake of nice clean up*/
@@ -733,8 +732,8 @@ globus_l_gfs_default_brain_select_nodes(
GlobusGFSErrorObjParameter("No nodes available."));
goto error_short;
}
-
- /* if we are here we were successful and must re-enqueue the nodes
+
+ /* if we are here we were successful and must re-enqueue the nodes
* we just took out with new order */
for(i = count - loop_count; i < count; i++)
{
diff --git a/gridftp/server/src/modules/file/globus_gridftp_server_file.c b/gridftp/server/src/modules/file/globus_gridftp_server_file.c
index 2ce4c7fae5..3605836441 100644
--- a/gridftp/server/src/modules/file/globus_gridftp_server_file.c
+++ b/gridftp/server/src/modules/file/globus_gridftp_server_file.c
@@ -58,7 +58,7 @@ GlobusDebugDeclare(GLOBUS_GRIDFTP_SERVER_FILE);
GlobusGFSFileDebugPrintf( \
GLOBUS_GFS_DEBUG_TRACE, \
("[%s] Entering\n", _gfs_name))
-
+
#define GlobusGFSFileDebugExit() \
GlobusGFSFileDebugPrintf( \
GLOBUS_GFS_DEBUG_TRACE, \
@@ -98,7 +98,7 @@ typedef struct globus_l_gfs_file_cksm_monitor_s
globus_size_t block_size;
globus_l_gfs_file_cksm_cb_t internal_cb;
void * internal_cb_arg;
-
+
globus_callback_handle_t marker_handle;
int marker_freq;
globus_bool_t send_marker;
@@ -116,7 +116,7 @@ typedef struct globus_l_gfs_file_cksm_monitor_s
globus_byte_t buffer[];
} globus_l_gfs_file_cksm_monitor_t;
-typedef struct
+typedef struct
{
gss_cred_id_t cred;
char * sbj;
@@ -190,7 +190,7 @@ globus_l_gfs_file_cksm(
globus_off_t length,
globus_l_gfs_file_cksm_cb_t internal_cb,
void * internal_cb_arg);
-
+
static
globus_result_t
globus_l_gfs_file_make_stack(
@@ -279,7 +279,7 @@ globus_l_gfs_file_make_stack(
* else if priority_1 comes before priority_2, return < 0
* else return 0
*/
-
+
static
int
globus_l_gfs_file_queue_compare(
@@ -294,7 +294,7 @@ globus_l_gfs_file_queue_compare(
buf_info1 = (globus_l_buffer_info_t *) priority_1;
buf_info2 = (globus_l_buffer_info_t *) priority_2;
-
+
/* the void * are really just offsets */
if(buf_info1->offset > buf_info2->offset)
{
@@ -304,7 +304,7 @@ globus_l_gfs_file_queue_compare(
{
rc = -1;
}
-
+
GlobusGFSFileDebugExit();
return rc;
}
@@ -321,7 +321,7 @@ globus_l_gfs_file_monitor_init(
int rc;
GlobusGFSName(globus_l_gfs_file_monitor_init);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) globus_malloc(
sizeof(globus_l_file_monitor_t));
if(!monitor)
@@ -329,15 +329,15 @@ globus_l_gfs_file_monitor_init(
result = GlobusGFSErrorMemory("monitor");
goto error_alloc;
}
-
+
rc = globus_memory_init(&monitor->mem, block_size, optimal_count);
if(!rc)
{
globus_free(monitor);
result = GlobusGFSErrorMemory("buffer");
goto error_alloc;
- }
-
+ }
+
globus_mutex_init(&monitor->lock, NULL);
globus_priority_q_init(
&monitor->queue, globus_l_gfs_file_queue_compare);
@@ -360,7 +360,7 @@ globus_l_gfs_file_monitor_init(
monitor->pathname = NULL;
*u_monitor = monitor;
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
@@ -379,7 +379,7 @@ globus_l_gfs_file_monitor_destroy(
globus_byte_t * buffer;
GlobusGFSName(globus_l_gfs_file_monitor_destroy);
GlobusGFSFileDebugEnter();
-
+
while(!globus_priority_q_empty(&monitor->queue))
{
buf_info = (globus_l_buffer_info_t *)
@@ -393,7 +393,7 @@ globus_l_gfs_file_monitor_destroy(
globus_free(buf_info);
}
}
-
+
for(list = monitor->buffer_list;
!globus_list_empty(list);
list = globus_list_rest(list))
@@ -401,12 +401,12 @@ globus_l_gfs_file_monitor_destroy(
buffer = (globus_byte_t *) globus_list_first(list);
globus_memory_push_node(&monitor->mem, buffer);
}
-
+
if(monitor->pathname)
{
globus_free(monitor->pathname);
}
-
+
if(monitor->expected_cksm)
{
globus_free(monitor->expected_cksm);
@@ -415,7 +415,7 @@ globus_l_gfs_file_monitor_destroy(
{
globus_free(monitor->expected_cksm_alg);
}
-
+
globus_priority_q_destroy(&monitor->queue);
globus_list_free(monitor->buffer_list);
globus_memory_destroy(&monitor->mem);
@@ -436,12 +436,12 @@ globus_l_gfs_file_cksm_verify(
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_cksm_verify);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
-
+
if(result != GLOBUS_SUCCESS)
{
- monitor->finish_result =
+ monitor->finish_result =
GlobusGFSErrorWrapFailed("checksum verification", result);
}
else if(strcmp(monitor->expected_cksm, cksm) != 0)
@@ -452,13 +452,13 @@ globus_l_gfs_file_cksm_verify(
globus_gridftp_server_finished_transfer(
monitor->op, monitor->finish_result);
-
+
globus_l_gfs_file_monitor_destroy(monitor);
GlobusGFSFileDebugExit();
}
-static
+static
globus_bool_t
globus_l_gfs_file_timeout_cb(
globus_xio_handle_t handle,
@@ -472,7 +472,7 @@ globus_l_gfs_file_timeout_cb(
globus_gfs_log_message(
GLOBUS_GFS_LOG_WARN,
"A file access timeout has occurred.\n");
-
+
GlobusGFSFileDebugExit();
return GLOBUS_TRUE;
@@ -491,10 +491,10 @@ globus_l_gfs_file_close_cb(
monitor = (globus_l_file_monitor_t *) user_arg;
GlobusGFSFileDebugEnter();
-
+
if(monitor != NULL)
{
- /* must lock/unlock or we can get to the destroy before the
+ /* must lock/unlock or we can get to the destroy before the
registeration locak has actually released... crazy threads */
globus_mutex_lock(&monitor->lock);
{
@@ -505,20 +505,20 @@ globus_l_gfs_file_close_cb(
}
globus_mutex_unlock(&monitor->lock);
- if(monitor->finish_result == GLOBUS_SUCCESS &&
+ if(monitor->finish_result == GLOBUS_SUCCESS &&
monitor->utime >= 0)
{
monitor->finish_result = globus_l_gfs_file_utime(
NULL, monitor->pathname, monitor->utime);
}
-
- if(monitor->finish_result == GLOBUS_SUCCESS &&
+
+ if(monitor->finish_result == GLOBUS_SUCCESS &&
monitor->expected_cksm != NULL)
{
/* verify file before finishing */
result = globus_l_gfs_file_cksm(
- NULL,
- monitor->pathname,
+ NULL,
+ monitor->pathname,
monitor->expected_cksm_alg,
0,
-1,
@@ -529,7 +529,7 @@ globus_l_gfs_file_close_cb(
{
globus_gridftp_server_finished_transfer(
monitor->op, monitor->finish_result);
-
+
globus_l_gfs_file_monitor_destroy(monitor);
}
}
@@ -597,8 +597,8 @@ globus_l_gfs_file_close(
/**
* stat calls
*/
-
-/* basepath and filename must be MAXPATHLEN long
+
+/* basepath and filename must be MAXPATHLEN long
* the pathname may be absolute or relative, basepath will be the same */
static
void
@@ -611,12 +611,12 @@ globus_l_gfs_file_partition_path(
char * filepart;
GlobusGFSName(globus_l_gfs_file_partition_path);
GlobusGFSFileDebugEnter();
-
+
strncpy(buf, pathname, MAXPATHLEN);
buf[MAXPATHLEN - 1] = '\0';
-
+
filepart = strrchr(buf, '/');
-
+
#ifdef WIN32
@@ -652,15 +652,15 @@ globus_l_gfs_file_partition_path(
}
}
else
- {
+ {
*filepart++ = '\0';
strcpy(basepath, buf);
strcpy(filename, filepart);
}
- }
+ }
if(filename[0] == 0)
- {
+ {
filename[0] = '/';
filename[1] = 0;
}
@@ -678,7 +678,7 @@ globus_l_gfs_file_realpath(
char resolved[MAXPATHLEN];
GlobusGFSName(globus_l_gfs_file_stat);
GlobusGFSFileDebugEnter();
-
+
if(realpath(in_path, resolved) == NULL)
{
result = GlobusGFSErrorSystemError("realpath", errno);
@@ -719,7 +719,7 @@ globus_l_gfs_file_copy_stat(
stat_object->ino = stat_buf->st_ino;
stat_object->link_mode = link_mode;
stat_object->error = error;
-
+
if(filename && *filename)
{
stat_object->name = globus_libc_strdup(filename);
@@ -748,23 +748,23 @@ globus_l_gfs_file_destroy_stat(
int i;
GlobusGFSName(globus_l_gfs_file_destroy_stat);
GlobusGFSFileDebugEnter();
-
+
for(i = 0; i < stat_count; i++)
{
if(stat_array[i].name != NULL)
{
globus_free(stat_array[i].name);
- }
+ }
if(stat_array[i].symlink_target != NULL)
{
globus_free(stat_array[i].symlink_target);
}
}
- globus_free(stat_array);
+ globus_free(stat_array);
GlobusGFSFileDebugExit();
}
-
+
#define GFS_STAT_COUNT_CHECK 100
#define GFS_STAT_COUNT_MAX 1000
@@ -787,39 +787,39 @@ globus_l_gfs_file_stat(
char filename[MAXPATHLEN];
char symlink_target[MAXPATHLEN];
globus_gridftp_server_control_stat_error_t base_error = GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_SUCCESS;
-
+
GlobusGFSName(globus_l_gfs_file_stat);
GlobusGFSFileDebugEnter();
-
+
/* lstat is the same as stat when not operating on a link */
if(lstat(stat_info->pathname, &stat_buf) != 0)
{
result = GlobusGFSErrorSystemError("stat", errno);
goto error_stat1;
}
- /* if this is a link we still need to stat to get the info we are
- interested in and then use realpath() to get the full path of
+ /* if this is a link we still need to stat to get the info we are
+ interested in and then use realpath() to get the full path of
the symlink target */
*symlink_target = '\0';
if(S_ISLNK(stat_buf.st_mode))
{
int stat_result = 0;
-
+
if(stat_info->use_symlink_info)
{
memset(&link_stat_buf, 0, sizeof(struct stat));
stat_result = stat(stat_info->pathname, &link_stat_buf);
- }
+ }
else if(stat(stat_info->pathname, &stat_buf) != 0)
{
result = GlobusGFSErrorSystemError("stat", errno);
goto error_stat1;
}
-
+
if(stat_result < 0 || realpath(stat_info->pathname, symlink_target) == NULL)
{
int nchars = readlink(stat_info->pathname, symlink_target, MAXPATHLEN);
- if (nchars < 0)
+ if (nchars < 0)
{
result = GlobusGFSErrorSystemError("realpath", errno);
goto error_stat1;
@@ -827,9 +827,9 @@ globus_l_gfs_file_stat(
symlink_target[nchars] = '\0';
base_error = GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_INVALIDLINK;
}
- }
+ }
globus_l_gfs_file_partition_path(stat_info->pathname, basepath, filename);
-
+
if(!S_ISDIR(stat_buf.st_mode) || stat_info->file_only)
{
stat_array = (globus_gfs_stat_t *)
@@ -839,7 +839,7 @@ globus_l_gfs_file_stat(
result = GlobusGFSErrorMemory("stat_array");
goto error_alloc1;
}
-
+
globus_l_gfs_file_copy_stat(
stat_array, &stat_buf, filename, symlink_target, link_stat_buf.st_mode, base_error);
stat_count = 1;
@@ -859,17 +859,17 @@ globus_l_gfs_file_stat(
globus_bool_t check_cdir = GLOBUS_TRUE;
stat_limit_time = time(NULL) + GFS_STAT_TIME;
-
+
stat_count = stat_info->include_path_stat ? 1 : 0;
-
+
{
- if(stat_info->pathname &&
+ if(stat_info->pathname &&
stat_info->pathname[0] == '/' && stat_info->pathname[1] == 0)
{
DWORD drivemask;
char drive[] = "A";
-
+
stat_array = (globus_gfs_stat_t *)
globus_malloc(sizeof(globus_gfs_stat_t) * 30);
if(!stat_array)
@@ -892,7 +892,7 @@ globus_l_gfs_file_stat(
}
goto done_fake;
-
+
}
}
@@ -904,7 +904,7 @@ globus_l_gfs_file_stat(
if (!stat_info->include_path_stat)
goto error_open;
}
-
+
total_stat_count = 0;
while(globus_libc_readdir_r(dir, &dir_entry) == 0 && dir_entry)
@@ -912,46 +912,46 @@ globus_l_gfs_file_stat(
total_stat_count++;
globus_free(dir_entry);
}
-
+
globus_libc_rewinddir(dir);
stat_array = (globus_gfs_stat_t *) globus_malloc(
- sizeof(globus_gfs_stat_t) *
+ sizeof(globus_gfs_stat_t) *
(GLOBUS_MIN(stat_limit_max, total_stat_count) + 1));
if(!stat_array)
{
result = GlobusGFSErrorMemory("stat_array");
goto error_alloc2;
}
-
+
snprintf(
- dir_path,
- sizeof(dir_path),
- "%s/%s",
- (basepath[0] != '/' || basepath[1] != '\0') ? basepath : "",
+ dir_path,
+ sizeof(dir_path),
+ "%s/%s",
+ (basepath[0] != '/' || basepath[1] != '\0') ? basepath : "",
filename);
-
+
dir_path[maxpathlen - 1] = '\0';
if(!basepath[0] && filename[0] == '/')
{
dir_path[0] = 0;
}
-
+
i = 0;
- if(stat_info->include_path_stat)
+ if(stat_info->include_path_stat)
{
globus_l_gfs_file_copy_stat(&stat_array[i++], &stat_buf, filename, NULL, 0,
dir ? GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_SUCCESS : GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_OPENFAILED);
}
-
+
while(globus_libc_readdir_r(dir, &dir_entry) == 0 && dir_entry)
{
char path[maxpathlen];
-
+
base_error = GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_SUCCESS;
snprintf(path, sizeof(path), "%s/%s", dir_path, dir_entry->d_name);
path[maxpathlen - 1] = '\0';
-
+
if(stat(path, &stat_buf) != 0)
{
/* stat() doesn't return a useful error */
@@ -980,7 +980,7 @@ globus_l_gfs_file_stat(
&stat_array[i], &stat_buf, dir_entry->d_name, symlink_target, link_stat_buf.st_mode, base_error);
/* set nlink to total files in dir for . entry */
- if(check_cdir && dir_entry->d_name &&
+ if(check_cdir && dir_entry->d_name &&
dir_entry->d_name[0] == '.' && dir_entry->d_name[1] == '\0')
{
check_cdir = GLOBUS_FALSE;
@@ -990,7 +990,7 @@ globus_l_gfs_file_stat(
{
unsigned long h = 0;
char * key;
-
+
key = path;
while(*key)
{
@@ -1001,13 +1001,13 @@ globus_l_gfs_file_stat(
i++;
globus_free(dir_entry);
-
+
/* send updates every GFS_STAT_TIME, checked every GFS_STAT_CHECK */
if(i >= stat_limit_check)
{
time_t tmp_time;
globus_bool_t send_stats = GLOBUS_FALSE;
-
+
tmp_time = time(NULL);
if(i >= stat_limit_max || tmp_time > stat_limit_time)
{
@@ -1017,7 +1017,7 @@ globus_l_gfs_file_stat(
{
stat_limit_check += GFS_STAT_COUNT_CHECK;
}
-
+
if(send_stats)
{
stat_count = i;
@@ -1025,12 +1025,12 @@ globus_l_gfs_file_stat(
stat_limit_time = tmp_time + GFS_STAT_TIME;
i = 0;
-
+
globus_gridftp_server_finished_stat_partial(
op, GLOBUS_SUCCESS, stat_array, stat_count);
-
+
globus_l_gfs_file_destroy_stat(stat_array, stat_count);
-
+
stat_array = (globus_gfs_stat_t *) globus_malloc(
sizeof(globus_gfs_stat_t) * (stat_limit_max + 1));
if(!stat_array)
@@ -1038,13 +1038,13 @@ globus_l_gfs_file_stat(
result = GlobusGFSErrorMemory("stat_array");
goto error_alloc2;
}
-
+
stat_count = 0;
}
- }
+ }
}
stat_count = i;
-
+
closedir(dir);
goto done_fake;
@@ -1071,11 +1071,11 @@ globus_l_gfs_file_stat(
int slow_listing_thresh;
stat_limit_time = time(NULL) + GFS_STAT_TIME;
-
+
total_stat_count = scandir(
- stat_info->pathname,
- &entries,
- NULL,
+ stat_info->pathname,
+ &entries,
+ NULL,
(getenv("FTPNOSORT") ? NULL : alphasort));
if(total_stat_count < 0)
{
@@ -1090,33 +1090,33 @@ globus_l_gfs_file_stat(
}
stat_array = (globus_gfs_stat_t *) globus_malloc(
- sizeof(globus_gfs_stat_t) *
+ sizeof(globus_gfs_stat_t) *
(GLOBUS_MIN(stat_limit_max, total_stat_count) + 1));
if(!stat_array)
{
result = GlobusGFSErrorMemory("stat_array");
goto error_open;
}
-
+
snprintf(
- dir_path,
- sizeof(dir_path),
- "%s/%s",
- (basepath[0] != '/' || basepath[1] != '\0') ? basepath : "",
+ dir_path,
+ sizeof(dir_path),
+ "%s/%s",
+ (basepath[0] != '/' || basepath[1] != '\0') ? basepath : "",
filename);
-
+
dir_path[MAXPATHLEN - 1] = '\0';
-
+
i = 0;
j = 0;
while(j < total_stat_count)
- {
+ {
char path[MAXPATHLEN];
-
+
dir_entry = entries[j++];
snprintf(path, sizeof(path), "%s/%s", dir_path, dir_entry->d_name);
path[MAXPATHLEN - 1] = '\0';
-
+
/* fake a stat response if stats are slow, d_type is valid,
* and indicates a file or dir */
#ifndef _DIRENT_HAVE_D_TYPE
@@ -1186,7 +1186,7 @@ globus_l_gfs_file_stat(
}
globus_l_gfs_file_copy_stat(
&stat_array[i], &stat_buf, dir_entry->d_name, symlink_target, link_stat_buf.st_mode, base_error);
-
+
/* set nlink to total files in dir for . entry */
if(check_cdir &&
dir_entry->d_name[0] == '.' && dir_entry->d_name[1] == '\0')
@@ -1204,7 +1204,7 @@ globus_l_gfs_file_stat(
{
time_t tmp_time;
globus_bool_t send_stats = GLOBUS_FALSE;
-
+
tmp_time = time(NULL);
if(i >= stat_limit_max || tmp_time >= stat_limit_time)
{
@@ -1214,7 +1214,7 @@ globus_l_gfs_file_stat(
{
stat_limit_check += GFS_STAT_COUNT_CHECK;
}
-
+
if(send_stats)
{
stat_count = i;
@@ -1227,7 +1227,7 @@ globus_l_gfs_file_stat(
op, GLOBUS_SUCCESS, stat_array, stat_count);
globus_l_gfs_file_destroy_stat(stat_array, stat_count);
-
+
stat_array = (globus_gfs_stat_t *) globus_malloc(
sizeof(globus_gfs_stat_t) * (stat_limit_max + 1));
if(!stat_array)
@@ -1235,13 +1235,13 @@ globus_l_gfs_file_stat(
result = GlobusGFSErrorMemory("stat_array");
goto error_open;
}
-
+
stat_count = 0;
}
- }
+ }
}
stat_count = i;
-
+
if(entries)
{
globus_free(entries);
@@ -1252,7 +1252,7 @@ globus_l_gfs_file_stat(
globus_gridftp_server_finished_stat(
op, result, stat_array, stat_count);
globus_l_gfs_file_destroy_stat(stat_array, stat_count);
-
+
GlobusGFSFileDebugExit();
return;
@@ -1276,12 +1276,12 @@ globus_l_gfs_file_truncate(
globus_result_t result;
globus_xio_system_file_t fd;
struct stat sbuf;
-
+
GlobusGFSName(globus_l_gfs_file_truncate);
GlobusGFSFileDebugEnter();
result = globus_xio_system_file_open(
- &fd, pathname,
+ &fd, pathname,
GLOBUS_XIO_FILE_RDWR | GLOBUS_XIO_FILE_BINARY, 0);
if(result != GLOBUS_SUCCESS)
{
@@ -1289,16 +1289,16 @@ globus_l_gfs_file_truncate(
}
#ifdef WIN32
- rc = stat(pathname, &sbuf);
+ rc = stat(pathname, &sbuf);
#else
rc = fstat(fd, &sbuf);
-#endif
+#endif
if(rc != 0)
{
result = GlobusGFSErrorSystemError("stat", errno);
goto error_close;
}
-
+
if(offset > sbuf.st_size)
{
result = GlobusGFSErrorGeneric(
@@ -1311,15 +1311,15 @@ globus_l_gfs_file_truncate(
{
goto error_close;
}
-
+
result = globus_xio_system_file_close(fd);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
@@ -1347,12 +1347,12 @@ globus_l_gfs_file_mkdir(
result = GlobusGFSErrorSystemError("mkdir", errno);
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1375,12 +1375,12 @@ globus_l_gfs_file_rmdir(
result = GlobusGFSErrorSystemError("rmdir", errno);
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1397,22 +1397,21 @@ globus_l_gfs_file_delete_dir(
DIR * dir;
struct stat stat_buf;
struct dirent * dir_entry;
- int i;
char path[MAXPATHLEN];
GlobusGFSName(globus_l_gfs_file_delete_dir);
GlobusGFSFileDebugEnter();
-
+
/* lstat is the same as stat when not operating on a link */
if(lstat(pathname, &stat_buf) != 0)
{
result = GlobusGFSErrorSystemError("stat", errno);
goto error_stat;
}
-
+
if(!S_ISDIR(stat_buf.st_mode))
{
/* remove anything that isn't a dir -- don't follow links */
- rc = unlink(pathname);
+ rc = unlink(pathname);
if(rc != 0)
{
result = GlobusGFSErrorSystemError("unlink", errno);
@@ -1427,13 +1426,11 @@ globus_l_gfs_file_delete_dir(
result = GlobusGFSErrorSystemError("opendir", errno);
goto error_open;
}
-
- for(i = 0;
- globus_libc_readdir_r(dir, &dir_entry) == 0 && dir_entry;
- i++)
- {
- if(dir_entry->d_name[0] == '.' &&
- (dir_entry->d_name[1] == '\0' ||
+
+ while(globus_libc_readdir_r(dir, &dir_entry) == 0 && dir_entry)
+ {
+ if(dir_entry->d_name[0] == '.' &&
+ (dir_entry->d_name[1] == '\0' ||
(dir_entry->d_name[1] == '.' && dir_entry->d_name[2] == '\0')))
{
globus_free(dir_entry);
@@ -1441,7 +1438,7 @@ globus_l_gfs_file_delete_dir(
}
snprintf(path, sizeof(path), "%s/%s", pathname, dir_entry->d_name);
path[MAXPATHLEN - 1] = '\0';
-
+
/* lstat is the same as stat when not operating on a link */
if(lstat(path, &stat_buf) != 0)
{
@@ -1450,11 +1447,11 @@ globus_l_gfs_file_delete_dir(
/* just skip invalid entries */
continue;
}
-
+
if(!S_ISDIR(stat_buf.st_mode))
{
/* remove anything that isn't a dir -- don't follow links */
- rc = unlink(path);
+ rc = unlink(path);
if(rc != 0)
{
result = GlobusGFSErrorSystemError("unlink", errno);
@@ -1480,23 +1477,23 @@ globus_l_gfs_file_delete_dir(
result = GlobusGFSErrorSystemError("rmdir", errno);
goto error_rmdir;
}
- }
-
+ }
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
error_recurse:
error_unlink2:
- closedir(dir);
- globus_free(dir_entry);
-error_open:
+ closedir(dir);
+ globus_free(dir_entry);
+error_open:
error_stat:
error_unlink1:
-error_rmdir:
+error_rmdir:
GlobusGFSFileDebugExitWithError();
- return result;
+ return result;
}
-
+
static
globus_result_t
globus_l_gfs_file_delete(
@@ -1527,12 +1524,12 @@ globus_l_gfs_file_delete(
goto error;
}
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1556,12 +1553,12 @@ globus_l_gfs_file_rename(
result = GlobusGFSErrorSystemError("rename", errno);
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1579,7 +1576,7 @@ globus_l_gfs_file_chgrp(
struct group * grp_info;
int grp_id;
char* endpt;
-
+
GlobusGFSName(globus_l_gfs_file_chgrp);
GlobusGFSFileDebugEnter();
@@ -1587,7 +1584,7 @@ globus_l_gfs_file_chgrp(
if(grp_info != NULL)
{
grp_id = grp_info->gr_gid;
- }
+ }
else
{
grp_id = strtol(group, &endpt, 10);
@@ -1597,25 +1594,25 @@ globus_l_gfs_file_chgrp(
goto error;
}
}
-
+
if(grp_id < 0)
{
result = GlobusGFSErrorSystemError("chgrp", EPERM);
goto error;
}
-
+
rc = chown(pathname, -1, grp_id);
if(rc != 0)
{
result = GlobusGFSErrorSystemError("chgrp", errno);
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1624,17 +1621,17 @@ globus_l_gfs_file_chgrp(
#ifdef WIN32
/* utime on win32 does not work with directories.
- we can work around that by opening a HANDLE with the
- FILE_FLAG_BACKUP_SEMANTICS flag, getting the fd from that, and calling
+ we can work around that by opening a HANDLE with the
+ FILE_FLAG_BACKUP_SEMANTICS flag, getting the fd from that, and calling
_futime on that fd.
- we could call SetFileTime() with the HANDLE, but there are quirks with
+ we could call SetFileTime() with the HANDLE, but there are quirks with
DST that result in the time returned by stat() being different than the
set time depending on the date and current DST state. the perl module
Win32-UTCFileTime documents that bit of fun.
*/
-
-static BOOL
+
+static BOOL
utime_win(
const char * path,
struct utimbuf * ubuf)
@@ -1643,7 +1640,7 @@ utime_win(
int rc;
int fd;
hFile = CreateFile(
- path, FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, 0,
+ path, FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, 0,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (hFile == INVALID_HANDLE_VALUE)
{
@@ -1676,7 +1673,7 @@ globus_l_gfs_file_utime(
#ifdef WIN32
rc = utime_win(pathname, &ubuf);
-#else
+#else
rc = utime(pathname, &ubuf);
#endif
if(rc != 0)
@@ -1684,15 +1681,15 @@ globus_l_gfs_file_utime(
result = GlobusGFSErrorSystemError("utime", errno);
goto error;
}
-
+
if(op)
{
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
}
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1716,12 +1713,12 @@ globus_l_gfs_file_symlink(
result = GlobusGFSErrorSystemError("symlink", errno);
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1745,12 +1742,12 @@ globus_l_gfs_file_chmod(
result = GlobusGFSErrorSystemError("chmod", errno);
goto error;
}
-
+
globus_gridftp_server_finished_command(op, GLOBUS_SUCCESS, NULL);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
-
+
error:
GlobusGFSFileDebugExitWithError();
return result;
@@ -1759,11 +1756,11 @@ globus_l_gfs_file_chmod(
static
void
globus_l_gfs_file_cksm_read_cb(
- globus_xio_handle_t handle,
+ globus_xio_handle_t handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t len,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg)
{
@@ -1777,11 +1774,11 @@ globus_l_gfs_file_cksm_read_cb(
unsigned char sha[SHA512_DIGEST_LENGTH];
char shasum[SHA512_DIGEST_LENGTH * 2 + 1] = {0};
char adler32_human[2*sizeof(uint32_t)+1];
- int i;
+ int i;
GlobusGFSName(globus_l_gfs_file_cksm_read_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_gfs_file_cksm_monitor_t *) user_arg;
if(result != GLOBUS_SUCCESS)
@@ -1796,11 +1793,11 @@ globus_l_gfs_file_cksm_read_cb(
"checksum read callback", result);
goto error_read;
}
- }
+ }
if(monitor->length >= 0)
{
monitor->read_left -= nbytes;
- monitor->count = (monitor->read_left > monitor->block_size) ?
+ monitor->count = (monitor->read_left > monitor->block_size) ?
monitor->block_size : monitor->read_left;
if(monitor->read_left == 0)
{
@@ -1835,10 +1832,10 @@ globus_l_gfs_file_cksm_read_cb(
if(monitor->send_marker)
{
monitor->send_marker = GLOBUS_FALSE;
-
+
char count[128];
sprintf(count, "%"GLOBUS_OFF_T_FORMAT, monitor->total_bytes);
-
+
globus_gridftp_server_intermediate_command(
monitor->op, GLOBUS_SUCCESS, count);
}
@@ -1874,7 +1871,7 @@ globus_l_gfs_file_cksm_read_cb(
NULL);
monitor->marker_handle = GLOBUS_NULL_HANDLE;
}
-
+
globus_xio_register_close(
handle,
NULL,
@@ -1937,22 +1934,22 @@ globus_l_gfs_file_cksm_read_cb(
{
globus_gridftp_server_finished_command(
monitor->op, GLOBUS_SUCCESS, cksmptr);
- }
-
+ }
+
globus_free(monitor);
-
- }
+
+ }
GlobusGFSFileDebugExit();
return;
-
+
error_register:
error_read:
globus_xio_register_close(handle, NULL, NULL, NULL);
handle = NULL;
- globus_gridftp_server_finished_command(monitor->op, result, NULL);
+ globus_gridftp_server_finished_command(monitor->op, result, NULL);
globus_free(monitor);
-
+
GlobusGFSFileDebugExitWithError();
}
@@ -1962,7 +1959,7 @@ globus_l_gfs_file_marker_cb(
void * user_arg)
{
globus_l_gfs_file_cksm_monitor_t * monitor;
-
+
monitor = (globus_l_gfs_file_cksm_monitor_t *) user_arg;
monitor->send_marker = GLOBUS_TRUE;
}
@@ -1973,20 +1970,20 @@ globus_l_gfs_file_open_cksm_cb(
globus_xio_handle_t handle,
globus_result_t result,
void * user_arg)
-{
+{
globus_l_gfs_file_cksm_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_open_cksm_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_gfs_file_cksm_monitor_t *) user_arg;
if(result != GLOBUS_SUCCESS)
{
result = GlobusGFSErrorWrapFailed(
"open", result);
- goto error_open;
- }
-
+ goto error_open;
+ }
+
if(monitor->op)
{
globus_gridftp_server_get_update_interval(
@@ -1997,7 +1994,7 @@ globus_l_gfs_file_open_cksm_cb(
{
globus_result_t res;
globus_reltime_t delay;
-
+
GlobusTimeReltimeSet(delay, monitor->marker_freq, 0);
res = globus_callback_register_periodic(
&monitor->marker_handle,
@@ -2007,21 +2004,21 @@ globus_l_gfs_file_open_cksm_cb(
monitor);
if(res != GLOBUS_SUCCESS)
{
-
+
}
}
-
+
if(monitor->length >= 0)
{
monitor->read_left = monitor->length;
- monitor->count = (monitor->read_left > monitor->block_size) ?
+ monitor->count = (monitor->read_left > monitor->block_size) ?
monitor->block_size : monitor->read_left;
}
else
{
monitor->count = monitor->block_size;
}
-
+
if(monitor->offset > 0)
{
result = globus_xio_handle_cntl(
@@ -2058,8 +2055,8 @@ globus_l_gfs_file_open_cksm_cb(
{
monitor->adler32ctx = adler32(0, NULL, 0);
}
-
-
+
+
result = globus_xio_register_read(
handle,
monitor->buffer,
@@ -2077,7 +2074,7 @@ globus_l_gfs_file_open_cksm_cb(
GlobusGFSFileDebugExit();
return;
-
+
error_register:
error_seek:
error_open:
@@ -2090,9 +2087,9 @@ globus_l_gfs_file_open_cksm_cb(
else
{
globus_gridftp_server_finished_command(monitor->op, result, NULL);
- }
+ }
globus_free(monitor);
-
+
GlobusGFSFileDebugExitWithError();
}
@@ -2118,7 +2115,7 @@ globus_l_gfs_file_cksm(
int cksm_type = 0;
GlobusGFSName(globus_l_gfs_file_cksm);
GlobusGFSFileDebugEnter();
-
+
if(offset < 0)
{
result = GlobusGFSErrorGeneric("Invalid offset.");
@@ -2186,18 +2183,18 @@ globus_l_gfs_file_cksm(
{
globus_gfs_log_message(
GLOBUS_GFS_LOG_WARN,
- "Unable to set file access timeout of %d seconds\n",
+ "Unable to set file access timeout of %d seconds\n",
timeout);
}
}
-
+
result = globus_xio_stack_init(&stack, NULL);
if(result != GLOBUS_SUCCESS)
{
result = GlobusGFSErrorWrapFailed("globus_xio_stack_init", result);
goto error_stack;
}
-
+
result = globus_xio_stack_push_driver(stack, globus_l_gfs_file_driver);
if(result != GLOBUS_SUCCESS)
{
@@ -2222,7 +2219,7 @@ globus_l_gfs_file_cksm(
result = GlobusGFSErrorMemory("checksum buffer");
goto error_mem;
}
-
+
monitor->op = op;
monitor->offset = offset;
monitor->length = length;
@@ -2246,7 +2243,7 @@ globus_l_gfs_file_cksm(
globus_xio_attr_destroy(attr);
globus_xio_stack_destroy(stack);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
@@ -2254,22 +2251,22 @@ globus_l_gfs_file_cksm(
globus_xio_register_close(file_handle, NULL, NULL, NULL);
file_handle = NULL;
globus_free(monitor);
-
+
error_mem:
error_create:
error_push:
globus_xio_stack_destroy(stack);
-
+
error_stack:
-error_cntl:
+error_cntl:
globus_xio_attr_destroy(attr);
-
+
error_attr:
alg_error:
param_error:
GlobusGFSFileDebugExitWithError();
return result;
-}
+}
static
void
@@ -2324,15 +2321,15 @@ globus_l_gfs_file_command(
break;
case GLOBUS_GFS_CMD_CKSM:
result = globus_l_gfs_file_cksm(
- op,
- cmd_info->pathname,
+ op,
+ cmd_info->pathname,
cmd_info->cksm_alg,
cmd_info->cksm_offset,
cmd_info->cksm_length,
NULL,
NULL);
break;
-
+
default:
result = GLOBUS_FAILURE;
break;
@@ -2342,12 +2339,12 @@ globus_l_gfs_file_command(
{
goto error;
}
-
+
GlobusGFSFileDebugExit();
return;
error:
- globus_gridftp_server_finished_command(op, result, NULL);
+ globus_gridftp_server_finished_command(op, result, NULL);
GlobusGFSFileDebugExitWithError();
}
@@ -2371,29 +2368,29 @@ static
globus_result_t
globus_l_gfs_file_dispatch_write(
globus_l_file_monitor_t * monitor);
-
+
static
void
globus_l_gfs_file_write_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t len,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg)
{
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_write_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
-
+
globus_mutex_lock(&monitor->lock);
- {
+ {
monitor->pending_writes--;
globus_gridftp_server_update_bytes_written(
- monitor->op,
+ monitor->op,
monitor->file_offset,
nbytes);
monitor->file_offset += nbytes;
@@ -2406,7 +2403,7 @@ globus_l_gfs_file_write_cb(
{
goto error;
}
-
+
if(!monitor->eof)
{
result = globus_gridftp_server_register_read(
@@ -2421,14 +2418,14 @@ globus_l_gfs_file_write_cb(
"globus_gridftp_server_register_read", result);
goto error;
}
-
+
monitor->pending_reads++;
}
else
{
globus_memory_push_node(&monitor->mem, buffer);
}
-
+
result = globus_l_gfs_file_dispatch_write(monitor);
if(result != GLOBUS_SUCCESS)
{
@@ -2436,7 +2433,7 @@ globus_l_gfs_file_write_cb(
"globus_l_gfs_file_dispatch_write", result);
goto error_dispatch;
}
-
+
if(monitor->pending_reads == 0 && monitor->pending_writes == 0)
{
globus_assert(monitor->eof || monitor->aborted);
@@ -2450,7 +2447,7 @@ globus_l_gfs_file_write_cb(
}
}
/* already unlocked */
-
+
GlobusGFSFileDebugExit();
return;
@@ -2461,7 +2458,7 @@ globus_l_gfs_file_write_cb(
{
/* there are still outstanding callbacks, wait for them */
globus_mutex_unlock(&monitor->lock);
-
+
GlobusGFSFileDebugExitWithError();
return;
}
@@ -2482,7 +2479,7 @@ globus_l_gfs_file_dispatch_write(
globus_result_t result;
GlobusGFSName(globus_l_gfs_file_dispatch_write);
GlobusGFSFileDebugEnter();
-
+
if(monitor->pending_writes == 0 && !monitor->aborted)
{
buf_info = (globus_l_buffer_info_t *)
@@ -2490,7 +2487,7 @@ globus_l_gfs_file_dispatch_write(
if(buf_info)
{
if(buf_info->offset != monitor->file_offset)
- {
+ {
globus_off_t seek_tmp;
monitor->file_offset = buf_info->offset;
@@ -2509,7 +2506,7 @@ globus_l_gfs_file_dispatch_write(
goto error_seek;
}
}
-
+
result = globus_xio_register_write(
monitor->file_handle,
buf_info->buffer,
@@ -2524,13 +2521,13 @@ globus_l_gfs_file_dispatch_write(
"globus_xio_register_write", result);
goto error_register;
}
-
+
monitor->pending_writes++;
-
+
globus_free(buf_info);
}
}
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
@@ -2557,7 +2554,7 @@ globus_l_gfs_file_update_concurrency(
int extra;
GlobusGFSName(globus_l_gfs_file_update_concurrency);
GlobusGFSFileDebugEnter();
-
+
if(!monitor->eof)
{
monitor->concurrency_check = monitor->concurrency_check_interval;
@@ -2566,16 +2563,16 @@ globus_l_gfs_file_update_concurrency(
{
monitor->concurrency_check_interval = 1024;
}
-
+
globus_gridftp_server_get_optimal_concurrency(
monitor->op, &optimal_count);
extra = optimal_count - monitor->optimal_count;
-
+
monitor->optimal_count = optimal_count;
while(extra-- > 0)
{
globus_byte_t * buffer;
-
+
buffer = globus_memory_pop_node(&monitor->mem);
result = globus_gridftp_server_register_read(
monitor->op,
@@ -2590,11 +2587,11 @@ globus_l_gfs_file_update_concurrency(
"globus_gridftp_server_register_read", result);
goto error_register;
}
-
+
monitor->pending_reads++;
}
}
-
+
GlobusGFSFileDebugExit();
return;
@@ -2618,9 +2615,9 @@ globus_l_gfs_file_server_read_cb(
int rc;
GlobusGFSName(globus_l_gfs_file_server_read_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
-
+
globus_mutex_lock(&monitor->lock);
{
monitor->pending_reads--;
@@ -2632,20 +2629,20 @@ globus_l_gfs_file_server_read_cb(
{
goto error;
}
-
+
if(eof)
{
monitor->eof = GLOBUS_TRUE;
}
-
- buf_info = (globus_l_buffer_info_t *)
+
+ buf_info = (globus_l_buffer_info_t *)
globus_malloc(sizeof(globus_l_buffer_info_t));
if(!buf_info)
{
monitor->error = GlobusGFSErrorObjMemory("buf_info");
goto error_alloc;
}
-
+
/* XXX offset may need some interpretation here depending on type of
* transfer (may need to remember original start offset)
*/
@@ -2656,8 +2653,8 @@ globus_l_gfs_file_server_read_cb(
if(monitor->concurrency_check == 0 && !eof)
{
globus_l_gfs_file_update_concurrency(monitor);
- }
-
+ }
+
rc = globus_priority_q_enqueue(
&monitor->queue, buf_info, buf_info);
if(rc != GLOBUS_SUCCESS)
@@ -2677,15 +2674,15 @@ globus_l_gfs_file_server_read_cb(
}
globus_mutex_unlock(&monitor->lock);
-
+
GlobusGFSFileDebugExit();
return;
-
+
error_enqueue:
error_dispatch:
/* can't free buf_info, its in queue */
globus_free(buf_info);
-
+
error_alloc:
error:
globus_memory_push_node(&monitor->mem, buffer);
@@ -2713,7 +2710,7 @@ globus_l_gfs_file_open_write_cb(
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_open_write_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
if(result != GLOBUS_SUCCESS)
{
@@ -2725,18 +2722,18 @@ globus_l_gfs_file_open_write_cb(
globus_gridftp_server_begin_transfer(
monitor->op, GLOBUS_GFS_EVENT_TRANSFER_ABORT, monitor);
-
+
globus_mutex_lock(&monitor->lock);
{
int optimal_count;
globus_size_t block_size;
-
+
optimal_count = monitor->optimal_count;
block_size = monitor->block_size;
while(optimal_count--)
{
globus_byte_t * buffer;
-
+
buffer = globus_memory_pop_node(&monitor->mem);
result = globus_gridftp_server_register_read(
monitor->op,
@@ -2751,12 +2748,12 @@ globus_l_gfs_file_open_write_cb(
"globus_gridftp_server_register_read", result);
goto error_register;
}
-
+
monitor->pending_reads++;
}
}
globus_mutex_unlock(&monitor->lock);
-
+
GlobusGFSFileDebugExit();
return;
@@ -2785,7 +2782,7 @@ globus_l_gfs_file_open_read_cb(
globus_xio_handle_t handle,
globus_result_t result,
void * user_arg);
-
+
static
globus_result_t
globus_l_gfs_file_open(
@@ -2804,7 +2801,7 @@ globus_l_gfs_file_open(
GlobusGFSFileDebugEnter();
monitor = (globus_l_file_monitor_t *) arg;
-
+
result = globus_xio_attr_init(&attr);
if(result != GLOBUS_SUCCESS)
{
@@ -2816,7 +2813,7 @@ globus_l_gfs_file_open(
if(globus_gfs_config_get_bool("direct_io"))
{
open_flags |= O_DIRECT;
- }
+ }
#endif
result = globus_xio_attr_cntl(
@@ -2836,9 +2833,9 @@ globus_l_gfs_file_open(
if(perms != NULL)
{
int p = 0;
-
+
p = strtoul(perms, NULL, 8);
- if(p > 0 ||
+ if(p > 0 ||
(perms[0] == '0' && perms[1] == '\0'))
{
result = globus_xio_attr_cntl(
@@ -2879,12 +2876,12 @@ globus_l_gfs_file_open(
{
globus_gfs_log_message(
GLOBUS_GFS_LOG_WARN,
- "Unable to set file access timeout of %d seconds\n",
+ "Unable to set file access timeout of %d seconds\n",
timeout);
}
}
-
-
+
+
result = globus_xio_stack_init(&stack, NULL);
if(result != GLOBUS_SUCCESS)
{
@@ -2904,13 +2901,13 @@ globus_l_gfs_file_open(
result = GlobusGFSErrorWrapFailed("globus_xio_handle_create", result);
goto error_create;
}
-
+
result = globus_xio_register_open(
*file_handle,
pathname,
attr,
- (open_flags & GLOBUS_XIO_FILE_CREAT) ?
- globus_l_gfs_file_open_write_cb :
+ (open_flags & GLOBUS_XIO_FILE_CREAT) ?
+ globus_l_gfs_file_open_write_cb :
globus_l_gfs_file_open_read_cb,
arg);
if(result != GLOBUS_SUCCESS)
@@ -2918,11 +2915,11 @@ globus_l_gfs_file_open(
result = GlobusGFSErrorWrapFailed("globus_xio_register_open", result);
goto error_register;
}
-
-
+
+
globus_xio_attr_destroy(attr);
globus_xio_stack_destroy(stack);
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
@@ -2932,11 +2929,11 @@ globus_l_gfs_file_open(
error_create:
error_push:
globus_xio_stack_destroy(stack);
-
+
error_stack:
-error_cntl:
+error_cntl:
globus_xio_attr_destroy(attr);
-
+
error_attr:
GlobusGFSFileDebugExitWithError();
return result;
@@ -2972,7 +2969,7 @@ globus_l_gfs_file_recv(
goto error_alloc;
}
monitor->session = (gfs_l_file_session_t *) user_arg;
-
+
globus_gridftp_server_get_write_range(
op,
&offset,
@@ -2987,29 +2984,29 @@ globus_l_gfs_file_recv(
"globus_gridftp_server_get_recv_modification_time", result);
goto error_alloc;
}
-
+
monitor->op = op;
monitor->pathname = globus_libc_strdup(transfer_info->pathname);
-
- open_flags = GLOBUS_XIO_FILE_BINARY |
- GLOBUS_XIO_FILE_CREAT |
+
+ open_flags = GLOBUS_XIO_FILE_BINARY |
+ GLOBUS_XIO_FILE_CREAT |
GLOBUS_XIO_FILE_WRONLY;
if(transfer_info->truncate)
{
open_flags |= GLOBUS_XIO_FILE_TRUNC;
}
-
+
if(transfer_info->expected_checksum)
{
- monitor->expected_cksm =
+ monitor->expected_cksm =
globus_libc_strdup(transfer_info->expected_checksum);
}
if(transfer_info->expected_checksum_alg)
{
- monitor->expected_cksm_alg =
+ monitor->expected_cksm_alg =
globus_libc_strdup(transfer_info->expected_checksum_alg);
}
-
+
result = globus_l_gfs_file_open(
&monitor->file_handle, transfer_info->pathname, open_flags, monitor);
if(result != GLOBUS_SUCCESS)
@@ -3017,13 +3014,13 @@ globus_l_gfs_file_recv(
result = GlobusGFSErrorWrapFailed("globus_l_gfs_file_open", result);
goto error_open;
}
-
+
GlobusGFSFileDebugExit();
return;
error_open:
globus_l_gfs_file_monitor_destroy(monitor);
-
+
error_alloc:
globus_gridftp_server_finished_transfer(op, result);
@@ -3037,14 +3034,14 @@ globus_l_gfs_file_recv(
static
void
globus_l_gfs_file_read_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t len,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg);
-
+
/* called LOCKED */
static
globus_result_t
@@ -3056,8 +3053,8 @@ globus_l_gfs_file_dispatch_read(
globus_size_t read_length;
GlobusGFSName(globus_l_gfs_file_dispatch_read);
GlobusGFSFileDebugEnter();
-
- if(monitor->first_read && monitor->pending_reads == 0 &&
+
+ if(monitor->first_read && monitor->pending_reads == 0 &&
!monitor->eof && !globus_list_empty(monitor->buffer_list) &&
!monitor->aborted)
{
@@ -3070,19 +3067,19 @@ globus_l_gfs_file_dispatch_read(
monitor->eof = GLOBUS_TRUE;
}
else
- {
+ {
if (monitor->file_offset != monitor->read_offset)
{
globus_off_t seek_tmp;
seek_tmp = monitor->read_offset;
-
+
result = globus_xio_handle_cntl(
monitor->file_handle,
GLOBUS_XIO_QUERY,
GLOBUS_XIO_SEEK,
seek_tmp,
GLOBUS_XIO_FILE_SEEK_SET);
-
+
if(result != GLOBUS_SUCCESS)
{
result = GlobusGFSErrorWrapFailed(
@@ -3091,19 +3088,19 @@ globus_l_gfs_file_dispatch_read(
}
monitor->file_offset = monitor->read_offset;
}
-
+
}
monitor->first_read = GLOBUS_FALSE;
- }
+ }
- if(monitor->pending_reads == 0 && !monitor->eof &&
+ if(monitor->pending_reads == 0 && !monitor->eof &&
!globus_list_empty(monitor->buffer_list) && !monitor->aborted)
{
buffer = globus_list_remove(
&monitor->buffer_list, monitor->buffer_list);
globus_assert(buffer);
-
- if(monitor->read_length != -1 &&
+
+ if(monitor->read_length != -1 &&
monitor->block_size > monitor->read_length)
{
read_length = monitor->read_length;
@@ -3112,7 +3109,7 @@ globus_l_gfs_file_dispatch_read(
{
read_length = monitor->block_size;
}
-
+
result = globus_xio_register_read(
monitor->file_handle,
buffer,
@@ -3128,10 +3125,10 @@ globus_l_gfs_file_dispatch_read(
"globus_xio_register_read", result);
goto error_register;
}
-
+
monitor->pending_reads++;
}
-
+
GlobusGFSFileDebugExit();
return GLOBUS_SUCCESS;
@@ -3153,11 +3150,11 @@ globus_l_gfs_file_server_write_cb(
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_server_write_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
-
+
globus_mutex_lock(&monitor->lock);
- {
+ {
monitor->pending_writes--;
globus_list_insert(&monitor->buffer_list, buffer);
@@ -3169,7 +3166,7 @@ globus_l_gfs_file_server_write_cb(
{
goto error;
}
-
+
result = globus_l_gfs_file_dispatch_read(monitor);
if(result != GLOBUS_SUCCESS)
{
@@ -3177,7 +3174,7 @@ globus_l_gfs_file_server_write_cb(
"globus_l_gfs_file_dispatch_read", result);
goto error;
}
-
+
if(monitor->pending_reads == 0 && monitor->pending_writes == 0)
{
globus_assert(monitor->eof || monitor->aborted);
@@ -3190,7 +3187,7 @@ globus_l_gfs_file_server_write_cb(
}
}
/* already unlocked */
-
+
GlobusGFSFileDebugExit();
return;
@@ -3199,7 +3196,7 @@ globus_l_gfs_file_server_write_cb(
{
/* there are still outstanding callbacks, wait for them */
globus_mutex_unlock(&monitor->lock);
-
+
GlobusGFSFileDebugExitWithError();
return;
}
@@ -3212,20 +3209,20 @@ globus_l_gfs_file_server_write_cb(
static
void
globus_l_gfs_file_read_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t len,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg)
{
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_read_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
-
+
globus_mutex_lock(&monitor->lock);
{
monitor->pending_reads--;
@@ -3246,7 +3243,7 @@ globus_l_gfs_file_read_cb(
globus_list_insert(&monitor->buffer_list, buffer);
goto error;
}
-
+
if(nbytes > 0)
{
result = globus_gridftp_server_register_write(
@@ -3264,7 +3261,7 @@ globus_l_gfs_file_read_cb(
"globus_gridftp_server_register_write", result);
goto error;
}
-
+
monitor->pending_writes++;
monitor->file_offset += nbytes;
if(monitor->read_length != -1)
@@ -3276,12 +3273,12 @@ globus_l_gfs_file_read_cb(
{
globus_list_insert(&monitor->buffer_list, buffer);
}
-
+
if(monitor->read_length == 0)
{
monitor->first_read = GLOBUS_TRUE;
}
-
+
result = globus_l_gfs_file_dispatch_read(monitor);
if(result != GLOBUS_SUCCESS)
{
@@ -3289,7 +3286,7 @@ globus_l_gfs_file_read_cb(
"globus_l_gfs_file_dispatch_read", result);
goto error;
}
-
+
if(monitor->pending_reads == 0 && monitor->pending_writes == 0)
{
globus_assert(monitor->eof || monitor->aborted);
@@ -3312,7 +3309,7 @@ globus_l_gfs_file_read_cb(
{
/* there are still outstanding callbacks, wait for them */
globus_mutex_unlock(&monitor->lock);
-
+
GlobusGFSFileDebugExitWithError();
return;
}
@@ -3332,7 +3329,7 @@ globus_l_gfs_file_open_read_cb(
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_open_read_cb);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) user_arg;
if(result != GLOBUS_SUCCESS)
{
@@ -3341,10 +3338,10 @@ globus_l_gfs_file_open_read_cb(
monitor->file_handle = NULL;
goto error_open;
}
-
+
globus_gridftp_server_begin_transfer(
monitor->op, GLOBUS_GFS_EVENT_TRANSFER_ABORT, monitor);
-
+
globus_mutex_lock(&monitor->lock);
monitor->first_read = GLOBUS_TRUE;
result = globus_l_gfs_file_dispatch_read(monitor);
@@ -3354,7 +3351,7 @@ globus_l_gfs_file_open_read_cb(
"globus_l_gfs_file_dispatch_read", result);
goto error_dispatch;
}
-
+
if(monitor->pending_reads == 0 && monitor->pending_writes == 0)
{
globus_assert(monitor->eof || monitor->aborted);
@@ -3366,7 +3363,7 @@ globus_l_gfs_file_open_read_cb(
{
globus_mutex_unlock(&monitor->lock);
}
-
+
GlobusGFSFileDebugExit();
return;
@@ -3394,11 +3391,11 @@ globus_l_gfs_file_send(
globus_xio_file_flag_t open_flags;
GlobusGFSName(globus_l_gfs_file_send);
GlobusGFSFileDebugEnter();
-
+
globus_gridftp_server_get_optimal_concurrency(op, &optimal_count);
globus_gridftp_server_get_block_size(op, &block_size);
globus_assert(optimal_count > 0 && block_size > 0);
-
+
result = globus_l_gfs_file_monitor_init(
&monitor, block_size, optimal_count);
if(result != GLOBUS_SUCCESS)
@@ -3407,7 +3404,7 @@ globus_l_gfs_file_send(
"globus_l_gfs_file_monitor_init", result);
goto error_alloc;
}
-
+
while(optimal_count--)
{
globus_byte_t * buffer;
@@ -3428,14 +3425,14 @@ globus_l_gfs_file_send(
result = GlobusGFSErrorWrapFailed("globus_l_gfs_file_open", result);
goto error_open;
}
-
+
GlobusGFSFileDebugExit();
return;
error_open:
globus_l_gfs_file_monitor_destroy(monitor);
-
-error_alloc:
+
+error_alloc:
globus_gridftp_server_finished_transfer(op, result);
GlobusGFSFileDebugExitWithError();
@@ -3450,7 +3447,7 @@ globus_l_gfs_file_event(
globus_l_file_monitor_t * monitor;
GlobusGFSName(globus_l_gfs_file_event);
GlobusGFSFileDebugEnter();
-
+
monitor = (globus_l_file_monitor_t *) event_info->event_arg;
switch(event_info->type)
@@ -3461,18 +3458,18 @@ globus_l_gfs_file_event(
monitor->aborted = GLOBUS_TRUE;
}
globus_mutex_unlock(&monitor->lock);
-
+
globus_xio_handle_cancel_operations(
monitor->file_handle,
- GLOBUS_XIO_CANCEL_OPEN |
+ GLOBUS_XIO_CANCEL_OPEN |
GLOBUS_XIO_CANCEL_READ |
GLOBUS_XIO_CANCEL_WRITE);
break;
-
+
default:
break;
}
-
+
GlobusGFSFileDebugExit();
}
@@ -3540,7 +3537,7 @@ static
int
globus_l_gfs_file_deactivate(void);
-static globus_gfs_storage_iface_t globus_l_gfs_file_dsi_iface =
+static globus_gfs_storage_iface_t globus_l_gfs_file_dsi_iface =
{
GLOBUS_GFS_DSI_DESCRIPTOR_SENDER | GLOBUS_GFS_DSI_DESCRIPTOR_HAS_REALPATH,
globus_l_gfs_file_init,
@@ -3552,7 +3549,7 @@ static globus_gfs_storage_iface_t globus_l_gfs_file_dsi_iface =
NULL, /* active */
NULL, /* passive */
NULL, /* data destroy */
- globus_l_gfs_file_command,
+ globus_l_gfs_file_command,
globus_l_gfs_file_stat,
NULL,
NULL,
@@ -3577,13 +3574,13 @@ globus_l_gfs_file_activate(void)
{
goto error_activate;
}
-
+
if(globus_xio_driver_load(
"file", &globus_l_gfs_file_driver) != GLOBUS_SUCCESS)
{
goto error_load_file;
}
-
+
globus_extension_registry_add(
GLOBUS_GFS_DSI_REGISTRY,
"file",
@@ -3592,12 +3589,12 @@ globus_l_gfs_file_activate(void)
GlobusDebugInit(GLOBUS_GRIDFTP_SERVER_FILE,
ERROR WARNING TRACE INTERNAL_TRACE INFO STATE INFO_VERBOSE);
-
+
return GLOBUS_SUCCESS;
-
+
error_load_file:
globus_module_deactivate(GLOBUS_XIO_MODULE);
-
+
error_activate:
return GLOBUS_FAILURE;
}
@@ -3608,8 +3605,8 @@ globus_l_gfs_file_deactivate(void)
{
globus_extension_registry_remove(
GLOBUS_GFS_DSI_REGISTRY, "file");
-
+
globus_xio_driver_unload(globus_l_gfs_file_driver);
-
+
return globus_module_deactivate(GLOBUS_XIO_MODULE);
}
diff --git a/gridftp/server/src/modules/remote/globus_gridftp_server_remote.c b/gridftp/server/src/modules/remote/globus_gridftp_server_remote.c
index 99721dda25..85d0969fac 100644
--- a/gridftp/server/src/modules/remote/globus_gridftp_server_remote.c
+++ b/gridftp/server/src/modules/remote/globus_gridftp_server_remote.c
@@ -22,18 +22,18 @@ GlobusDebugDeclare(GLOBUS_GRIDFTP_SERVER_REMOTE);
#define BRAIN_RETRY 256
#define GlobusGFSRemoteDebugPrintf(level, message) \
- GlobusDebugPrintf(GLOBUS_GRIDFTP_SERVER_REMOTE, level, message)
-
+ GlobusDebugPrintf(GLOBUS_GRIDFTP_SERVER_REMOTE, level, message)
+
#define GlobusGFSRemoteDebugEnter() \
GlobusGFSRemoteDebugPrintf( \
GLOBUS_GFS_DEBUG_TRACE, \
- ("[%s] Entering\n", _gfs_name))
-
+ ("[%s] Entering\n", _gfs_name))
+
#define GlobusGFSRemoteDebugExit() \
GlobusGFSRemoteDebugPrintf( \
GLOBUS_GFS_DEBUG_TRACE, \
- ("[%s] Exiting\n", _gfs_name))
-
+ ("[%s] Exiting\n", _gfs_name))
+
#define GlobusGFSRemoteDebugExitWithError() \
GlobusGFSRemoteDebugPrintf( \
GLOBUS_GFS_DEBUG_TRACE, \
@@ -71,7 +71,7 @@ typedef struct globus_l_gfs_remote_ipc_bounce_s
int begin_event_pending;
int event_pending;
int * eof_count;
- globus_l_gfs_remote_node_handle_t * node_handle;
+ globus_l_gfs_remote_node_handle_t * node_handle;
int partial_eof_counts;
globus_bool_t recv_pending;
int nodes_requesting;
@@ -93,7 +93,7 @@ typedef void
typedef struct globus_l_gfs_remote_node_info_s
{
globus_gfs_ipc_handle_t ipc_handle;
- globus_l_gfs_remote_node_handle_t * node_handle;
+ globus_l_gfs_remote_node_handle_t * node_handle;
struct globus_l_gfs_remote_ipc_bounce_s * bounce;
char * cs;
void * data_arg;
@@ -127,7 +127,7 @@ typedef enum
GLOBUS_L_GFS_REMOTE_STRIPED_ONE_TO_ONE = 1,
GLOBUS_L_GFS_REMOTE_STRIPED_ALL_TO_ALL
} globus_l_gfs_remote_striped_mode_t;
-
+
typedef struct globus_l_gfs_remote_control_node_bounce_s
{
globus_l_gfs_remote_handle_t * my_handle;
@@ -156,7 +156,7 @@ do \
_op, \
_result, \
&_finished_info); \
-} while(0)
+} while(0)
static
void
@@ -176,7 +176,7 @@ globus_l_gfs_remote_node_release(
{
GlobusGFSName(globus_l_gfs_remote_node_release);
GlobusGFSRemoteDebugEnter();
-
+
if(node_info->my_handle->control_node != node_info)
{
globus_gfs_brain_release_node(
@@ -200,7 +200,7 @@ globus_l_gfs_remote_node_release(
GlobusGFSRemoteDebugExit();
return GLOBUS_SUCCESS;
-}
+}
static
void
@@ -233,7 +233,7 @@ globus_l_gfs_remote_node_request_kickout(
globus_l_gfs_remote_node_info_t * node_info;
GlobusGFSName(globus_l_gfs_remote_node_request_kickout);
GlobusGFSRemoteDebugEnter();
-
+
node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
/* LOCKS! */
@@ -269,7 +269,7 @@ globus_l_gfs_remote_node_request_kickout(
int cs_len = 1;
globus_i_gfs_brain_node_t ** brain_node_array;
globus_gfs_log_result(
- GLOBUS_GFS_LOG_WARN,
+ GLOBUS_GFS_LOG_WARN,
"could not get initially requested node, trying another",
result);
/* select a new set of nodes */
@@ -302,13 +302,13 @@ globus_l_gfs_remote_node_request_kickout(
{
callback = GLOBUS_TRUE;
}
- globus_free(brain_node_array);
+ globus_free(brain_node_array);
}
}
}
if(callback)
- {
+ {
node_info->callback(
node_info,
result,
@@ -347,16 +347,16 @@ globus_l_gfs_remote_node_request_fake_kickout(
globus_l_gfs_remote_control_node_bounce_t * bounce;
GlobusGFSName(globus_l_gfs_remote_node_request_fake_kickout);
GlobusGFSRemoteDebugEnter();
-
+
bounce = (globus_l_gfs_remote_control_node_bounce_t *) user_arg;
-
+
bounce->callback(
bounce->my_handle->control_node,
GLOBUS_SUCCESS,
bounce->user_arg);
globus_free(bounce);
-
+
GlobusGFSRemoteDebugExit();
}
@@ -465,7 +465,7 @@ globus_l_gfs_remote_select_nodes(
node_info->user_arg = user_arg;
node_info->my_handle = my_handle;
bounce->ndx_offset++;
-
+
my_handle->session_info.host_id = node_info->brain_node->host_id;
result = globus_gfs_ipc_handle_obtain(
&my_handle->session_info,
@@ -497,7 +497,7 @@ globus_l_gfs_remote_select_nodes(
static
-globus_result_t
+globus_result_t
globus_l_gfs_remote_node_request(
globus_l_gfs_remote_handle_t * my_handle,
int num_nodes,
@@ -527,7 +527,7 @@ globus_l_gfs_remote_node_request(
nodes_created = 1;
ndx_offset = 1;
-
+
result = globus_callback_register_oneshot(
NULL,
NULL,
@@ -540,9 +540,9 @@ globus_l_gfs_remote_node_request(
}
}
num_nodes -= nodes_created;
-
+
if(num_nodes > 0 || nodes_created == 0)
- {
+ {
bounce = (globus_l_gfs_remote_control_node_bounce_t *) globus_calloc(
1, sizeof(globus_l_gfs_remote_control_node_bounce_t));
bounce->my_handle = my_handle;
@@ -562,7 +562,7 @@ globus_l_gfs_remote_node_request(
error:
GlobusGFSRemoteDebugExitWithError();
return result;
-}
+}
static
void
@@ -575,7 +575,7 @@ globus_l_gfs_ipc_finished_cb(
globus_l_gfs_remote_ipc_bounce_t * bounce_info;
GlobusGFSName(globus_l_gfs_ipc_finished_cb);
GlobusGFSRemoteDebugEnter();
-
+
bounce_info = (globus_l_gfs_remote_ipc_bounce_t *) user_arg;
globus_gridftp_server_operation_finished(
@@ -609,7 +609,7 @@ globus_l_gfs_ipc_passive_cb(
GlobusGFSName(globus_l_gfs_ipc_passive_cb);
GlobusGFSRemoteDebugEnter();
- node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
+ node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
bounce_info = node_info->bounce;
my_handle = bounce_info->my_handle;
@@ -618,7 +618,7 @@ globus_l_gfs_ipc_passive_cb(
bounce_info->cached_result = reply->result;
}
else
- {
+ {
/* XXX this is suspect if we chain DSIs another step */
node_info->cs = globus_libc_strdup(
reply->info.data.contact_strings[0]);
@@ -633,7 +633,7 @@ globus_l_gfs_ipc_passive_cb(
bounce_info->nodes_obtained++;
}
- /* if we got 'em all */
+ /* if we got 'em all */
if(!bounce_info->nodes_pending && !bounce_info->nodes_requesting)
{
globus_l_gfs_remote_node_info_t ** node_array;
@@ -644,10 +644,10 @@ globus_l_gfs_ipc_passive_cb(
{
goto error;
}
-
+
memcpy(&finished_info, reply, sizeof(globus_gfs_finished_info_t));
- finished_info.info.data.data_arg = bounce_info->node_handle;
+ finished_info.info.data.data_arg = bounce_info->node_handle;
finished_info.info.data.cs_count = bounce_info->nodes_obtained;
/* gotta do some smushin' */
@@ -659,27 +659,27 @@ globus_l_gfs_ipc_passive_cb(
finished_info.info.data.cs_count);
for(i = 0; i < bounce_info->node_handle->count; i++)
{
- node_info = (globus_l_gfs_remote_node_info_t *)
+ node_info = (globus_l_gfs_remote_node_info_t *)
bounce_info->node_handle->nodes[i];
if(node_info != NULL)
{
- if(bounce_info->my_handle->striped_mode ==
+ if(bounce_info->my_handle->striped_mode ==
GLOBUS_L_GFS_REMOTE_STRIPED_ONE_TO_ONE)
{
node_info->stripe_count = 1;
}
else
{
- node_info->stripe_count =
+ node_info->stripe_count =
finished_info.info.data.cs_count;
}
/* XXX handle case where cs_count from a single node > 1 */
node_array[ndx] = node_info;
- finished_info.info.data.contact_strings[ndx] =
+ finished_info.info.data.contact_strings[ndx] =
node_info->cs;
node_info->cs = NULL;
-
+
if(node_info->info && node_info->info_needs_free)
{
globus_free(node_info->info);
@@ -696,7 +696,7 @@ globus_l_gfs_ipc_passive_cb(
}
}
globus_mutex_unlock(&my_handle->mutex);
-
+
if(finished)
{
@@ -709,12 +709,12 @@ globus_l_gfs_ipc_passive_cb(
for(ndx = 0; ndx < finished_info.info.data.cs_count; ndx++)
{
globus_free((void *) finished_info.info.data.contact_strings[ndx]);
- }
+ }
globus_free(finished_info.info.data.contact_strings);
-
+
globus_free(bounce_info);
}
-
+
GlobusGFSRemoteDebugExit();
return;
error:
@@ -743,19 +743,19 @@ globus_l_gfs_ipc_active_cb(
GlobusGFSRemoteDebugEnter();
- node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
+ node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
bounce_info = node_info->bounce;
node_info->data_arg = reply->info.data.data_arg;
my_handle = bounce_info->my_handle;
- if(bounce_info->my_handle->striped_mode ==
+ if(bounce_info->my_handle->striped_mode ==
GLOBUS_L_GFS_REMOTE_STRIPED_ONE_TO_ONE)
{
node_info->stripe_count = 1;
}
else
{
- node_info->stripe_count =
+ node_info->stripe_count =
((globus_gfs_data_info_t *) bounce_info->state)->cs_count;
}
@@ -766,7 +766,7 @@ globus_l_gfs_ipc_active_cb(
{
bounce_info->nodes_obtained++;
}
- /* in the failure case it is just an unobtained node, if we
+ /* in the failure case it is just an unobtained node, if we
got 0 it will be an error */
/* if this is the last one */
@@ -774,7 +774,7 @@ globus_l_gfs_ipc_active_cb(
&& bounce_info->nodes_requesting == 0)
{
finished = GLOBUS_TRUE;
-
+
/* if we failed to get any succesfully */
if(bounce_info->nodes_obtained == 0)
{
@@ -801,7 +801,7 @@ globus_l_gfs_ipc_active_cb(
globus_free(node_info->info);
node_info->info = NULL;
node_info->info_needs_free = GLOBUS_FALSE;
- }
+ }
}
}
}
@@ -813,7 +813,7 @@ globus_l_gfs_ipc_active_cb(
globus_gridftp_server_operation_finished(
bounce_info->op,
finished_info.result,
- &finished_info);
+ &finished_info);
globus_free(bounce_info);
}
@@ -849,7 +849,7 @@ globus_l_gfs_ipc_transfer_cb(
node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
bounce_info = node_info->bounce;
my_handle = bounce_info->my_handle;
-
+
globus_mutex_lock(&my_handle->mutex);
{
bounce_info->nodes_pending--;
@@ -857,13 +857,13 @@ globus_l_gfs_ipc_transfer_cb(
{
bounce_info->cached_result = reply->result;
}
-
+
/* wait for all the nodes to return, or if recving and we get an error
- before the first begin_cb we quit right now */
- if((!bounce_info->nodes_pending && !bounce_info->nodes_requesting) ||
+ before the first begin_cb we quit right now */
+ if((!bounce_info->nodes_pending && !bounce_info->nodes_requesting) ||
(bounce_info->cached_result != GLOBUS_SUCCESS &&
bounce_info->recv_pending))
- {
+ {
memset(&finished_info, '\0', sizeof(globus_gfs_finished_info_t));
finished_info.type = reply->type;
finished_info.id = reply->id;
@@ -872,15 +872,15 @@ globus_l_gfs_ipc_transfer_cb(
finished_info.result = bounce_info->cached_result;
finish = GLOBUS_TRUE;
op = bounce_info->op;
-
+
if(!bounce_info->events_enabled)
{
globus_l_gfs_remote_node_info_t * node_info;
-
+
for(i = 0; i < bounce_info->node_handle->count; i++)
{
node_info = bounce_info->node_handle->nodes[i];
-
+
if(node_info->info && node_info->info_needs_free)
{
globus_free(node_info->info);
@@ -893,17 +893,17 @@ globus_l_gfs_ipc_transfer_cb(
globus_free(bounce_info->eof_count);
}
globus_free(bounce_info);
- }
+ }
}
}
globus_mutex_unlock(&my_handle->mutex);
-
+
if(finish)
{
globus_gridftp_server_operation_finished(
op,
finished_info.result,
- &finished_info);
+ &finished_info);
}
GlobusGFSRemoteDebugExit();
@@ -926,12 +926,11 @@ globus_l_gfs_ipc_event_cb(
globus_l_gfs_remote_node_info_t * node_info;
globus_gfs_transfer_info_t * info;
globus_gfs_event_info_t event_info;
- globus_result_t result;
int ctr;
GlobusGFSName(globus_l_gfs_ipc_event_cb);
GlobusGFSRemoteDebugEnter();
-
- node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
+
+ node_info = (globus_l_gfs_remote_node_info_t *) user_arg;
bounce_info = node_info->bounce;
my_handle = bounce_info->my_handle;
@@ -954,12 +953,12 @@ globus_l_gfs_ipc_event_cb(
{
bounce_info->events_enabled = GLOBUS_TRUE;
reply->event_arg = bounce_info;
- reply->event_mask =
- GLOBUS_GFS_EVENT_TRANSFER_ABORT |
+ reply->event_mask =
+ GLOBUS_GFS_EVENT_TRANSFER_ABORT |
GLOBUS_GFS_EVENT_TRANSFER_COMPLETE |
GLOBUS_GFS_EVENT_BYTES_RECVD |
GLOBUS_GFS_EVENT_RANGES_RECVD;
-
+
globus_gridftp_server_operation_event(
bounce_info->op,
GLOBUS_SUCCESS,
@@ -969,7 +968,7 @@ globus_l_gfs_ipc_event_cb(
break;
case GLOBUS_GFS_EVENT_TRANSFER_CONNECTED:
bounce_info->event_pending--;
- if(!bounce_info->event_pending &&
+ if(!bounce_info->event_pending &&
!bounce_info->recv_pending &&
!bounce_info->nodes_requesting)
{
@@ -982,7 +981,7 @@ globus_l_gfs_ipc_event_cb(
{
node_info = bounce_info->node_handle->nodes[i];
info = (globus_gfs_transfer_info_t *) node_info->info;
-
+
if(node_info->ipc_handle == ipc_handle)
{
globus_assert(
@@ -996,11 +995,11 @@ globus_l_gfs_ipc_event_cb(
}
}
for(ctr = 0; ctr < reply->node_count; ctr++)
- {
+ {
bounce_info->eof_count[ctr] += reply->eof_count[ctr];
}
bounce_info->partial_eof_counts++;
- if(bounce_info->partial_eof_counts + 1 ==
+ if(bounce_info->partial_eof_counts + 1 ==
bounce_info->node_count && !bounce_info->finished)
{
memset(&event_info, '\0', sizeof(globus_gfs_event_info_t));
@@ -1008,14 +1007,14 @@ globus_l_gfs_ipc_event_cb(
event_info.event_arg = master_node->event_arg;
event_info.eof_count = bounce_info->eof_count;
event_info.node_count = bounce_info->partial_eof_counts + 1;
- result = globus_gfs_ipc_request_transfer_event(
+ globus_gfs_ipc_request_transfer_event(
master_node->ipc_handle,
&event_info);
bounce_info->final_eof++;
- }
+ }
break;
default:
- if(!bounce_info->event_pending ||
+ if(!bounce_info->event_pending ||
reply->type == GLOBUS_GFS_EVENT_BYTES_RECVD ||
reply->type == GLOBUS_GFS_EVENT_RANGES_RECVD)
{
@@ -1027,14 +1026,14 @@ globus_l_gfs_ipc_event_cb(
globus_mutex_unlock(&my_handle->mutex);
if(finish)
- {
+ {
reply->event_arg = bounce_info;
globus_gridftp_server_operation_event(
bounce_info->op,
GLOBUS_SUCCESS,
reply);
}
-
+
GlobusGFSRemoteDebugExit();
}
@@ -1050,7 +1049,7 @@ globus_l_gfs_remote_init_bounce_info(
globus_result_t result;
GlobusGFSName(globus_l_gfs_remote_init_bounce_info);
GlobusGFSRemoteDebugEnter();
-
+
bounce_info = (globus_l_gfs_remote_ipc_bounce_t *)
globus_calloc(1, sizeof(globus_l_gfs_remote_ipc_bounce_t));
if(!bounce_info)
@@ -1058,12 +1057,12 @@ globus_l_gfs_remote_init_bounce_info(
result = GlobusGFSErrorMemory("bounce_info");
goto error_alloc;
}
-
+
bounce_info->op = op;
bounce_info->state = state;
bounce_info->my_handle = my_handle;
*bounce = bounce_info;
-
+
GlobusGFSRemoteDebugExit();
return GLOBUS_SUCCESS;
@@ -1084,9 +1083,9 @@ globus_l_gfs_remote_stat(
globus_l_gfs_remote_handle_t * my_handle;
GlobusGFSName(globus_l_gfs_remote_stat);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
-
+
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, stat_info, my_handle);
@@ -1119,7 +1118,7 @@ globus_l_gfs_remote_command(
GlobusGFSRemoteDebugEnter();
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
-
+
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, command_info, my_handle);
@@ -1151,20 +1150,20 @@ globus_l_gfs_remote_list(
globus_l_gfs_remote_node_info_t * node_info;
GlobusGFSName(globus_l_gfs_remote_list);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
- /* XXX it appears no lock is needed here */
+ /* XXX it appears no lock is needed here */
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, transfer_info, my_handle);
- globus_free(bounce_info->node_handle);
-
- bounce_info->node_handle = (globus_l_gfs_remote_node_handle_t *)
+ globus_free(bounce_info->node_handle);
+
+ bounce_info->node_handle = (globus_l_gfs_remote_node_handle_t *)
transfer_info->data_arg;
bounce_info->node_handle->destroy++;
-
+
node_info = bounce_info->node_handle->nodes[0];
-
+
transfer_info->data_arg = node_info->data_arg;
transfer_info->stripe_count = 1;
transfer_info->node_ndx = 0;
@@ -1176,13 +1175,13 @@ globus_l_gfs_remote_list(
node_info->info = NULL;
node_info->info_needs_free = GLOBUS_FALSE;
node_info->bounce = bounce_info;
-
+
result = globus_gfs_ipc_request_list(
node_info->ipc_handle,
transfer_info,
globus_l_gfs_ipc_transfer_cb,
globus_l_gfs_ipc_event_cb,
- node_info);
+ node_info);
if(result != GLOBUS_SUCCESS)
{
GlobusGFSErrorOpFinished(
@@ -1207,21 +1206,21 @@ globus_l_gfs_remote_recv_next(
int ndx = 1;
GlobusGFSName(globus_l_gfs_remote_recv_next);
GlobusGFSRemoteDebugEnter();
-
+
/* already sent recv to node 0, now send the rest */
transfer_info = (globus_gfs_transfer_info_t *) bounce_info->state;
-
+
node_count = bounce_info->node_handle->count;
-
+
for(i = 1; i < bounce_info->node_handle->count; i++)
{
node_info = bounce_info->node_handle->nodes[i];
-
+
new_transfer_info = (globus_gfs_transfer_info_t *)
globus_calloc(1, sizeof(globus_gfs_transfer_info_t));
- memcpy(new_transfer_info, transfer_info,
+ memcpy(new_transfer_info, transfer_info,
sizeof(globus_gfs_transfer_info_t));
-
+
new_transfer_info->truncate = GLOBUS_FALSE;
new_transfer_info->data_arg = node_info->data_arg;
new_transfer_info->node_count = node_count;
@@ -1238,7 +1237,7 @@ globus_l_gfs_remote_recv_next(
new_transfer_info,
globus_l_gfs_ipc_transfer_cb,
globus_l_gfs_ipc_event_cb,
- node_info);
+ node_info);
if(result != GLOBUS_SUCCESS)
{
if(bounce_info->nodes_pending > 0)
@@ -1256,7 +1255,7 @@ globus_l_gfs_remote_recv_next(
bounce_info->event_pending++;
bounce_info->begin_event_pending++;
}
-
+
bounce_info->recv_pending = GLOBUS_FALSE;
GlobusGFSRemoteDebugExit();
@@ -1280,23 +1279,23 @@ globus_l_gfs_remote_recv(
int node_count;
GlobusGFSName(globus_l_gfs_remote_recv);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
globus_mutex_lock(&my_handle->mutex);
{
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, transfer_info, my_handle);
-
- bounce_info->node_handle = (globus_l_gfs_remote_node_handle_t *)
+
+ bounce_info->node_handle = (globus_l_gfs_remote_node_handle_t *)
transfer_info->data_arg;
/* only going to do the first recv request here, the others
- will be sent after this one responds with the begin event
-
- we need to do this primarily to make sure the file is opened
+ will be sent after this one responds with the begin event
+
+ we need to do this primarily to make sure the file is opened
in TRUNC mode only the first time */
-
+
bounce_info->node_handle->destroy++;
node_count = bounce_info->node_handle->count;
if(node_count > 1)
@@ -1305,9 +1304,9 @@ globus_l_gfs_remote_recv(
}
bounce_info->nodes_requesting = node_count;
bounce_info->node_count = node_count;
-
+
node_info = bounce_info->node_handle->nodes[0];
-
+
new_transfer_info = (globus_gfs_transfer_info_t *)
globus_calloc(1, sizeof(globus_gfs_transfer_info_t));
memcpy(new_transfer_info,transfer_info,
@@ -1326,14 +1325,14 @@ globus_l_gfs_remote_recv(
new_transfer_info,
globus_l_gfs_ipc_transfer_cb,
globus_l_gfs_ipc_event_cb,
- node_info);
+ node_info);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
/* could maybe get away with no lock if we moved the next few lines
- above the request. we would have to then assume that the
- values were meaningless under error. This way is more
+ above the request. we would have to then assume that the
+ values were meaningless under error. This way is more
consistant and the lock is not very costly */
bounce_info->nodes_pending++;
bounce_info->event_pending++;
@@ -1368,21 +1367,21 @@ globus_l_gfs_remote_send(
int i;
GlobusGFSName(globus_l_gfs_remote_send);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
globus_mutex_lock(&my_handle->mutex);
{
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, transfer_info, my_handle);
-
+
bounce_info->node_handle = (globus_l_gfs_remote_node_handle_t *)
transfer_info->data_arg;
bounce_info->node_handle->destroy++;
node_count = bounce_info->node_handle->count;
- bounce_info->eof_count = (int *)
+ bounce_info->eof_count = (int *)
globus_calloc(1, node_count * sizeof(int) + 1);
bounce_info->nodes_requesting = node_count;
@@ -1391,12 +1390,12 @@ globus_l_gfs_remote_send(
for(i = 0; i < bounce_info->node_handle->count; i++)
{
node_info = bounce_info->node_handle->nodes[i];
-
+
new_transfer_info = (globus_gfs_transfer_info_t *)
globus_calloc(1, sizeof(globus_gfs_transfer_info_t));
memcpy(new_transfer_info,
transfer_info, sizeof(globus_gfs_transfer_info_t));
-
+
new_transfer_info->data_arg = node_info->data_arg;
new_transfer_info->node_count = node_count;
new_transfer_info->stripe_count = node_info->stripe_count;
@@ -1404,17 +1403,17 @@ globus_l_gfs_remote_send(
node_info->info = new_transfer_info;
node_info->info_needs_free = GLOBUS_TRUE;
node_info->bounce = bounce_info;
-
+
bounce_info->nodes_pending++;
bounce_info->event_pending++;
bounce_info->begin_event_pending++;
-
+
result = globus_gfs_ipc_request_send(
node_info->ipc_handle,
new_transfer_info,
globus_l_gfs_ipc_transfer_cb,
globus_l_gfs_ipc_event_cb,
- node_info);
+ node_info);
if(result != GLOBUS_SUCCESS)
{
/* if some callbacks are pending we need to wait for the
@@ -1473,17 +1472,17 @@ globus_l_gfs_remote_active_kickout(
new_data_info = (globus_gfs_data_info_t *)
globus_calloc(1, sizeof(globus_gfs_data_info_t));
-
+
memcpy(
new_data_info, bounce_info->state, sizeof(globus_gfs_data_info_t));
- if(bounce_info->my_handle->striped_mode ==
+ if(bounce_info->my_handle->striped_mode ==
GLOBUS_L_GFS_REMOTE_STRIPED_ONE_TO_ONE)
{
new_data_info->cs_count = 1;
- new_data_info->contact_strings =
+ new_data_info->contact_strings =
(const char **) calloc(1, sizeof(char *));
- new_data_info->contact_strings[0] =
+ new_data_info->contact_strings[0] =
globus_libc_strdup(
data_info->contact_strings[bounce_info->node_ndx]);
}
@@ -1494,7 +1493,7 @@ globus_l_gfs_remote_active_kickout(
node_info->ipc_handle,
new_data_info,
globus_l_gfs_ipc_active_cb,
- node_info);
+ node_info);
if(result != GLOBUS_SUCCESS)
{
goto error;
@@ -1540,14 +1539,14 @@ globus_l_gfs_remote_active(
int num_nodes;
GlobusGFSName(globus_l_gfs_remote_active);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
globus_mutex_lock(&my_handle->mutex);
- {
+ {
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, data_info, my_handle);
-
+
num_nodes = data_info->cs_count;
bounce_info->node_handle = (globus_l_gfs_remote_node_handle_t *)
@@ -1563,7 +1562,7 @@ globus_l_gfs_remote_active(
num_nodes,
NULL,
globus_l_gfs_remote_active_kickout,
- bounce_info);
+ bounce_info);
if(result != GLOBUS_SUCCESS)
{
goto error;
@@ -1592,12 +1591,12 @@ globus_l_gfs_remote_passive_kickout(
globus_l_gfs_remote_ipc_bounce_t * bounce_info;
GlobusGFSName(globus_l_gfs_remote_passive_kickout);
GlobusGFSRemoteDebugEnter();
-
+
bounce_info = (globus_l_gfs_remote_ipc_bounce_t *) user_arg;
my_handle = (globus_l_gfs_remote_handle_t *) bounce_info->my_handle;
globus_mutex_lock(&my_handle->mutex);
- {
+ {
bounce_info->nodes_requesting--;
if(result != GLOBUS_SUCCESS)
{
@@ -1651,9 +1650,9 @@ globus_l_gfs_remote_passive(
int num_nodes;
GlobusGFSName(globus_l_gfs_remote_passive);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
-
+
result = globus_l_gfs_remote_init_bounce_info(
&bounce_info, op, data_info, my_handle);
@@ -1677,7 +1676,7 @@ globus_l_gfs_remote_passive(
bounce_info->nodes_requesting,
NULL,
globus_l_gfs_remote_passive_kickout,
- bounce_info);
+ bounce_info);
if(result != GLOBUS_SUCCESS)
{
goto error;
@@ -1713,24 +1712,24 @@ globus_l_gfs_remote_data_destroy(
globus_l_gfs_remote_node_handle_t * node_handle;
GlobusGFSName(globus_l_gfs_remote_data_destroy);
GlobusGFSRemoteDebugEnter();
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
node_handle = (globus_l_gfs_remote_node_handle_t *) data_arg;
globus_mutex_lock(&my_handle->mutex);
- {
+ {
for(i = 0; i < node_handle->count; i++)
{
node_info = (globus_l_gfs_remote_node_info_t *)
node_handle->nodes[i];
-
+
result = globus_gfs_ipc_request_data_destroy(
node_info->ipc_handle,
- node_info->data_arg);
+ node_info->data_arg);
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_result(
- GLOBUS_GFS_LOG_ERR,
+ GLOBUS_GFS_LOG_ERR,
"IPC ERROR: remote_data_destroy: ipc call", result);
}
if(node_info->cs != NULL)
@@ -1761,7 +1760,7 @@ globus_l_gfs_remote_data_destroy(
{
globus_free(node_handle->nodes);
globus_free(node_handle);
- }
+ }
GlobusGFSRemoteDebugExit();
}
@@ -1774,7 +1773,6 @@ globus_l_gfs_remote_trev(
{
globus_bool_t free_node = GLOBUS_FALSE;
int i;
- globus_result_t result;
globus_l_gfs_remote_handle_t * my_handle;
globus_l_gfs_remote_node_info_t * node_info;
globus_gfs_event_info_t new_event_info;
@@ -1782,11 +1780,11 @@ globus_l_gfs_remote_trev(
globus_l_gfs_remote_node_handle_t * free_nh = NULL;
GlobusGFSName(globus_l_gfs_remote_trev);
GlobusGFSRemoteDebugEnter();
-
+
bounce_info = (globus_l_gfs_remote_ipc_bounce_t *) event_info->event_arg;
-
+
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
-
+
memset(&new_event_info, '\0', sizeof(globus_gfs_event_info_t));
new_event_info.type = event_info->type;
@@ -1795,13 +1793,13 @@ globus_l_gfs_remote_trev(
node_info = bounce_info->node_handle->nodes[i];
new_event_info.event_arg = node_info->event_arg;
- result = globus_gfs_ipc_request_transfer_event(
+ globus_gfs_ipc_request_transfer_event(
node_info->ipc_handle,
&new_event_info);
}
-
+
globus_mutex_lock(&my_handle->mutex);
- {
+ {
if(event_info->type == GLOBUS_GFS_EVENT_TRANSFER_COMPLETE)
{
for(i = 0; i < bounce_info->node_handle->count; i++)
@@ -1848,7 +1846,7 @@ globus_l_gfs_remote_session_start_kickout(
void * user_arg)
{
globus_l_gfs_remote_handle_t * my_handle;
- globus_gfs_finished_info_t finished_info;
+ globus_gfs_finished_info_t finished_info;
GlobusGFSName(globus_l_gfs_remote_session_start_kickout);
GlobusGFSRemoteDebugEnter();
@@ -1856,40 +1854,40 @@ globus_l_gfs_remote_session_start_kickout(
with this handle until we signal it has started */
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
-
+
if(result != GLOBUS_SUCCESS)
{
goto error;
}
memset(&finished_info, '\0', sizeof(globus_gfs_finished_info_t));
- finished_info.type = GLOBUS_GFS_OP_SESSION_START;
- finished_info.result = result;
+ finished_info.type = GLOBUS_GFS_OP_SESSION_START;
+ finished_info.result = result;
finished_info.info.session.session_arg = my_handle;
- finished_info.info.session.username = node_info->username;
- finished_info.info.session.home_dir = node_info->home_dir;
+ finished_info.info.session.username = node_info->username;
+ finished_info.info.session.home_dir = node_info->home_dir;
my_handle->control_node = node_info;
- globus_gridftp_server_operation_finished(
- my_handle->op,
- result,
+ globus_gridftp_server_operation_finished(
+ my_handle->op,
+ result,
&finished_info);
GlobusGFSRemoteDebugExit();
return;
-
-error:
+
+error:
memset(&finished_info, '\0', sizeof(globus_gfs_finished_info_t));
finished_info.type = GLOBUS_GFS_OP_SESSION_START;
finished_info.result = result;
- globus_gridftp_server_operation_finished(
- my_handle->op,
- finished_info.result,
+ globus_gridftp_server_operation_finished(
+ my_handle->op,
+ finished_info.result,
&finished_info);
-
+
GlobusGFSRemoteDebugExitWithError();
-}
+}
static
void
@@ -1902,8 +1900,8 @@ globus_l_gfs_remote_session_start(
int nodes_requesting = 1;
GlobusGFSName(globus_l_gfs_remote_session_start);
GlobusGFSRemoteDebugEnter();
-
- my_handle = (globus_l_gfs_remote_handle_t *)
+
+ my_handle = (globus_l_gfs_remote_handle_t *)
globus_calloc(1, sizeof(globus_l_gfs_remote_handle_t));
globus_mutex_init(&my_handle->mutex, NULL);
my_handle->ipc_release_reason = GLOBUS_GFS_BRAIN_REASON_COMPLETE;
@@ -1935,7 +1933,7 @@ globus_l_gfs_remote_session_start(
{
GlobusGFSErrorOpFinished(op, GLOBUS_GFS_OP_SESSION_START, result);
}
-
+
GlobusGFSRemoteDebugExit();
}
@@ -1952,7 +1950,7 @@ globus_l_gfs_remote_session_end(
GlobusGFSRemoteDebugEnter();
my_handle = (globus_l_gfs_remote_handle_t *) user_arg;
-
+
if(my_handle == NULL)
{
goto error;
@@ -1965,10 +1963,10 @@ globus_l_gfs_remote_session_end(
if(result != GLOBUS_SUCCESS)
{
globus_gfs_log_result(
- GLOBUS_GFS_LOG_ERR,
+ GLOBUS_GFS_LOG_ERR,
"ERROR: remote_data_destroy: handle_release", result);
}
-
+
if(my_handle->session_info.username != NULL)
{
globus_free(my_handle->session_info.username);
@@ -1983,10 +1981,10 @@ globus_l_gfs_remote_session_end(
}
globus_mutex_destroy(&my_handle->mutex);
globus_free(my_handle);
-
+
GlobusGFSRemoteDebugExit();
return;
-
+
error:
GlobusGFSRemoteDebugExitWithError();
}
@@ -1999,7 +1997,7 @@ static
int
globus_l_gfs_remote_deactivate(void);
-static globus_gfs_storage_iface_t globus_l_gfs_remote_dsi_iface =
+static globus_gfs_storage_iface_t globus_l_gfs_remote_dsi_iface =
{
0,
globus_l_gfs_remote_session_start,
@@ -2011,7 +2009,7 @@ static globus_gfs_storage_iface_t globus_l_gfs_remote_dsi_iface =
globus_l_gfs_remote_active,
globus_l_gfs_remote_passive,
globus_l_gfs_remote_data_destroy,
- globus_l_gfs_remote_command,
+ globus_l_gfs_remote_command,
globus_l_gfs_remote_stat,
NULL,
NULL
@@ -2033,13 +2031,13 @@ globus_l_gfs_remote_activate(void)
{
int rc;
GlobusGFSName(globus_l_gfs_remote_activate);
-
+
rc = globus_module_activate(GLOBUS_COMMON_MODULE);
if(rc != GLOBUS_SUCCESS)
{
goto error;
}
-
+
globus_extension_registry_add(
GLOBUS_GFS_DSI_REGISTRY,
"remote",
@@ -2048,7 +2046,7 @@ globus_l_gfs_remote_activate(void)
GlobusDebugInit(GLOBUS_GRIDFTP_SERVER_REMOTE,
ERROR WARNING TRACE INTERNAL_TRACE INFO STATE INFO_VERBOSE);
-
+
return GLOBUS_SUCCESS;
error:
@@ -2060,11 +2058,11 @@ int
globus_l_gfs_remote_deactivate(void)
{
GlobusGFSName(globus_l_gfs_remote_deactivate);
-
+
globus_extension_registry_remove(
GLOBUS_GFS_DSI_REGISTRY, "remote");
-
+
globus_module_deactivate(GLOBUS_COMMON_MODULE);
-
+
return GLOBUS_SUCCESS;
}
diff --git a/gsi/callback/source/configure.ac b/gsi/callback/source/configure.ac
index e802c673e1..90ce6bfa14 100644
--- a/gsi/callback/source/configure.ac
+++ b/gsi/callback/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gsi_callback], [6.2],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gsi_callback], [6.3],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/callback/source/library/globus_gsi_callback.c b/gsi/callback/source/library/globus_gsi_callback.c
index ef03f93400..3178d5ce49 100644
--- a/gsi/callback/source/library/globus_gsi_callback.c
+++ b/gsi/callback/source/library/globus_gsi_callback.c
@@ -89,11 +89,11 @@ static int globus_i_gsi_callback_X509_STORE_callback_data_index = -1;
static int
globus_l_gsi_callback_openssl_new(
- void * parent,
- void * ptr,
+ void * parent,
+ void * ptr,
CRYPTO_EX_DATA * ad,
- int idx,
- long argl,
+ int idx,
+ long argl,
void * argp)
{
int result = 1;
@@ -105,18 +105,18 @@ globus_l_gsi_callback_openssl_new(
* since we can't allocate the ptr here
* this function isn't particularly useful
*/
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
return result;
}
static int
globus_l_gsi_callback_openssl_free(
- void * parent,
- void * ptr,
+ void * parent,
+ void * ptr,
CRYPTO_EX_DATA * ad,
- int idx,
- long argl,
+ int idx,
+ long argl,
void * argp)
{
int result = 1;
@@ -133,17 +133,17 @@ globus_l_gsi_callback_openssl_free(
static int
globus_l_gsi_callback_openssl_dup(
- CRYPTO_EX_DATA * to,
- CRYPTO_EX_DATA * from,
- void * from_d,
- int idx,
- long argl,
+ CRYPTO_EX_DATA * to,
+ CRYPTO_EX_DATA * from,
+ void * from_d,
+ int idx,
+ long argl,
void * argp)
{
int result = 1;
static char * _function_name_ =
"globus_gsi_callback_openssl_dup";
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
/* copy the callback data - currenlty not used by OpenSSL */
@@ -168,7 +168,7 @@ globus_l_gsi_callback_activate(void)
if(tmp_string != GLOBUS_NULL)
{
globus_i_gsi_callback_debug_level = atoi(tmp_string);
-
+
if(globus_i_gsi_callback_debug_level < 0)
{
globus_i_gsi_callback_debug_level = 0;
@@ -198,7 +198,7 @@ globus_l_gsi_callback_activate(void)
{
goto exit;
}
-
+
result = globus_module_activate(GLOBUS_GSI_SYSCONFIG_MODULE);
if(result != GLOBUS_SUCCESS)
@@ -215,14 +215,14 @@ globus_l_gsi_callback_activate(void)
globus_mutex_init(&globus_l_gsi_callback_oldgaa_mutex, NULL);
globus_mutex_init(&globus_l_gsi_callback_verify_mutex, NULL);
-
+
OpenSSL_add_all_algorithms();
if(globus_i_gsi_callback_X509_STORE_callback_data_index < 0)
{
- globus_i_gsi_callback_X509_STORE_callback_data_index =
+ globus_i_gsi_callback_X509_STORE_callback_data_index =
X509_STORE_CTX_get_ex_new_index(
- 0, NULL,
+ 0, NULL,
(CRYPTO_EX_new *) &globus_l_gsi_callback_openssl_new,
(CRYPTO_EX_dup *) &globus_l_gsi_callback_openssl_dup,
(CRYPTO_EX_free *) &globus_l_gsi_callback_openssl_free);
@@ -239,7 +239,7 @@ globus_l_gsi_callback_activate(void)
if(globus_i_gsi_callback_SSL_callback_data_index < 0)
{
globus_i_gsi_callback_SSL_callback_data_index = SSL_get_ex_new_index(
- 0, NULL,
+ 0, NULL,
(CRYPTO_EX_new *) &globus_l_gsi_callback_openssl_new,
(CRYPTO_EX_dup *) &globus_l_gsi_callback_openssl_dup,
(CRYPTO_EX_free *) &globus_l_gsi_callback_openssl_free);
@@ -304,7 +304,7 @@ globus_l_gsi_callback_deactivate(void)
* Will contain the index upon return
*
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -314,7 +314,7 @@ globus_gsi_callback_get_X509_STORE_callback_data_index(
globus_result_t result = GLOBUS_SUCCESS;
static char * _function_name_ =
"globus_gsi_callback_get_X509_STORE_callback_data_index";
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
*index = globus_i_gsi_callback_X509_STORE_callback_data_index;
@@ -334,7 +334,7 @@ globus_gsi_callback_get_X509_STORE_callback_data_index(
* Will contain the index upon return
*
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -344,9 +344,9 @@ globus_gsi_callback_get_SSL_callback_data_index(
globus_result_t result = GLOBUS_SUCCESS;
static char * _function_name_ =
"globus_gsi_callback_get_SSL_callback_data_index";
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
-
+
*index = globus_i_gsi_callback_SSL_callback_data_index;
@@ -370,7 +370,7 @@ globus_gsi_callback_get_SSL_callback_data_index(
* 1 on success
* 0 on failure
*/
-int
+int
globus_gsi_callback_X509_verify_cert(
X509_STORE_CTX * context,
void * arg)
@@ -391,15 +391,15 @@ globus_gsi_callback_X509_verify_cert(
X509_STORE_set_check_issued(X509_STORE_CTX_get0_store(context), globus_gsi_callback_check_issued);
#endif
/*
- * If this is not set, OpenSSL-0.9.8 assumes the proxy cert
+ * If this is not set, OpenSSL-0.9.8 assumes the proxy cert
* as an EEC and the next level cert in the chain as a CA cert
* and throws an invalid CA error. If we set this, the callback
- * (globus_gsi_callback_handshake_callback) gets called with
- * preverify_ok = 0 with an error "unhandled critical extension"
+ * (globus_gsi_callback_handshake_callback) gets called with
+ * preverify_ok = 0 with an error "unhandled critical extension"
* and "path length exceeded".
- * globus_i_gsi_callback_cred_verify() called by
- * globus_gsi_callback_handshake_callback() checks for these
- * errors and returns success. globus_i_gsi_callback_cred_verify()
+ * globus_i_gsi_callback_cred_verify() called by
+ * globus_gsi_callback_handshake_callback() checks for these
+ * errors and returns success. globus_i_gsi_callback_cred_verify()
* will check the critical extension later.
*/
#if defined(X509_V_FLAG_ALLOW_PROXY_CERTS)
@@ -423,12 +423,12 @@ globus_gsi_callback_X509_verify_cert(
*
* @param preverify_ok
* Communicates the result of default validation steps performed by
- * OpenSSL
+ * OpenSSL
* @param x509_context
* The validation state object
* @return
* 1 on success
- * 0 on failure
+ * 0 on failure
*/
int globus_gsi_callback_create_proxy_callback(
int preverify_ok,
@@ -438,7 +438,7 @@ int globus_gsi_callback_create_proxy_callback(
int verify_result;
globus_result_t result;
globus_gsi_callback_data_t callback_data;
- static char * _function_name_ =
+ static char * _function_name_ =
"globus_i_gsi_callback_create_proxy_callback";
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
@@ -449,10 +449,10 @@ int globus_gsi_callback_create_proxy_callback(
verify_result = 0;
goto exit;
}
-
+
callback_data = (globus_gsi_callback_data_t)
X509_STORE_CTX_get_ex_data(
- x509_context,
+ x509_context,
cb_index);
if(!callback_data)
@@ -498,12 +498,12 @@ int globus_gsi_callback_create_proxy_callback(
*
* @param preverify_ok
* Communicates the result of default validation steps performed by
- * OpenSSL
+ * OpenSSL
* @param x509_context
* The validation state object.
* @return
* 1 on success
- * 0 on failure
+ * 0 on failure
*/
int globus_gsi_callback_handshake_callback(
int preverify_ok,
@@ -514,7 +514,7 @@ int globus_gsi_callback_handshake_callback(
globus_result_t result;
globus_gsi_callback_data_t callback_data;
SSL * ssl = NULL;
- static char * _function_name_ =
+ static char * _function_name_ =
"globus_gsi_callback_handshake_callback";
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
@@ -567,7 +567,7 @@ int globus_gsi_callback_handshake_callback(
callback_data->error = result;
- exit:
+ exit:
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
return verify_result;
}
@@ -585,15 +585,22 @@ int globus_gsi_callback_handshake_callback(
* @param cert
* The certificate to check
* @param issuer
- * The issuer certificate to check
+ * The issuer certificate to check
* @return
* 1 on success
- * 0 on failure
+ * 0 on failure
*/
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
int globus_gsi_callback_check_issued(
X509_STORE_CTX * context,
X509 * cert,
X509 * issuer)
+#else
+int globus_gsi_callback_check_issued(
+ X509_STORE_CTX * context,
+ const X509 * cert,
+ const X509 * issuer)
+#endif
{
globus_result_t result;
int return_value;
@@ -601,21 +608,21 @@ int globus_gsi_callback_check_issued(
globus_gsi_cert_utils_cert_type_t cert_type;
static char * _function_name_ =
"globus_gsi_callback_check_issued";
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
-
+
return_value = X509_check_issued(issuer, cert);
if(return_value != X509_V_OK)
{
return_code = 0;
switch(return_value)
{
-
+
case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
/* If this is a proxy certificate then the issuer
* does not need to have the key_usage set.
* So check if its a proxy, and ignore
- * the error if so.
+ * the error if so.
*/
result = globus_gsi_cert_utils_get_cert_type(cert, &cert_type);
if(result != GLOBUS_SUCCESS)
@@ -623,19 +630,19 @@ int globus_gsi_callback_check_issued(
return_code = 0;
break;
}
-
+
if(GLOBUS_GSI_CERT_UTILS_IS_PROXY(cert_type))
{
/* its a proxy! */
return_code = 1;
}
break;
-
+
default:
break;
}
}
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
return return_code;
}
@@ -652,13 +659,13 @@ globus_i_gsi_callback_cred_verify(
globus_gsi_cert_utils_cert_type_t cert_type;
X509 * tmp_cert = NULL;
X509 * prev_cert = NULL;
- static char * _function_name_ =
+ static char * _function_name_ =
"globus_i_gsi_callback_cred_verify";
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
-
+
/* Now check for some error conditions which
- * can be disregarded.
+ * can be disregarded.
*/
if (!preverify_ok)
{
@@ -666,11 +673,11 @@ globus_i_gsi_callback_cred_verify(
{
case X509_V_ERR_PATH_LENGTH_EXCEEDED:
- /*
- * OpenSSL-0.9.8 has this error (0.9.7d did not have this)
- * So we will ignore the errors now and do our checks later
- * on (as explained below).
- */
+ /*
+ * OpenSSL-0.9.8 has this error (0.9.7d did not have this)
+ * So we will ignore the errors now and do our checks later
+ * on (as explained below).
+ */
case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED:
GLOBUS_I_GSI_CALLBACK_DEBUG_PRINT(
@@ -684,22 +691,22 @@ globus_i_gsi_callback_cred_verify(
*/
result = GLOBUS_SUCCESS;
break;
- /*
- * In the later version (097g+) OpenSSL does know about
- * proxies, but not non-rfc compliant proxies, it will
- * count them as unhandled critical extensions.
- * So we will ignore the errors and do our
- * own checks later on, when we check the last
- * certificate in the chain we will check the chain.
- * As OpenSSL does not recognize legacy proxies
- */
+ /*
+ * In the later version (097g+) OpenSSL does know about
+ * proxies, but not non-rfc compliant proxies, it will
+ * count them as unhandled critical extensions.
+ * So we will ignore the errors and do our
+ * own checks later on, when we check the last
+ * certificate in the chain we will check the chain.
+ * As OpenSSL does not recognize legacy proxies
+ */
case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
GLOBUS_I_GSI_CALLBACK_DEBUG_PRINT(
2, "X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION\n");
- /*
- * Setting this for 098 or later versions avoid the invalid
- * CA error but would result in proxy path len exceeded which
- * is handled above.
+ /*
+ * Setting this for 098 or later versions avoid the invalid
+ * CA error but would result in proxy path len exceeded which
+ * is handled above.
*/
X509_set_proxy_flag(X509_STORE_CTX_get_current_cert(x509_context));
result = GLOBUS_SUCCESS;
@@ -713,44 +720,44 @@ globus_i_gsi_callback_cred_verify(
result = GLOBUS_SUCCESS;
break;
- case X509_V_ERR_INVALID_CA:
- /*
- * If the previous cert in the chain is a proxy cert then
- * we get this error just because openssl does not recognize
- * our proxy and treats it as an EEC. And thus, it would
- * treat higher level proxies (if any) or EEC as CA cert
- * (which are not actually CA certs) and would throw this
- * error. As long as the previous cert in the chain is a
- * proxy cert, we ignore this error.
- */
- prev_cert = sk_X509_value(
- X509_STORE_CTX_get0_chain(x509_context), X509_STORE_CTX_get_error_depth(x509_context)-1);
- result = globus_gsi_cert_utils_get_cert_type(prev_cert, &cert_type);
- if(result != GLOBUS_SUCCESS)
- {
- result = (globus_result_t)GLOBUS_FAILURE;
- }
- else
- {
- if(GLOBUS_GSI_CERT_UTILS_IS_PROXY(cert_type))
- {
- result = GLOBUS_SUCCESS;
- }
- else
- {
- result = (globus_result_t)GLOBUS_FAILURE;
- }
+ case X509_V_ERR_INVALID_CA:
+ /*
+ * If the previous cert in the chain is a proxy cert then
+ * we get this error just because openssl does not recognize
+ * our proxy and treats it as an EEC. And thus, it would
+ * treat higher level proxies (if any) or EEC as CA cert
+ * (which are not actually CA certs) and would throw this
+ * error. As long as the previous cert in the chain is a
+ * proxy cert, we ignore this error.
+ */
+ prev_cert = sk_X509_value(
+ X509_STORE_CTX_get0_chain(x509_context), X509_STORE_CTX_get_error_depth(x509_context)-1);
+ result = globus_gsi_cert_utils_get_cert_type(prev_cert, &cert_type);
+ if(result != GLOBUS_SUCCESS)
+ {
+ result = (globus_result_t)GLOBUS_FAILURE;
+ }
+ else
+ {
+ if(GLOBUS_GSI_CERT_UTILS_IS_PROXY(cert_type))
+ {
+ result = GLOBUS_SUCCESS;
+ }
+ else
+ {
+ result = (globus_result_t)GLOBUS_FAILURE;
+ }
}
- break;
+ break;
default:
result = (globus_result_t)GLOBUS_FAILURE;
break;
- }
+ }
if (result != GLOBUS_SUCCESS)
{
- char * subject_name =
- X509_NAME_oneline(X509_get_subject_name(X509_STORE_CTX_get_current_cert(x509_context)), 0, 0);
+ char * subject_name =
+ X509_NAME_oneline(X509_get_subject_name(X509_STORE_CTX_get_current_cert(x509_context)), 0, 0);
unsigned long issuer_hash =
X509_issuer_name_hash(X509_STORE_CTX_get_current_cert(x509_context));
char * cert_dir;
@@ -761,9 +768,9 @@ globus_i_gsi_callback_cred_verify(
result,
GLOBUS_GSI_CALLBACK_ERROR_CERT_NOT_YET_VALID,
(_CLS("Cert with subject: %s is not yet valid"
- "- check clock skew between hosts."), subject_name));
+ "- check clock skew between hosts."), subject_name));
}
- else if (X509_STORE_CTX_get_error(x509_context) ==
+ else if (X509_STORE_CTX_get_error(x509_context) ==
X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY)
{
cert_dir = NULL;
@@ -773,7 +780,7 @@ globus_i_gsi_callback_cred_verify(
result,
GLOBUS_GSI_CALLBACK_ERROR_CANT_GET_LOCAL_CA_CERT,
(_CLS("Cannot find trusted CA certificate "
- "with hash %lx%s%s"),
+ "with hash %lx%s%s"),
issuer_hash, cert_dir ? " in " : "",
cert_dir ? cert_dir : ""));
if (cert_dir)
@@ -790,7 +797,7 @@ globus_i_gsi_callback_cred_verify(
result,
GLOBUS_GSI_CALLBACK_ERROR_CANT_GET_LOCAL_CA_CERT,
(_CLS("Untrusted self-signed certificate in chain "
- "with hash %lx"),
+ "with hash %lx"),
issuer_hash));
if (cert_dir)
{
@@ -811,8 +818,8 @@ globus_i_gsi_callback_cred_verify(
GLOBUS_GSI_CALLBACK_ERROR_VERIFY_CRED,
(X509_verify_cert_error_string(X509_STORE_CTX_get_error(x509_context))));
}
-
- OPENSSL_free(subject_name);
+
+ OPENSSL_free(subject_name);
goto exit;
}
@@ -847,7 +854,7 @@ globus_i_gsi_callback_cred_verify(
goto exit;
}
#endif
-
+
/* only want to check singing_policy file if its not a proxy */
result = globus_i_gsi_callback_check_signing_policy(
x509_context,
@@ -858,13 +865,13 @@ globus_i_gsi_callback_cred_verify(
result,
GLOBUS_GSI_CALLBACK_ERROR_VERIFY_CRED);
goto exit;
- }
+ }
}
tmp_cert = X509_dup(X509_STORE_CTX_get_current_cert(x509_context));
/* add the current cert to the callback data's cert chain */
- sk_X509_insert(callback_data->cert_chain,
+ sk_X509_insert(callback_data->cert_chain,
tmp_cert, 0);
callback_data->cert_depth++;
@@ -889,7 +896,7 @@ globus_i_gsi_callback_cred_verify(
GLOBUS_GSI_CALLBACK_ERROR_VERIFY_CRED);
goto exit;
}
-
+
exit:
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
@@ -908,8 +915,8 @@ globus_i_gsi_callback_check_proxy(
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
- /* All of the OpenSSL tests have passed and we now get to
- * look at the certificate to verify the proxy rules,
+ /* All of the OpenSSL tests have passed and we now get to
+ * look at the certificate to verify the proxy rules,
* and ca-signing-policy rules. We will also do a CRL check
*/
result = globus_gsi_cert_utils_get_cert_type(X509_STORE_CTX_get_current_cert(x509_context),
@@ -923,7 +930,7 @@ globus_i_gsi_callback_check_proxy(
}
if(GLOBUS_GSI_CERT_UTILS_IS_PROXY(cert_type))
- {
+ {
/* it is a proxy */
/* a legacy globus proxy may only be followed by another legacy globus
@@ -935,7 +942,7 @@ globus_i_gsi_callback_check_proxy(
* a draft compliant limited proxy may only be followed by another draft
* compliant limited proxy or a draft compliant independent proxy
*/
-
+
if((GLOBUS_GSI_CERT_UTILS_IS_GSI_2_PROXY(callback_data->cert_type) &&
!GLOBUS_GSI_CERT_UTILS_IS_GSI_2_PROXY(cert_type)) ||
(GLOBUS_GSI_CERT_UTILS_IS_GSI_3_PROXY(callback_data->cert_type) &&
@@ -961,7 +968,7 @@ globus_i_gsi_callback_check_proxy(
X509_STORE_CTX_set_error(x509_context, X509_V_ERR_CERT_SIGNATURE_FAILURE);
goto exit;
}
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_PRINT(2, "Passed proxy test\n");
callback_data->proxy_depth++;
@@ -977,7 +984,7 @@ globus_i_gsi_callback_check_proxy(
}
callback_data->cert_type = cert_type;
-
+
exit:
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
@@ -1003,34 +1010,34 @@ globus_i_gsi_callback_check_revoked(
globus_bool_t recheck_crl_done = GLOBUS_FALSE;
static char * _function_name_ =
"globus_i_gsi_callback_check_revoked";
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
-
+
do
{
x509_object = X509_OBJECT_new();
- /*
- * SSLeay 0.9.0 handles CRLs but does not check them.
+ /*
+ * SSLeay 0.9.0 handles CRLs but does not check them.
* We will check the crl for this cert, if there
- * is a CRL in the store.
- * If we find the crl is not valid, we will fail,
- * as once the sysadmin indicates that CRLs are to
- * be checked, he best keep it upto date.
- *
+ * is a CRL in the store.
+ * If we find the crl is not valid, we will fail,
+ * as once the sysadmin indicates that CRLs are to
+ * be checked, he best keep it upto date.
+ *
* When future versions of SSLeay support this better,
- * we can remove these tests.
- *
+ * we can remove these tests.
+ *
* we come through this code for each certificate,
* starting with the CA's We will check for a CRL
* each time, but only check the signature if the
* subject name matches, and check for revoked
* if the issuer name matches.
- * this allows the CA to revoke its own cert as well.
+ * this allows the CA to revoke its own cert as well.
*/
if (X509_STORE_get_by_subject(
x509_context,
- X509_LU_CRL,
+ X509_LU_CRL,
X509_get_issuer_name(X509_STORE_CTX_get_current_cert(x509_context)),
x509_object))
{
@@ -1047,7 +1054,7 @@ globus_i_gsi_callback_check_revoked(
next_update = X509_CRL_get0_nextUpdate(crl);
last_update = X509_CRL_get0_lastUpdate(crl);
has_next_time = (next_update != NULL);
-
+
globus_gsi_cert_utils_make_time(last_update, &last_time);
if (has_next_time)
{
@@ -1067,8 +1074,8 @@ globus_i_gsi_callback_check_revoked(
get_issuer = X509_STORE_CTX_get_get_issuer(x509_context);
/* verify the signature on this CRL */
- if(get_issuer(&issuer,
- x509_context,
+ if(get_issuer(&issuer,
+ x509_context,
X509_STORE_CTX_get_current_cert(x509_context)) <= 0)
{
char * subject_string;
@@ -1076,7 +1083,7 @@ globus_i_gsi_callback_check_revoked(
subject_string = X509_NAME_oneline(
X509_get_issuer_name(X509_STORE_CTX_get_current_cert(x509_context)),
NULL, 0);
-
+
GLOBUS_GSI_CALLBACK_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_CALLBACK_ERROR_INVALID_CRL,
@@ -1088,7 +1095,7 @@ globus_i_gsi_callback_check_revoked(
}
issuer_key = X509_get_pubkey(issuer);
-
+
if(issuer_key == NULL)
{
GLOBUS_GSI_CALLBACK_OPENSSL_ERROR_RESULT(
@@ -1114,7 +1121,7 @@ globus_i_gsi_callback_check_revoked(
}
EVP_PKEY_free(issuer_key);
-
+
/* Check date */
i = X509_cmp_current_time(last_update);
@@ -1137,7 +1144,7 @@ globus_i_gsi_callback_check_revoked(
X509_STORE_CTX_set_error(x509_context, X509_V_ERR_CRL_NOT_YET_VALID);
goto free_X509_object;
}
-
+
i = (has_next_time) ? X509_cmp_current_time(next_update) : 1;
if (i == 0)
{
@@ -1148,7 +1155,7 @@ globus_i_gsi_callback_check_revoked(
X509_STORE_CTX_set_error(x509_context, X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
goto free_X509_object;
}
-
+
/* If we get an expired CRL, we'll delete it from the store
* associated with this ssl context and then try this operation one
* more time to see if a new one is in place.
@@ -1276,19 +1283,19 @@ globus_i_gsi_callback_check_revoked(
revoked = sk_X509_REVOKED_value(revoked_stack, i);
revoked_serial_number = X509_REVOKED_get0_serialNumber(revoked);
-
+
if(!ASN1_INTEGER_cmp(
revoked_serial_number,
X509_get_serialNumber(X509_STORE_CTX_get_current_cert(x509_context))))
{
char * subject_string;
long serial;
-
+
serial = ASN1_INTEGER_get(revoked_serial_number);
subject_string = X509_NAME_oneline(X509_get_subject_name(
X509_STORE_CTX_get_current_cert(x509_context)), NULL, 0);
-
+
GLOBUS_GSI_CALLBACK_ERROR_RESULT(
result,
GLOBUS_GSI_CALLBACK_ERROR_REVOKED_CERT,
@@ -1300,7 +1307,7 @@ globus_i_gsi_callback_check_revoked(
GLOBUS_I_GSI_CALLBACK_DEBUG_FPRINTF(
2, (globus_i_gsi_callback_debug_fstream,
- "revoked %lX\n",
+ "revoked %lX\n",
ASN1_INTEGER_get(revoked_serial_number)));
OPENSSL_free(subject_string);
@@ -1325,10 +1332,10 @@ globus_i_gsi_callback_check_revoked(
while (crl_was_expired && !recheck_crl_done);
free_X509_object:
-
+
if (x509_object != NULL)
{
- X509_OBJECT_free(x509_object);
+ X509_OBJECT_free(x509_object);
}
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
@@ -1345,7 +1352,7 @@ globus_i_gsi_callback_check_signing_policy(
"globus_i_gsi_callback_check_signing_policy";
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
-
+
/* Do not need to check self signed certs against ca_policy_file */
if (X509_NAME_cmp(X509_get_subject_name(X509_STORE_CTX_get_current_cert(x509_context)),
@@ -1372,7 +1379,7 @@ globus_i_gsi_callback_check_signing_policy(
}
exit:
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
return result;
}
@@ -1401,7 +1408,7 @@ globus_i_gsi_callback_check_gaa_auth(
"globus_i_gsi_callback_check_gaa_auth";
GLOBUS_I_GSI_CALLBACK_DEBUG_ENTER;
-
+
subject_name = X509_NAME_oneline(
X509_get_subject_name(X509_STORE_CTX_get_current_cert(x509_context)),
NULL,
@@ -1410,7 +1417,7 @@ globus_i_gsi_callback_check_gaa_auth(
X509_get_issuer_name(X509_STORE_CTX_get_current_cert(x509_context)),
NULL,
0);
-
+
result =
GLOBUS_GSI_SYSCONFIG_GET_SIGNING_POLICY_FILENAME(
X509_get_issuer_name(X509_STORE_CTX_get_current_cert(x509_context)),
@@ -1429,7 +1436,7 @@ globus_i_gsi_callback_check_gaa_auth(
if(ca_policy_file_path == NULL)
{
/* signing policy file doesn't exist or can't be read */
-
+
GLOBUS_GSI_CALLBACK_ERROR_RESULT(
result,
GLOBUS_GSI_CALLBACK_ERROR_WITH_SIGNING_POLICY,
@@ -1451,7 +1458,7 @@ globus_i_gsi_callback_check_gaa_auth(
issuer_name,
subject_name,
ca_policy_file_path)
- != OLDGAA_SUCCESS)
+ != OLDGAA_SUCCESS)
{
GLOBUS_GSI_CALLBACK_ERROR_RESULT(
result,
@@ -1462,9 +1469,9 @@ globus_i_gsi_callback_check_gaa_auth(
globus_mutex_unlock(&globus_l_gsi_callback_oldgaa_mutex);
goto exit;
}
-
+
if(oldgaa_get_object_policy_info(
- &minor_status,
+ &minor_status,
OLDGAA_NO_DATA,
policy_db,
oldgaa_globus_policy_retrieve,
@@ -1478,14 +1485,14 @@ globus_i_gsi_callback_check_gaa_auth(
oldgaa_globus_cleanup(&oldgaa_sc,
&rights,
options,
- &detailed_answer,
+ &detailed_answer,
policy_db,
NULL);
X509_STORE_CTX_set_error(x509_context, X509_V_ERR_APPLICATION_VERIFICATION);
globus_mutex_unlock(&globus_l_gsi_callback_oldgaa_mutex);
goto exit;
}
-
+
policy_result = oldgaa_check_authorization(
&minor_status,
oldgaa_sc,
@@ -1493,7 +1500,7 @@ globus_i_gsi_callback_check_gaa_auth(
rights,
options,
&detailed_answer);
-
+
if (!detailed_answer)
{
GLOBUS_GSI_CALLBACK_ERROR_RESULT(
@@ -1504,11 +1511,11 @@ globus_i_gsi_callback_check_gaa_auth(
issuer_name == NULL ? "NULL" : issuer_name,
ca_policy_file_path == NULL ? "NULL" : ca_policy_file_path));
X509_STORE_CTX_set_error(x509_context, X509_V_ERR_INVALID_PURPOSE);
-
+
oldgaa_globus_cleanup(&oldgaa_sc,
&rights,
options,
- &detailed_answer,
+ &detailed_answer,
policy_db,
NULL);
globus_mutex_unlock(&globus_l_gsi_callback_oldgaa_mutex);
@@ -1517,15 +1524,15 @@ globus_i_gsi_callback_check_gaa_auth(
if(GLOBUS_I_GSI_CALLBACK_DEBUG(2))
{
-
+
fprintf(globus_i_gsi_callback_debug_fstream,
"oldgaa result: %d(0 yes, 1 no, -1 maybe)\n", policy_result);
-
- if(detailed_answer)
- {
+
+ if(detailed_answer)
+ {
fprintf(globus_i_gsi_callback_debug_fstream,
"\nprint detailed answer:\n\n");
-
+
#ifndef WIN32
if(detailed_answer->rights)
{
@@ -1534,21 +1541,21 @@ globus_i_gsi_callback_check_gaa_auth(
#endif
}
}
-
+
if (policy_handle)
{
oldgaa_release_principals(&minor_status, &policy_handle);
}
-
+
oldgaa_globus_cleanup(&oldgaa_sc,
&rights,
options,
- &detailed_answer,
+ &detailed_answer,
policy_db,
NULL);
globus_mutex_unlock(&globus_l_gsi_callback_oldgaa_mutex);
-
+
if (policy_result != 0)
{
GLOBUS_GSI_CALLBACK_ERROR_RESULT(
@@ -1592,8 +1599,12 @@ globus_i_gsi_callback_check_critical_extensions(
X509_STORE_CTX * x509_context,
globus_gsi_callback_data_t callback_data)
{
- ASN1_OBJECT * extension_object = NULL;
+ const ASN1_OBJECT * extension_object = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_EXTENSION * extension = NULL;
+#else
+ const X509_EXTENSION * extension = NULL;
+#endif
PROXY_CERT_INFO_EXTENSION * proxycertinfo = NULL;
PROXY_POLICY * policy = NULL;
int nid;
@@ -1610,8 +1621,8 @@ globus_i_gsi_callback_check_critical_extensions(
pci_NID = NID_proxyCertInfo;
pci_old_NID = OBJ_txt2nid("1.3.6.1.4.1.3536.1.222");
- while((critical_position =
- X509_get_ext_by_critical(X509_STORE_CTX_get_current_cert(x509_context),
+ while((critical_position =
+ X509_get_ext_by_critical(X509_STORE_CTX_get_current_cert(x509_context),
1, critical_position)) >= 0)
{
extension = X509_get_ext(X509_STORE_CTX_get_current_cert(x509_context), critical_position);
@@ -1671,7 +1682,7 @@ globus_i_gsi_callback_check_critical_extensions(
policy = proxycertinfo->proxyPolicy;
}
-
+
if((nid != NID_basic_constraints &&
nid != NID_key_usage &&
nid != NID_ext_key_usage &&
@@ -1728,7 +1739,7 @@ globus_i_gsi_callback_check_path_length(
X509 * cert = NULL;
globus_result_t result = GLOBUS_SUCCESS;
int i;
-
+
static char * _function_name_ =
"globus_i_gsi_callback_check_path_length";
@@ -1737,11 +1748,11 @@ globus_i_gsi_callback_check_path_length(
/*
* We ignored any path length restriction errors because
* OpenSSL was counting proxies against the limit.
- * If we are on the last cert in the chain, we
- * know how many are proxies, so we can do the
- * path length check now.
+ * If we are on the last cert in the chain, we
+ * know how many are proxies, so we can do the
+ * path length check now.
* See x509_vfy.c check_chain_purpose
- * all we do is substract off the proxy_depth
+ * all we do is substract off the proxy_depth
*/
if(X509_STORE_CTX_get_current_cert(x509_context) == X509_STORE_CTX_get0_cert(x509_context))
@@ -1755,7 +1766,7 @@ globus_i_gsi_callback_check_path_length(
"pathlen=:i=%d x=%p pl=%ld\n",
i, cert, X509_get_pathlen(cert)));
- if (((i - callback_data->proxy_depth) > 1) &&
+ if (((i - callback_data->proxy_depth) > 1) &&
(X509_get_pathlen(cert) != -1) &&
((i - callback_data->proxy_depth) > (X509_get_pathlen(cert) + 1)) &&
(X509_get_extension_flags(cert) & EXFLAG_BCONS))
@@ -1768,7 +1779,7 @@ globus_i_gsi_callback_check_path_length(
}
}
}
-
+
GLOBUS_I_GSI_CALLBACK_DEBUG_EXIT;
return result;
}
diff --git a/gsi/callback/source/library/globus_gsi_callback.h b/gsi/callback/source/library/globus_gsi_callback.h
index 9bbf5900c6..f7c41bb650 100644
--- a/gsi/callback/source/library/globus_gsi_callback.h
+++ b/gsi/callback/source/library/globus_gsi_callback.h
@@ -74,7 +74,7 @@
* @endcode
*
* This function should be called once for each time Globus GSI Callback
- * was activated.
+ * was activated.
*
*/
@@ -89,16 +89,16 @@ extern "C" {
*/
#define GLOBUS_GSI_CALLBACK_MODULE (&globus_i_gsi_callback_module)
-extern
+extern
globus_module_descriptor_t globus_i_gsi_callback_module;
#define _CLS(s) globus_common_i18n_get_string(GLOBUS_GSI_CALLBACK_MODULE,\
- s)
+ s)
/**
* @defgroup globus_gsi_callback_functions Callback Functions
* @ingroup globus_gsi_callback
* @brief Callback Functions
- *
+ *
* Functions that plug into various plug points in the OpenSSL path validation
* mechanism. These functions add CRL checking, X509 Extension handling and
* proxy validation.
@@ -110,7 +110,7 @@ globus_module_descriptor_t globus_i_gsi_callback_module;
* @brief Callback Data Functions
*
* Functions that deal with the data structure that contains state associated
- * with the path validation callback.
+ * with the path validation callback.
*/
@@ -125,9 +125,15 @@ typedef struct globus_l_gsi_callback_data_s *
* Typedef for a callback that may be registered for dealing with unhandled X.509 extension
* @ingroup globus_gsi_callback
*/
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
typedef int (*globus_gsi_extension_callback_t)(
globus_gsi_callback_data_t callback_data,
X509_EXTENSION * extension);
+#else
+typedef int (*globus_gsi_extension_callback_t)(
+ globus_gsi_callback_data_t callback_data,
+ const X509_EXTENSION * extension);
+#endif
#ifndef DOXYGEN
@@ -149,12 +155,19 @@ globus_gsi_callback_handshake_callback(
int preverify_ok,
X509_STORE_CTX * x509_context);
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
int globus_gsi_callback_check_issued(
X509_STORE_CTX * context,
X509 * cert,
X509 * issuer);
+#else
+int globus_gsi_callback_check_issued(
+ X509_STORE_CTX * context,
+ const X509 * cert,
+ const X509 * issuer);
+#endif
-int
+int
globus_gsi_callback_X509_verify_cert(
X509_STORE_CTX * context,
void * arg);
@@ -291,7 +304,7 @@ globus_result_t
globus_gsi_callback_set_allow_missing_signing_policy(
globus_gsi_callback_data_t callback_data,
globus_bool_t allow);
-
+
#endif /* DOXYGEN */
#ifdef __cplusplus
diff --git a/gsi/callback/source/library/oldgaa/globus_oldgaa_utils.c b/gsi/callback/source/library/oldgaa/globus_oldgaa_utils.c
index 7884cf61d9..880ca62e94 100644
--- a/gsi/callback/source/library/oldgaa/globus_oldgaa_utils.c
+++ b/gsi/callback/source/library/oldgaa/globus_oldgaa_utils.c
@@ -15,7 +15,7 @@
*/
/**********************************************************************
- globus_oldgaa-utils.c:
+ globus_oldgaa-utils.c:
Description:
Globus-OLDGAA routines
@@ -27,17 +27,17 @@
**********************************************************************/
#include "globus_oldgaa.h"
-#include "globus_oldgaa_utils.h"
+#include "globus_oldgaa_utils.h"
#include "oldgaa_gl_internal_err.h"
#include "oldgaa_policy_evaluator.h"
#include "oldgaa_utils.h"
#include "globus_i_gsi_callback_config.h"
-#include /* for strerror() */
+#include /* for strerror() */
#include
#include
-#include
+#include
/**********************************************************************
Define module specific variables
@@ -61,10 +61,10 @@ oldgaa_globus_read_string (policy_file_context_ptr pcontext,
static oldgaa_error_code
oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
- oldgaa_policy_ptr *policy,
- char *tmp_str /* IN&OUT */,
- oldgaa_principals_ptr *start,
- oldgaa_principals_ptr *added_principal);
+ oldgaa_policy_ptr *policy,
+ char *tmp_str /* IN&OUT */,
+ oldgaa_principals_ptr *start,
+ oldgaa_principals_ptr *added_principal);
static
int
@@ -77,25 +77,25 @@ oldgaa_globus_omit_comment_line(policy_file_context_ptr pcontext);
static void
oldgaa_bind_rights_to_condition(oldgaa_rights_ptr right,
- oldgaa_cond_bindings_ptr cond_bind)
+ oldgaa_cond_bindings_ptr cond_bind)
{
right->cond_bindings = cond_bind;
cond_bind->reference_count++;
#ifdef DEBUG
fprintf(stderr,"oldgaa_bind_rights_to_conditions:rights:%p->cond_bind:%p\n",
- right, cond_bind);
+ right, cond_bind);
#endif
-}
+}
static void
-oldgaa_bind_rights_to_principal(oldgaa_principals_ptr principal,
+oldgaa_bind_rights_to_principal(oldgaa_principals_ptr principal,
oldgaa_rights_ptr rights)
{
if (principal->rights)
- oldgaa_add_rights(&(principal->rights), rights);
+ oldgaa_add_rights(&(principal->rights), rights);
else {
- principal->rights = rights;
- rights->reference_count++;
+ principal->rights = rights;
+ rights->reference_count++;
}
}
@@ -106,51 +106,51 @@ print_condition_binding(oldgaa_cond_bindings_ptr cb)
{
oldgaa_conditions_ptr c;
for (; cb; cb = cb->next) {
- fprintf(stderr, " condition binding %x\n", cb);
- for (c = cb->condition; c; c = c->next) {
- fprintf(stderr, " condition (%s, %s, %s)\n",
- NN(c->type), NN(c->authority), NN(c->value));
- }
+ fprintf(stderr, " condition binding %x\n", cb);
+ for (c = cb->condition; c; c = c->next) {
+ fprintf(stderr, " condition (%s, %s, %s)\n",
+ NN(c->type), NN(c->authority), NN(c->value));
+ }
}
}
static void
print_oldgaa_principal_ptr(oldgaa_principals_ptr pr)
{
oldgaa_rights_ptr r;
-
+
for (; pr; pr = pr->next) {
- fprintf(stderr, "principal (%s, %s, %s): %x\n",
- NN(pr->type), NN(pr->authority), NN(pr->value),
- pr->rights);
- for (r = pr->rights; r; r = r->next) {
- fprintf(stderr, " right (%s, %s, %s)\n",
- NN(r->type), NN(r->authority), NN(r->value));
- print_condition_binding(r->cond_bindings);
- }
+ fprintf(stderr, "principal (%s, %s, %s): %x\n",
+ NN(pr->type), NN(pr->authority), NN(pr->value),
+ pr->rights);
+ for (r = pr->rights; r; r = r->next) {
+ fprintf(stderr, " right (%s, %s, %s)\n",
+ NN(r->type), NN(r->authority), NN(r->value));
+ print_condition_binding(r->cond_bindings);
+ }
}
}
#endif /* LDEBUG */
/**********************************************************************
- OLDGAA Cleanup Functions
+ OLDGAA Cleanup Functions
**********************************************************************/
oldgaa_error_code
oldgaa_globus_cleanup(oldgaa_sec_context_ptr *oldgaa_sc,
oldgaa_rights_ptr *rights,
oldgaa_options_ptr options,
- oldgaa_answer_ptr *answer,
- oldgaa_data_ptr policy_db,
+ oldgaa_answer_ptr *answer,
+ oldgaa_data_ptr policy_db,
oldgaa_sec_attrb_ptr *attributes)
{
oldgaa_error_code oldgaa_status = OLDGAA_SUCCESS;
- uint32 minor_status;
-
- if(oldgaa_sc) oldgaa_status = oldgaa_release_sec_context(&minor_status, oldgaa_sc);
- if(rights) oldgaa_status = oldgaa_release_rights(&minor_status, rights);
- if(options) oldgaa_status = oldgaa_release_options(&minor_status, options);
+ uint32 minor_status;
+
+ if(oldgaa_sc) oldgaa_status = oldgaa_release_sec_context(&minor_status, oldgaa_sc);
+ if(rights) oldgaa_status = oldgaa_release_rights(&minor_status, rights);
+ if(options) oldgaa_status = oldgaa_release_options(&minor_status, options);
if(answer) oldgaa_status = oldgaa_release_answer(&minor_status, answer);
if(policy_db) oldgaa_status = oldgaa_release_data(&minor_status, policy_db);
- if(attributes)oldgaa_status = oldgaa_release_sec_attrb(&minor_status, attributes);
+ if(attributes)oldgaa_status = oldgaa_release_sec_attrb(&minor_status, attributes);
return oldgaa_status;
}
@@ -158,44 +158,44 @@ oldgaa_globus_cleanup(oldgaa_sec_context_ptr *oldgaa_sc,
/**********************************************************************
- OLDGAA Initialization Functions
+ OLDGAA Initialization Functions
**********************************************************************/
oldgaa_error_code
oldgaa_globus_initialize(oldgaa_sec_context_ptr *oldgaa_sc,
oldgaa_rights_ptr *rights,
oldgaa_options_ptr *options,
- oldgaa_data_ptr *policy_db,
- char *signer,
- char *subject,
- char *path)
-{
+ oldgaa_data_ptr *policy_db,
+ char *signer,
+ char *subject,
+ char *path)
+{
int error=0;
/* Allocate and fill in OLDGAA-Globus data structures */
- if(oldgaa_sc) *oldgaa_sc = oldgaa_globus_allocate_sec_context(signer);
+ if(oldgaa_sc) *oldgaa_sc = oldgaa_globus_allocate_sec_context(signer);
if(rights) *rights = oldgaa_globus_allocate_rights();
-
- if(options)
+
+ if(options)
{
oldgaa_allocate_options(options);
- (*options)->value = oldgaa_strcopy(subject, (*options)->value);
- (*options)->length = strlen(subject);
+ (*options)->value = oldgaa_strcopy(subject, (*options)->value);
+ (*options)->length = strlen(subject);
}
if(policy_db)
- {
+ {
oldgaa_allocate_data(policy_db);
-
+
if(path) (*policy_db)->str = oldgaa_strcopy(path,(*policy_db)->str);
else
- error = get_default_policy_file(*policy_db);
+ error = get_default_policy_file(*policy_db);
}
if(error)return OLDGAA_FAILURE;
else
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
}
@@ -204,44 +204,44 @@ oldgaa_globus_initialize(oldgaa_sec_context_ptr *oldgaa_sc,
Function: oldgaa_globus_allocate_sec_context
Description:
- Allocates OLDGAA security context and fills in globus-specific
+ Allocates OLDGAA security context and fills in globus-specific
information.
Parameters:
- signer, pointer to string with name of credential signer.
+ signer, pointer to string with name of credential signer.
Returns:
- Pointer to a oldgaa_sec_context if successful
+ Pointer to a oldgaa_sec_context if successful
**********************************************************************/
oldgaa_sec_context_ptr
oldgaa_globus_allocate_sec_context(char *signer)
{
oldgaa_sec_context_ptr sc = NULL;
-
+
oldgaa_allocate_sec_context(&sc);
-
- if(strcmp(signer, OLDGAA_ANYBODY) == 0)
+
+ if(strcmp(signer, OLDGAA_ANYBODY) == 0)
{
- sc->identity_cred->principal->type = oldgaa_strcopy(OLDGAA_ANYBODY,
+ sc->identity_cred->principal->type = oldgaa_strcopy(OLDGAA_ANYBODY,
sc->identity_cred->principal->type);
sc->identity_cred->principal->authority = oldgaa_strcopy(" ",
sc->identity_cred->principal->authority);
- sc->identity_cred->principal->value = oldgaa_strcopy(" ",
+ sc->identity_cred->principal->value = oldgaa_strcopy(" ",
sc->identity_cred->principal->value);
}
else
{
- sc->identity_cred->principal->type = oldgaa_strcopy(OLDGAA_CA,
+ sc->identity_cred->principal->type = oldgaa_strcopy(OLDGAA_CA,
sc->identity_cred->principal->type);
-
- sc->identity_cred->principal->authority = oldgaa_strcopy(OLDGAA_X509_AUTHORITY,
+
+ sc->identity_cred->principal->authority = oldgaa_strcopy(OLDGAA_X509_AUTHORITY,
sc->identity_cred->principal->authority);
-
- sc->identity_cred->principal->value = oldgaa_strcopy(signer,
- sc->identity_cred->principal->value);
+
+ sc->identity_cred->principal->value = oldgaa_strcopy(signer,
+ sc->identity_cred->principal->value);
}
return sc;
@@ -249,17 +249,17 @@ oldgaa_globus_allocate_sec_context(char *signer)
/**********************************************************************
-Function: oldgaa_globus_allocate_rights()
+Function: oldgaa_globus_allocate_rights()
Description:
- Allocates OLDGAA rights stracture and fills in globus-specific
+ Allocates OLDGAA rights stracture and fills in globus-specific
information..
Parameters:
- none
+ none
Returns:
- Pointer to a oldgaa_rights if successful
+ Pointer to a oldgaa_rights if successful
**********************************************************************/
oldgaa_rights_ptr
@@ -269,7 +269,7 @@ oldgaa_globus_allocate_rights()
oldgaa_allocate_rights(&rights);
rights->reference_count++;
-
+
rights->type = oldgaa_strcopy(POSITIVE_RIGHTS, rights->type);
rights->authority = oldgaa_strcopy(AUTH_GLOBUS, rights->authority);
rights->value = oldgaa_strcopy(GLOBUS_RIGHTS_VALUE, rights->value);
@@ -279,34 +279,34 @@ oldgaa_globus_allocate_rights()
}
/**********************************************************************
- Policy Retrieving Functions
+ Policy Retrieving Functions
**********************************************************************/
/**********************************************************************
-Function: oldgaa_globus_policy_retrieve()
+Function: oldgaa_globus_policy_retrieve()
Description:
Upcall function for the retrieval of the object policy.
Parameters:
- object, pointer to string with name of protected object,
+ object, pointer to string with name of protected object,
can be NULL
- policy_db, pointer to string with name of policy file
+ policy_db, pointer to string with name of policy file
Returns:
- Pointer to a policy_file_context_ptr if successful
- NULL on error, setting errno.
+ Pointer to a policy_file_context_ptr if successful
+ NULL on error, setting errno.
**********************************************************************/
-oldgaa_policy_ptr
+oldgaa_policy_ptr
oldgaa_globus_policy_retrieve(uint32 *minor_status,
oldgaa_data_ptr object,
oldgaa_data_ptr policy_db, ...)
-{
- policy_file_context_ptr pcontext = NULL;
- oldgaa_policy_ptr policy_handle = NULL;
+{
+ policy_file_context_ptr pcontext = NULL;
+ oldgaa_policy_ptr policy_handle = NULL;
int error_type = 1;
#ifdef DEBUG
@@ -319,22 +319,22 @@ oldgaa_globus_policy_retrieve(uint32 *minor_status,
if (pcontext) /* parse policy */
{
- if(oldgaa_globus_parse_policy(pcontext,
+ if(oldgaa_globus_parse_policy(pcontext,
&policy_handle) == OLDGAA_SUCCESS)
{
#ifdef DEBUG
{
- oldgaa_principals_ptr pp;
- oldgaa_rights_ptr rp;
- oldgaa_cond_bindings_ptr bp;
- oldgaa_conditions_ptr cp;
+ oldgaa_principals_ptr pp;
+ oldgaa_rights_ptr rp;
+ oldgaa_cond_bindings_ptr bp;
+ oldgaa_conditions_ptr cp;
- pp = policy_handle;
- while (pp) {
+ pp = policy_handle;
+ while (pp) {
fprintf(stderr,"principal:%p\n",pp);
rp = pp->rights;
while(rp) {
- fprintf(stderr," rights:%p ref:%d\n",
+ fprintf(stderr," rights:%p ref:%d\n",
rp, rp->reference_count);
bp = rp->cond_bindings;
while(bp) {
@@ -351,17 +351,17 @@ oldgaa_globus_policy_retrieve(uint32 *minor_status,
rp = rp->next;
}
pp = pp->next;
- }
+ }
}
#endif
return policy_handle;
}
- else error_type = 0;
+ else error_type = 0;
}
/* error handling */
-
+
if(error_type) /* policy retrieve error */
{
policy_db->error_code = ERROR_WHILE_RETRIEVING_POLICY;
@@ -374,15 +374,15 @@ oldgaa_globus_policy_retrieve(uint32 *minor_status,
sprintf(policy_db->error_str,"error retrieving file %s",policy_db->str);
}
else /* policy parsing error */
- {
+ {
policy_db->error_code = m_status;
}
-
+
*minor_status = m_status;
return NULL;
}
-
+
/**********************************************************************/
static
@@ -415,41 +415,41 @@ get_default_policy_file(oldgaa_data_ptr policy_db)
free(ca_policy_file_path);
}
else
- {
- policy_db->error_str =
+ {
+ policy_db->error_str =
oldgaa_strcopy("Can not find default policy location. X509_CERT_DIR is not defined.\n",
policy_db->error_str);
policy_db->error_code = ERROR_WHILE_GETTING_DEFAULT_POLICY_LOCATION;
rc = 1;
}
-
- return rc;
+
+ return rc;
}
/**********************************************************************
-Function: oldgaa_globus_policy_file_open()
+Function: oldgaa_globus_policy_file_open()
Description:
- Open the specified policy file for reading, returning a
- context.
+ Open the specified policy file for reading, returning a
+ context.
Parameters:
- filename, pointer to string with name of policy file
+ filename, pointer to string with name of policy file
Returns:
- Pointer to a policy_file_context if successful
- NULL on error, setting errno.
+ Pointer to a policy_file_context if successful
+ NULL on error, setting errno.
**********************************************************************/
-policy_file_context_ptr
+policy_file_context_ptr
oldgaa_globus_policy_file_open(const char *filename)
{
- char * open_mode = "r";
+ char * open_mode = "r";
policy_file_context_ptr pcontext = NULL;
FILE * stream = NULL;
int rc;
@@ -499,7 +499,7 @@ oldgaa_globus_policy_file_open(const char *filename)
pcontext->buf = malloc(pcontext->buflen + 1);
if (!pcontext->buf) out_of_memory();
-
+
rc = fread(pcontext->buf, pcontext->buflen, 1, stream);
pcontext->buf[pcontext->buflen] = 0;
@@ -524,14 +524,14 @@ oldgaa_globus_policy_file_open(const char *filename)
Function: oldgaa_globus_policy_file_close()
Description:
- Close the policy file and deallocate memory assigned to the
- context.
+ Close the policy file and deallocate memory assigned to the
+ context.
Parameters:
- pcontext, pointer to the context
+ pcontext, pointer to the context
Returns:
- Nothing
+ Nothing
**********************************************************************/
@@ -550,29 +550,29 @@ oldgaa_globus_policy_file_close(policy_file_context_ptr pcontext)
free(pcontext->parse_error);
free(pcontext);
}
-}
+}
/**********************************************************************
- Policy Parsing Functions
+ Policy Parsing Functions
**********************************************************************/
/**********************************************************************/
static
int
-oldgaa_globus_help_read_string(policy_file_context_ptr pcontext,
- char *str,
+oldgaa_globus_help_read_string(policy_file_context_ptr pcontext,
+ char *str,
const char *message)
{
if (oldgaa_globus_read_string(pcontext, str, NULL)) return 1;
- if (end_of_file == TRUE)
- {
+ if (end_of_file == TRUE)
+ {
oldgaa_handle_error(&(pcontext->parse_error), message);
- return 1;
- }
-
+ return 1;
+ }
+
return 0;
}
@@ -583,17 +583,17 @@ oldgaa_globus_help_read_string(policy_file_context_ptr pcontext,
Function: oldgaa_globus_read_string
Description:
- Read a string from a given stream up to and including the newline
- and return it in an allocated buffer.
+ Read a string from a given stream up to and including the newline
+ and return it in an allocated buffer.
Parameters:
- pcontext, handle to a structure, containing the stream to read from.
+ pcontext, handle to a structure, containing the stream to read from.
- str, pointer to string to be filled in.
+ str, pointer to string to be filled in.
- errstring, pointer to the pointer to be filled in with
- a pointer to a string describing an error that occurs.
- May be NULL.
+ errstring, pointer to the pointer to be filled in with
+ a pointer to a string describing an error that occurs.
+ May be NULL.
Returns:
0 on success
@@ -606,14 +606,14 @@ int
oldgaa_globus_read_string (policy_file_context_ptr pcontext,
char *str,
char **errstring)
-{
+{
int len;
int rc;
if (pcontext->index >= (pcontext->buflen - 1))
{
- end_of_file = TRUE;
- return 0;
+ end_of_file = TRUE;
+ return 0;
}
rc = sscanf(pcontext->buf + pcontext->index, "%s%n", str, &len);
@@ -628,36 +628,36 @@ oldgaa_globus_read_string (policy_file_context_ptr pcontext,
oldgaa_handle_error(&(pcontext->str),str); /* set the string value to
report it in the case there is an error */
-
+
if (str[0]== STRING_DELIMITER) /* get strings with white spaces */
{
if(oldgaa_globus_get_string_with_whitespaces(pcontext, str) == -1)
{
oldgaa_handle_error(&(pcontext->parse_error),
- "error while reading string");
+ "error while reading string");
return 1;
}
}
if (str[0]== COMMENT) /* omit comment line */
- {
+ {
if(oldgaa_globus_omit_comment_line(pcontext))
{
oldgaa_handle_error(&(pcontext->parse_error),
- "error while reading string");
+ "error while reading string");
return 1;
}
if(oldgaa_globus_read_string(pcontext, str, errstring))
{
-
+
oldgaa_handle_error(&(pcontext->parse_error),
- "error while reading string");
+ "error while reading string");
return 1;
}
- }
-
+ }
+
return 0;
}
@@ -667,12 +667,12 @@ oldgaa_globus_read_string (policy_file_context_ptr pcontext,
Function: oldgaa_globus_get_string_with_whitespaces
Description:
- Read a string from a given stream up to it finds STRING_DELIMITER.
+ Read a string from a given stream up to it finds STRING_DELIMITER.
Parameters:
- pcontext, handle to a structure, containing the stream to read from.
+ pcontext, handle to a structure, containing the stream to read from.
- str, pointer to string to be filled in.
+ str, pointer to string to be filled in.
Returns:
0 on success
@@ -687,19 +687,19 @@ oldgaa_globus_get_string_with_whitespaces(policy_file_context_ptr pcontext,
int i=0, j=1, len = strlen(str); /* j=1 because ignore first ' */
int chr, esc = 0;
- while(i < pcontext->buflen) /* read chars from the stream
+ while(i < pcontext->buflen) /* read chars from the stream
untill see STRING_DELIMITER */
- {
+ {
chr = (jbuf[pcontext->index++];
- if(pcontext->index == pcontext->buflen)
- {
+ if(pcontext->index == pcontext->buflen)
+ {
end_of_file = TRUE;
oldgaa_handle_error(&(pcontext->parse_error),
"oldgaa_globus_get_string_with_white_spaces: Missing string delimiter \'");
return -1;
- }
+ }
if (!esc && chr == STRING_DELIMITER) break; /* don't check if escaped*/
esc = !esc && (chr == ESCAPE_CHARACTER); /* !esc takes care of \\ */
if (!esc) { str[i] = chr; i++; } /* don't print out the \ */
@@ -722,10 +722,10 @@ oldgaa_globus_get_string_with_whitespaces(policy_file_context_ptr pcontext,
Function: oldgaa_globus_omit_comment_line
Description:
- omit comment from the stream
+ omit comment from the stream
Parameters:
- pcontext, handle to a structure, containing the stream to read from.
+ pcontext, handle to a structure, containing the stream to read from.
Returns:
0 on success
@@ -737,8 +737,8 @@ static
int
oldgaa_globus_omit_comment_line(policy_file_context_ptr pcontext)
{
- int chr;
-
+ int chr;
+
while(pcontext->index < pcontext->buflen)
{
chr = pcontext->buf[pcontext->index++];
@@ -748,13 +748,13 @@ oldgaa_globus_omit_comment_line(policy_file_context_ptr pcontext)
if (pcontext->index == pcontext->buflen) end_of_file = TRUE;
return 0;
-}
+}
/**********************************************************************
-Function: oldgaa_globus_parse_policy()
+Function: oldgaa_globus_parse_policy()
Description:
Parses the policy file, filling oldgaa_policy structure. The format of
@@ -763,16 +763,16 @@ Function: oldgaa_globus_parse_policy()
Parameters:
minor_status, mechanism-specific status code
pcontext, handle to a structure, containing the stream to read from.
- policy_handle, pointer to oldgaa_policy structure to be filled in.
-
+ policy_handle, pointer to oldgaa_policy structure to be filled in.
+
Returns:
- OLDGAA_SUCCESS or OLDGAA_RETREIVE_ERROR
+ OLDGAA_SUCCESS or OLDGAA_RETREIVE_ERROR
**********************************************************************/
-oldgaa_error_code
+oldgaa_error_code
oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
- oldgaa_policy_ptr *policy_handle)
+ oldgaa_policy_ptr *policy_handle)
{
oldgaa_conditions_ptr all_conditions = NULL;
@@ -788,8 +788,7 @@ oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
char *str;
int cond_present = FALSE;
- int new_entry = TRUE;
- oldgaa_rights_ptr old_rights = 0;
+ int new_entry = TRUE;
str = malloc(pcontext->buflen);
str[0] = 0;
@@ -800,22 +799,22 @@ oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
#ifdef DEBUG
fprintf(stderr, "\noldgaa_globus_parse_policy:\n");
#endif /* DEBUG */
-
- while (!end_of_file)
- {
+
+ while (!end_of_file)
+ {
if (new_entry == TRUE) /* start parsing new entry */
{
cond_present = FALSE;
new_entry = FALSE;
/* get principals */
-
+
if(oldgaa_globus_parse_principals(pcontext,
policy_handle,
str,
&start_principals,
&added_principal) != OLDGAA_SUCCESS)
- {
+ {
oldgaa_handle_error(&(pcontext->parse_error),
"oldgaa_globus_parse_policy: error while parsing principal: ");
m_status = ERROR_WHILE_PARSING_PRINCIPALS;
@@ -829,27 +828,26 @@ oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
/* get rights */
- old_rights = start_rights;
- oldgaa_error = oldgaa_globus_parse_rights(pcontext,
+ oldgaa_error = oldgaa_globus_parse_rights(pcontext,
str,
- &start_rights,
+ &start_rights,
&cond_present,
&new_entry);
if(oldgaa_error != OLDGAA_SUCCESS)
- {
+ {
oldgaa_handle_error(&(pcontext->parse_error),
- "oldgaa_globus_parse_policy: error while parsing right: ");
+ "oldgaa_globus_parse_policy: error while parsing right: ");
m_status = ERROR_WHILE_PARSING_RIGHTS;
goto err;
}
- /* bind paresed rights for this entry to the paresed principals
+ /* bind paresed rights for this entry to the paresed principals
from this entry */
oldgaa_bind_rights_to_principal(added_principal, start_rights);
-
+
/* get conditions, if any */
-
+
if(cond_present == TRUE)
{
oldgaa_error = oldgaa_globus_parse_conditions(pcontext,
@@ -862,47 +860,47 @@ oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
if (oldgaa_error == OLDGAA_SUCCESS) {
fprintf(stderr, "parsed condition_binding\n");
if (cond_bind)
- print_condition_binding(cond_bind);
+ print_condition_binding(cond_bind);
} else
- fprintf(stderr, "didn't parse condition binding\n");
+ fprintf(stderr, "didn't parse condition binding\n");
#endif /* LDEBUG */
-
- if (oldgaa_error != OLDGAA_SUCCESS)
+
+ if (oldgaa_error != OLDGAA_SUCCESS)
{
oldgaa_handle_error(&(pcontext->parse_error),
"oldgaa_globus_parse_policy: error while parsing condition: ");
-
- m_status = ERROR_WHILE_PARSING_CONDITIONS;
+
+ m_status = ERROR_WHILE_PARSING_CONDITIONS;
goto err;
}
-
- /* bind paresed conditions for this entry to the paresed rights
+
+ /* bind paresed conditions for this entry to the paresed rights
from this entry */
- else oldgaa_bind_rights_to_condition(start_rights, cond_bind);
-
+ else oldgaa_bind_rights_to_condition(start_rights, cond_bind);
+
} /* if(cond_present == TRUE) */
-
+
#ifdef LDEBUG
printf("start_principals:\n");
if (start_principals)
- print_oldgaa_principal_ptr(start_principals);
+ print_oldgaa_principal_ptr(start_principals);
#endif /* LDEBUG */
-
+
}/* end of while */
- /*
- * Since the conditions are now all bound to cond_bindings,
+ /*
+ * Since the conditions are now all bound to cond_bindings,
* we can remove the next chain pointers so they don't get
- * in the way during free if there are other chains
- * using conditions.
+ * in the way during free if there are other chains
+ * using conditions.
*/
{
- oldgaa_conditions_ptr c1p, c2p;
+ oldgaa_conditions_ptr c1p, c2p;
- c1p = all_conditions;
+ c1p = all_conditions;
while(c1p)
{
c2p = c1p->next;
@@ -910,13 +908,13 @@ oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
c1p = c2p;
}
}
-
+
if (pcontext) oldgaa_globus_policy_file_close(pcontext);
#ifdef LDEBUG
printf("policy_handle:\n");
if (*policy_handle)
- print_oldgaa_principal_ptr(*policy_handle);
+ print_oldgaa_principal_ptr(*policy_handle);
#endif /* LDEBUG */
free(str);
@@ -933,19 +931,19 @@ oldgaa_globus_parse_policy (policy_file_context_ptr pcontext,
/**********************************************************************
-Function: oldgaa_globus_parse_principals()
+Function: oldgaa_globus_parse_principals()
Description:
- Parses the policy file, filling oldgaa_rincipals structure.
+ Parses the policy file, filling oldgaa_rincipals structure.
Parameters:
pcontext, handle to a structure, containing the stream to read from.
- policy, pointer to oldgaa_policy structure to be filled in.
+ policy, pointer to oldgaa_policy structure to be filled in.
tmp_str, contains a string which will be evaluated and in the end,
new value is stored here.
start, stores a pointer to oldgaa_principals structure of the set
of principals which will be read by this invokation. This is needed
- by the bind_rights_to_principals function.
+ by the bind_rights_to_principals function.
Returns:
OLDGAA_SUCCESS or OLDGAA_PARSE_ERROR
@@ -954,13 +952,13 @@ Function: oldgaa_globus_parse_principals()
static oldgaa_error_code
oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
- oldgaa_policy_ptr *policy,
+ oldgaa_policy_ptr *policy,
char *tmp_str /* IN&OUT */,
- oldgaa_principals_ptr *start,
- oldgaa_principals_ptr *added_principal)
+ oldgaa_principals_ptr *start,
+ oldgaa_principals_ptr *added_principal)
{
char *str, *type;
- uint32 minor_status;
+ uint32 minor_status;
oldgaa_principals_ptr principal = NULL;
oldgaa_error_code error_code = OLDGAA_SUCCESS;
@@ -980,23 +978,23 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
if (oldgaa_globus_help_read_string(pcontext, str,
"parse principals: Empty policy"))
{
- error_code = OLDGAA_RETRIEVE_ERROR;
+ error_code = OLDGAA_RETRIEVE_ERROR;
goto free_str;
}
}
- else
+ else
{
/* get the value of read principal from tmp_str */
strcpy(str, tmp_str);
}
- do
+ do
{ /* get principal's type */
if (strcmp(str, OLDGAA_ANYBODY) == 0)
{
- /* do not check for authority and value */
- type = OLDGAA_ANYBODY;
+ /* do not check for authority and value */
+ type = OLDGAA_ANYBODY;
}
else if(strcmp(str,OLDGAA_USER) == 0)
{
@@ -1018,21 +1016,21 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
{
type = OLDGAA_APPLICATION;
}
- else
+ else
{
- oldgaa_handle_error(&(pcontext->parse_error),
+ oldgaa_handle_error(&(pcontext->parse_error),
"parse_principals: Bad principal type");
error_code = OLDGAA_RETRIEVE_ERROR;
goto free_str;
}
-
+
oldgaa_allocate_principals(&principal);
- if (type)
+ if (type)
{
principal->type = oldgaa_strcopy(type, principal->type);
}
-
+
if (strcmp(type, OLDGAA_ANYBODY)== 0)
{
/* fill in default values */
@@ -1048,11 +1046,11 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
error_code = OLDGAA_RETRIEVE_ERROR;
goto release_principal;
}
-
+
if (str)
{
/* expecting defining authority */
- principal->authority = oldgaa_strcopy(str, principal->authority);
+ principal->authority = oldgaa_strcopy(str, principal->authority);
}
if (oldgaa_globus_help_read_string(pcontext, str,
@@ -1061,13 +1059,13 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
error_code = OLDGAA_RETRIEVE_ERROR;
goto release_principal;
}
-
+
if (str)
{
/* expecting value */
principal->value = oldgaa_strcopy(str, principal->value);
}
- } /* end of if(type != "access_id_ANYBODY")*/
+ } /* end of if(type != "access_id_ANYBODY")*/
if (*policy == NULL)
{
@@ -1085,7 +1083,7 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
{
oldgaa_release_principals(&minor_status, &principal);
}
- /* In either case, the principal is now pointed to by either the
+ /* In either case, the principal is now pointed to by either the
* *start list or has been freed, so we don't need it any more
*/
principal = NULL;
@@ -1101,13 +1099,13 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
strcpy(tmp_str, str); /* return the read string */
if( !strcmp(str,POSITIVE_RIGHTS) ||
- !strcmp(str,NEGATIVE_RIGHTS) ) /* operation set starts */
+ !strcmp(str,NEGATIVE_RIGHTS) ) /* operation set starts */
{
goto release_principal;
}
} while(!end_of_file);
-
+
release_principal:
if (principal)
{
@@ -1123,10 +1121,10 @@ oldgaa_globus_parse_principals(policy_file_context_ptr pcontext,
/**********************************************************************
-Function: oldgaa_globus_parse_rights()
+Function: oldgaa_globus_parse_rights()
Description:
- Parses the policy file, filling oldgaa_rights structure.
+ Parses the policy file, filling oldgaa_rights structure.
Parameters:
pcontext, handle to a structure, containing the stream to read from.
@@ -1136,7 +1134,7 @@ Function: oldgaa_globus_parse_rights()
of rights which will be read by this invokation. This is needed
by the bind_rights_to_conditions function.
cond_present, indicates if condition set starts
- end_of_entry, indicates if new entry starts
+ end_of_entry, indicates if new entry starts
Returns:
OLDGAA_SUCCESS or OLDGAA_RETRIEVE_ERROR
@@ -1155,7 +1153,7 @@ oldgaa_globus_parse_rights(
oldgaa_rights_ptr rights = NULL;
oldgaa_error_code error_code = OLDGAA_SUCCESS;
uint32 minor_status;
-
+
str = malloc(pcontext->buflen);
if (str == NULL)
{
@@ -1168,78 +1166,78 @@ oldgaa_globus_parse_rights(
fprintf(stderr, "\noldgaa_globus_parse rights:\n");
#endif /* DEBUG */
- strcpy(str, tmp_str);
+ strcpy(str, tmp_str);
do {
if ((oldgaa_strings_match(str,POSITIVE_RIGHTS) ||
- oldgaa_strings_match(str,NEGATIVE_RIGHTS))== FALSE)
+ oldgaa_strings_match(str,NEGATIVE_RIGHTS))== FALSE)
{
/* expecting operation set starts */
error_code = OLDGAA_RETRIEVE_ERROR;
oldgaa_handle_error(&(pcontext->parse_error), "Bad right type");
goto free_str;
- }
-
+ }
+
/* allocate fill in the oldgaa_rights structure */
oldgaa_allocate_rights(&rights);
if (str)
{
rights->type = oldgaa_strcopy(str, rights->type);
}
-
+
if (oldgaa_globus_help_read_string(pcontext, str,
"parse_rights: Missing right authority"))
{
- error_code = OLDGAA_RETRIEVE_ERROR;
+ error_code = OLDGAA_RETRIEVE_ERROR;
goto free_rights;
}
-
+
if (str)
{
- /* expecting defining authority */
+ /* expecting defining authority */
rights->authority = oldgaa_strcopy(str, rights->authority);
}
-
+
if (oldgaa_globus_help_read_string(pcontext, str,
"parse_rights: Missing right value"))
{
- error_code = OLDGAA_RETRIEVE_ERROR;
+ error_code = OLDGAA_RETRIEVE_ERROR;
goto free_rights;
}
-
+
if (str)
{
- /* expecting value */
+ /* expecting value */
rights->value = oldgaa_strcopy(str, rights->value);
}
-
- if(first == TRUE) { *start = rights; first = FALSE; }
+
+ if(first == TRUE) { *start = rights; first = FALSE; }
else oldgaa_add_rights(start, rights);
rights = NULL;
- if (oldgaa_globus_read_string(pcontext, str, NULL))
+ if (oldgaa_globus_read_string(pcontext, str, NULL))
{
error_code = OLDGAA_RETRIEVE_ERROR;
goto free_str;
}
-
+
strcpy(tmp_str, str); /* return the read string */
-
+
if (!strncmp(str,COND_PREFIX, 5)) /* condition set starts */
{
*cond_present = TRUE;
goto free_str;
}
-
+
if(!strncmp(str,PRINCIPAL_ACCESS_PREFIX, 6) ||
- !strncmp(str,PRINCIPAL_GRANTOR_PREFIX, 7)) /* new entry starts */
+ !strncmp(str,PRINCIPAL_GRANTOR_PREFIX, 7)) /* new entry starts */
{
- *end_of_entry = TRUE;
+ *end_of_entry = TRUE;
goto free_str;
- }
+ }
} while(!end_of_file);
@@ -1258,20 +1256,20 @@ oldgaa_globus_parse_rights(
/**********************************************************************
-Function: oldgaa_globus_parse_conditions()
+Function: oldgaa_globus_parse_conditions()
Description:
- Parses the policy file, filling oldgaa_conditions structure.
+ Parses the policy file, filling oldgaa_conditions structure.
Parameters:
pcontext, handle to a structure, containing the stream to read from.
- conditions, pointer to oldgaa_conditions structure to be filled in.
+ conditions, pointer to oldgaa_conditions structure to be filled in.
tmp_str, contains a string which will be evaluated and in the end,
new value is stored here.
list, stores a pointer to oldgaa_cond_bindings structure of the set
- of conditions which will be read by this invokation.
+ of conditions which will be read by this invokation.
This is needed by the bind_rights_to_conditions function.
- end_of_entry, indicates if new entry starts
+ end_of_entry, indicates if new entry starts
Returns:
OLDGAA_SUCCESS or OLDGAA_RETRIEVE_ERROR
@@ -1281,7 +1279,7 @@ Function: oldgaa_globus_parse_conditions()
oldgaa_error_code
oldgaa_globus_parse_conditions(
policy_file_context_ptr pcontext,
- oldgaa_conditions_ptr *conditions,
+ oldgaa_conditions_ptr *conditions,
char *tmp_str,
oldgaa_cond_bindings_ptr *list,
int *end_of_entry)
@@ -1304,8 +1302,8 @@ oldgaa_globus_parse_conditions(
fprintf(stderr, "\noldgaa_globus_parse conditions:\n");
#endif /* DEBUG */
- strcpy(str, tmp_str);
-
+ strcpy(str, tmp_str);
+
do
{
if(strncmp(str,"cond_", 5) != 0)/* expecting condition set starts */
@@ -1318,11 +1316,11 @@ oldgaa_globus_parse_conditions(
/* allocate fill in the oldgaa_conditions structure */
oldgaa_allocate_conditions(&cond);
- if (str)
+ if (str)
{
cond->type = oldgaa_strcopy(str,cond->type) ;
}
-
+
if (oldgaa_globus_help_read_string(pcontext, str,
"parse_conditions: Missing condition authority"))
{
@@ -1334,7 +1332,7 @@ oldgaa_globus_parse_conditions(
{
cond->authority = oldgaa_strcopy(str, cond->authority);
}
-
+
if (oldgaa_globus_help_read_string(pcontext, str,
"parse_conditions: Missing condition value"))
{
@@ -1346,7 +1344,7 @@ oldgaa_globus_parse_conditions(
{
cond->value = oldgaa_strcopy(str, cond->value);
}
-
+
oldgaa_allocate_cond_bindings(&cond_bind);
if(*conditions == NULL) { *conditions = cond; }
@@ -1367,29 +1365,29 @@ oldgaa_globus_parse_conditions(
}
cond = NULL;
- if(first == TRUE){ *list = cond_bind; first = FALSE; }
+ if(first == TRUE){ *list = cond_bind; first = FALSE; }
else oldgaa_add_cond_binding(list, cond_bind);
-
- if (oldgaa_globus_read_string(pcontext, str, NULL))
+
+ if (oldgaa_globus_read_string(pcontext, str, NULL))
{
error_code = OLDGAA_RETRIEVE_ERROR;
goto release_conditions;
}
-
+
if(end_of_file == TRUE)
{
goto release_conditions;
}
-
+
strcpy(tmp_str, str); /* return the read string */
if(!strncmp(str,PRINCIPAL_ACCESS_PREFIX, 6) ||
- !strncmp(str,PRINCIPAL_GRANTOR_PREFIX, 7)) /* new entry starts */
+ !strncmp(str,PRINCIPAL_GRANTOR_PREFIX, 7)) /* new entry starts */
{
- *end_of_entry = TRUE;
+ *end_of_entry = TRUE;
goto release_conditions;
- }
+ }
if(!strncmp(str,POS_RIGHTS_PREFIX, 3) ||
!strncmp(str,NEG_RIGHTS_PREFIX, 3)) /* new rights set starts */
@@ -1410,7 +1408,7 @@ oldgaa_globus_parse_conditions(
/*****************************************************************************/
-
+
void
oldgaa_globus_print_rights(oldgaa_rights_ptr rights)
{
@@ -1418,18 +1416,18 @@ oldgaa_globus_print_rights(oldgaa_rights_ptr rights)
oldgaa_cond_bindings_ptr cond;
while(ptr != NULL)
- {
+ {
fprintf(stderr, "ACCESS RIGHT\n");
- fprintf(stderr, "type : %s\n", ptr->type);
+ fprintf(stderr, "type : %s\n", ptr->type);
fprintf(stderr, "authority : %s\n", ptr->authority);
fprintf(stderr, "value : %s\n\n", ptr->value);
- cond = ptr->cond_bindings;
+ cond = ptr->cond_bindings;
while(cond != NULL)
{
fprintf(stderr, "CONDITION\n");
- fprintf(stderr, "type : %s\n", cond->condition->type);
+ fprintf(stderr, "type : %s\n", cond->condition->type);
fprintf(stderr, "authority : %s\n", cond->condition->authority);
fprintf(stderr, "value : %s\n", cond->condition->value);
fprintf(stderr, "status : %08x\n\n", cond->condition->status);
@@ -1450,13 +1448,13 @@ oldgaa_globus_print_attributes(oldgaa_sec_attrb_ptr attributes)
while(ptr != NULL)
- {
+ {
fprintf(stderr, "ATTRIBUTE\n");
- fprintf(stderr, "type : %s\n", ptr->type);
+ fprintf(stderr, "type : %s\n", ptr->type);
fprintf(stderr, "authority : %s\n", ptr->authority);
fprintf(stderr, "value : %s\n\n", ptr->value);
- ptr = ptr->next;
+ ptr = ptr->next;
}
}
@@ -1467,28 +1465,28 @@ oldgaa_globus_get_trusted_ca_list(oldgaa_sec_attrb_ptr *attributes,
oldgaa_policy_ptr policy_handle,
oldgaa_rights_ptr rights)
{
- oldgaa_error_code oldgaa_status = OLDGAA_SUCCESS;
- uint32 minor_status = 0;
- oldgaa_principals_ptr principal= NULL;
-
+ oldgaa_error_code oldgaa_status = OLDGAA_SUCCESS;
+ uint32 minor_status = 0;
+ oldgaa_principals_ptr principal = NULL;
+
#ifdef DEBUG
fprintf(stderr, "\noldgaa_globus_get_trusted_ca_list:\n");
#endif /* DEBUG */
oldgaa_allocate_principals(&principal);
- principal->type = oldgaa_strcopy(OLDGAA_CA, principal->type);
+ principal->type = oldgaa_strcopy(OLDGAA_CA, principal->type);
principal->authority = oldgaa_strcopy(OLDGAA_X509_AUTHORITY, principal->authority);
/* principal->value = oldgaa_strcopy("\"*\"", principal->value); */
- oldgaa_status = oldgaa_get_authorized_principals(attributes,
+ oldgaa_status = oldgaa_get_authorized_principals(attributes,
policy_handle,
- principal,
+ principal,
rights);
oldgaa_status = oldgaa_release_principals(&minor_status, &principal);
- return oldgaa_status;
+ return oldgaa_status;
}
diff --git a/gsi/callback/source/library/oldgaa/oldgaa_policy_evaluator.c b/gsi/callback/source/library/oldgaa/oldgaa_policy_evaluator.c
index b7bc78d0b2..821f02d716 100644
--- a/gsi/callback/source/library/oldgaa/oldgaa_policy_evaluator.c
+++ b/gsi/callback/source/library/oldgaa/oldgaa_policy_evaluator.c
@@ -260,23 +260,18 @@ oldgaa_get_authorized_principals(oldgaa_sec_attrb_ptr *attributes,
{
oldgaa_policy_ptr entry = policy;
int was_anybody = 0;
- int was_neg_rights = 0;
int number_of_entries = 1;
oldgaa_sec_attrb_ptr attrb = NULL;
- uint32 minor_status;
oldgaa_error_code oldgaa_status = OLDGAA_SUCCESS;
#ifdef DEBUG
fprintf(stderr, "\noldgaa_get_authorized_principals:\n");
#endif /* DEBUG */
- minor_status = 0;
-
/* Check arguments */
if (!policy && !attributes)
{
errno = ERRNO_INVALID_ARGUMENT;
- minor_status = -1;
return OLDGAA_FAILURE;
}
@@ -302,14 +297,6 @@ fprintf(stderr, "\noldgaa_get_authorized_principals:\n");
oldgaa_add_attribute(attributes, attrb);
number_of_entries++;
}
- else
- {
- if(oldgaa_strings_match(entry->rights->type, NEGATIVE_RIGHTS) &&
- oldgaa_strings_match(entry->rights->authority, rights->authority) &&
- oldgaa_strings_match(entry->rights->value, rights->value) ) was_neg_rights = 1;
- }
-
-
}
entry = entry->next;
diff --git a/gsi/callback/source/library/oldgaa/oldgaa_release.c b/gsi/callback/source/library/oldgaa/oldgaa_release.c
index 8585ac3838..f4aae9cdcb 100644
--- a/gsi/callback/source/library/oldgaa/oldgaa_release.c
+++ b/gsi/callback/source/library/oldgaa/oldgaa_release.c
@@ -15,10 +15,10 @@
*/
/**********************************************************************
- oldgaa_release.c:
+ oldgaa_release.c:
Description:
- This file used internally by the oldgaa routines
+ This file used internally by the oldgaa routines
**********************************************************************/
#include "globus_oldgaa.h"
#include "stdio.h" /* for fprintf() */
@@ -27,56 +27,56 @@
Function: oldgaa_release_buffer_contents
Description:
- Release the contents of a buffer
+ Release the contents of a buffer
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_buffer_contents (uint32 *minor_status,
- oldgaa_buffer_ptr buffer)
+oldgaa_error_code
+oldgaa_release_buffer_contents (uint32 *minor_status,
+ oldgaa_buffer_ptr buffer)
{
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_buffer_contents:\n");
+ fprintf(stderr, "\noldgaa_release_buffer_contents:\n");
#endif /* DEBUG */
- if (buffer == NULL || buffer == OLDGAA_NO_BUFFER) return OLDGAA_SUCCESS;
-
- if (buffer->value) free(buffer->value);
- buffer->length = 0;
+ if (buffer == NULL || buffer == OLDGAA_NO_BUFFER) return OLDGAA_SUCCESS;
- return OLDGAA_SUCCESS;
+ if (buffer->value) free(buffer->value);
+ buffer->length = 0;
+
+ return OLDGAA_SUCCESS;
} /* oldgaa_release_buffer_contents */
/**********************************************************************
Function: oldgaa_release_buffer
Description:
- Release the buffer
+ Release the buffer
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_buffer(uint32 *minor_status,
- oldgaa_buffer_ptr * buffer)
+oldgaa_error_code
+oldgaa_release_buffer(uint32 *minor_status,
+ oldgaa_buffer_ptr *buffer)
{
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_buffer:\n");
+ fprintf(stderr, "\noldgaa_release_buffer:\n");
#endif /* DEBUG */
- if (buffer == NULL || *buffer == NULL) return OLDGAA_SUCCESS;
-
+ if (buffer == NULL || *buffer == NULL) return OLDGAA_SUCCESS;
+
free(*buffer);
- *buffer = NULL;
+ *buffer = NULL;
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
} /* oldgaa_release_buffer */
@@ -84,61 +84,61 @@ fprintf(stderr, "\noldgaa_release_buffer:\n");
Function: oldgaa_release_options
Description:
- Release the contents of a buffer
+ Release the contents of a buffer
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_options(uint32 *minor_status,
- oldgaa_options_ptr buffer)
+oldgaa_error_code
+oldgaa_release_options(uint32 *minor_status,
+ oldgaa_options_ptr buffer)
{
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_options:\n");
+ fprintf(stderr, "\noldgaa_release_options:\n");
#endif /* DEBUG */
- if (buffer == NULL || buffer == OLDGAA_NO_OPTIONS) return OLDGAA_SUCCESS;
-
- if (buffer->value) free(buffer->value);
- buffer->length = 0;
+ if (buffer == NULL || buffer == OLDGAA_NO_OPTIONS) return OLDGAA_SUCCESS;
+
+ if (buffer->value) free(buffer->value);
+ buffer->length = 0;
- free(buffer);
+ free(buffer);
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
} /* oldgaa_release_options */
-
+
/**********************************************************************
Function: oldgaa_release_data
Description:
- Release the contents of a buffer
+ Release the contents of a buffer
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_data (uint32 *minor_status,
- oldgaa_data_ptr buffer)
+oldgaa_error_code
+oldgaa_release_data (uint32 *minor_status,
+ oldgaa_data_ptr buffer)
{
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_data:\n");
+ fprintf(stderr, "\noldgaa_release_data:\n");
#endif /* DEBUG */
- if (buffer == NULL || buffer == OLDGAA_NO_DATA) return OLDGAA_SUCCESS;
-
- if (buffer->str) free(buffer->str);
- if (buffer->error_str) free(buffer->error_str);
+ if (buffer == NULL || buffer == OLDGAA_NO_DATA) return OLDGAA_SUCCESS;
+
+ if (buffer->str) free(buffer->str);
+ if (buffer->error_str) free(buffer->error_str);
- free(buffer);
+ free(buffer);
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
} /* oldgaa_release_data */
@@ -149,74 +149,74 @@ fprintf(stderr, "\noldgaa_release_data:\n");
Function: oldgaa_delete_sec_context()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_sec_context(uint32 *minor_status,
- oldgaa_sec_context_ptr *sec_context)
+oldgaa_error_code
+oldgaa_release_sec_context(uint32 *minor_status,
+ oldgaa_sec_context_ptr *sec_context)
{
- oldgaa_sec_context_ptr *context_handle = sec_context;
- uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_sec_context_ptr *context_handle = sec_context;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_sec_context:\n");
+ fprintf(stderr, "\noldgaa_release_sec_context:\n");
#endif /* DEBUG */
- if (*context_handle == NULL || *context_handle == OLDGAA_NO_SEC_CONTEXT)
- return OLDGAA_SUCCESS ;
+ if (*context_handle == NULL || *context_handle == OLDGAA_NO_SEC_CONTEXT)
+ return OLDGAA_SUCCESS ;
+
+ /* ignore errors to allow for incomplete context handles */
+
+ if ((*context_handle)->identity_cred!= NULL)
+ oldgaa_release_identity_cred(&inv_minor_status,
+ &((*context_handle)->identity_cred));
- /* ignore errors to allow for incomplete context handles */
- if ((*context_handle)->identity_cred!= NULL)
- inv_major_status = oldgaa_release_identity_cred(&inv_minor_status,
- &((*context_handle)->identity_cred));
-
+ if ((*context_handle)->authr_cred!= NULL)
+ oldgaa_release_authr_cred(&inv_minor_status,
+ &((*context_handle)->authr_cred));
- if ((*context_handle)->authr_cred!= NULL)
- inv_major_status = oldgaa_release_authr_cred(&inv_minor_status,
- &((*context_handle)->authr_cred));
-
- if ((*context_handle)->group_membership!= NULL)
- inv_major_status = oldgaa_release_identity_cred(&inv_minor_status,
- &((*context_handle)->group_membership));
-
+ if ((*context_handle)->group_membership!= NULL)
+ oldgaa_release_identity_cred(&inv_minor_status,
+ &((*context_handle)->group_membership));
- if ((*context_handle)->group_non_membership!= NULL)
- inv_major_status = oldgaa_release_identity_cred(&inv_minor_status,
- &((*context_handle)->group_non_membership));
-
- if ((*context_handle)->attributes!= NULL)
- inv_major_status = oldgaa_release_attributes(&inv_minor_status,
- &((*context_handle)->attributes));
-
+ if ((*context_handle)->group_non_membership!= NULL)
+ oldgaa_release_identity_cred(&inv_minor_status,
+ &((*context_handle)->group_non_membership));
- if ((*context_handle)->unevl_cred!= NULL)
- inv_major_status = oldgaa_release_uneval_cred(&inv_minor_status,
- &((*context_handle)->unevl_cred));
-
- if ((*context_handle)->connection_state!= NULL)
- {
- inv_major_status = oldgaa_release_buffer_contents(&inv_minor_status,
- (*context_handle)->connection_state);
+ if ((*context_handle)->attributes!= NULL)
+ oldgaa_release_attributes(&inv_minor_status,
+ &((*context_handle)->attributes));
- inv_major_status = oldgaa_release_buffer(&inv_minor_status,
- &((*context_handle)->connection_state));
- }
- free(*context_handle);
+ if ((*context_handle)->unevl_cred!= NULL)
+ oldgaa_release_uneval_cred(&inv_minor_status,
+ &((*context_handle)->unevl_cred));
+
+
+ if ((*context_handle)->connection_state!= NULL)
+ {
+ oldgaa_release_buffer_contents(&inv_minor_status,
+ (*context_handle)->connection_state);
+
+ oldgaa_release_buffer(&inv_minor_status,
+ &((*context_handle)->connection_state));
+ }
+
+ free(*context_handle);
*context_handle = OLDGAA_NO_SEC_CONTEXT;
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
} /* oldgaa_delete_sec_context */
@@ -224,119 +224,108 @@ fprintf(stderr, "\noldgaa_release_sec_context:\n");
Function: oldgaa_release_identity_cred()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_identity_cred (uint32 *minor_status,
- oldgaa_identity_cred_ptr *identity_cred)
+oldgaa_error_code
+oldgaa_release_identity_cred (uint32 *minor_status,
+ oldgaa_identity_cred_ptr *identity_cred)
{
- oldgaa_identity_cred_ptr *cred = identity_cred;
- uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_identity_cred_ptr *cred = identity_cred;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_identity_cred:\n");
+ fprintf(stderr, "\noldgaa_release_identity_cred:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_IDENTITY_CRED)
- return OLDGAA_SUCCESS;
-
- /* ignore errors to allow for incomplete context handles */
-
- if ((*cred)->principal!= NULL)
- inv_major_status = oldgaa_release_principals(&inv_minor_status,
- &((*cred)->principal));
-
- if ((*cred)->conditions!= NULL)
- inv_major_status = oldgaa_release_conditions(&inv_minor_status,
- &((*cred)->conditions));
-
- if ((*cred)->mech_spec_cred!= NULL)
- {
- inv_major_status =
- oldgaa_release_buffer_contents(&inv_minor_status,
- (*cred)->mech_spec_cred);
- inv_major_status = oldgaa_release_buffer(&inv_minor_status,
- &((*cred)->mech_spec_cred));
- }
-
- if ((*cred)->next!= NULL)
- inv_major_status = oldgaa_release_identity_cred(&inv_minor_status,
- &((*cred)->next));
+ if (*cred == NULL || *cred == OLDGAA_NO_IDENTITY_CRED)
+ return OLDGAA_SUCCESS;
+
+ /* ignore errors to allow for incomplete context handles */
+
+ if ((*cred)->principal!= NULL)
+ oldgaa_release_principals(&inv_minor_status, &((*cred)->principal));
+
+ if ((*cred)->conditions!= NULL)
+ oldgaa_release_conditions(&inv_minor_status, &((*cred)->conditions));
+
+ if ((*cred)->mech_spec_cred!= NULL)
+ {
+ oldgaa_release_buffer_contents(&inv_minor_status,
+ (*cred)->mech_spec_cred);
+ oldgaa_release_buffer(&inv_minor_status, &((*cred)->mech_spec_cred));
+ }
+
+ if ((*cred)->next!= NULL)
+ oldgaa_release_identity_cred(&inv_minor_status, &((*cred)->next));
free(*cred);
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
-}
+}
/**********************************************************************
Function: oldgaa_release_authr_cred()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_authr_cred(uint32 *minor_status,
- oldgaa_authr_cred_ptr *authr_cred)
+oldgaa_error_code
+oldgaa_release_authr_cred(uint32 *minor_status,
+ oldgaa_authr_cred_ptr *authr_cred)
{
- oldgaa_authr_cred_ptr *cred = authr_cred;
- uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_authr_cred_ptr *cred = authr_cred;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_authr_cred:\n");
+ fprintf(stderr, "\noldgaa_release_authr_cred:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_AUTHORIZATION_CRED)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_AUTHORIZATION_CRED)
+ return OLDGAA_SUCCESS;
+
+ /* ignore errors to allow for incomplete context handles */
+
+ if ((*cred)->grantor != NULL)
+ oldgaa_release_principals(&inv_minor_status, &((*cred)->grantor));
- /* ignore errors to allow for incomplete context handles */
- if ((*cred)->grantor != NULL)
- inv_major_status = oldgaa_release_principals(&inv_minor_status,
- &((*cred)->grantor));
-
+ if ((*cred)->grantee != NULL)
+ oldgaa_release_principals(&inv_minor_status, &((*cred)->grantee));
- if ((*cred)->grantee != NULL)
- inv_major_status = oldgaa_release_principals(&inv_minor_status,
- &((*cred)->grantee));
-
/*
- *DEE what about release of objects?
+ *DEE what about release of objects?
* Since There are is no oldgaa_allocate_authr_cred
- * that can be fixed when this routine is actually used.
+ * that can be fixed when this routine is actually used.
*/
- if ((*cred)->access_rights!= NULL)
- inv_major_status = oldgaa_release_rights(&inv_minor_status,
- &((*cred)->access_rights));
-
- if ((*cred)->mech_spec_cred!= NULL)
- {
- inv_major_status =
- oldgaa_release_buffer_contents(&inv_minor_status,
- (*cred)->mech_spec_cred);
- inv_major_status = oldgaa_release_buffer(&inv_minor_status,
- &((*cred)->mech_spec_cred));
- }
-
- if ((*cred)->next!= NULL)
- inv_major_status = oldgaa_release_authr_cred(&inv_minor_status,
- &((*cred)->next));
-
- free(*cred);
+ if ((*cred)->access_rights!= NULL)
+ oldgaa_release_rights(&inv_minor_status, &((*cred)->access_rights));
+
+ if ((*cred)->mech_spec_cred!= NULL)
+ {
+ oldgaa_release_buffer_contents(&inv_minor_status,
+ (*cred)->mech_spec_cred);
+ oldgaa_release_buffer(&inv_minor_status, &((*cred)->mech_spec_cred));
+ }
+
+ if ((*cred)->next!= NULL)
+ oldgaa_release_authr_cred(&inv_minor_status, &((*cred)->next));
+
+ free(*cred);
return OLDGAA_SUCCESS;
@@ -346,56 +335,53 @@ fprintf(stderr, "\noldgaa_release_authr_cred:\n");
Function: oldgaa_release_attributes()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_attributes(uint32 *minor_status,
- oldgaa_attributes_ptr *attributes)
+oldgaa_error_code
+oldgaa_release_attributes(uint32 *minor_status,
+ oldgaa_attributes_ptr *attributes)
{
-oldgaa_attributes_ptr *cred = attributes;
-uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_attributes_ptr *cred = attributes;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_attributes:\n");
+ fprintf(stderr, "\noldgaa_release_attributes:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_ATTRIBUTES)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_ATTRIBUTES)
+ return OLDGAA_SUCCESS;
- /* ignore errors to allow for incomplete context handles */
+ /* ignore errors to allow for incomplete context handles */
- if ((*cred)->mech_type != NULL) free((*cred)->mech_type);
- if ((*cred)->type != NULL) free((*cred)->type);
- if ((*cred)->value != NULL) free((*cred)->value);
+ if ((*cred)->mech_type != NULL) free((*cred)->mech_type);
+ if ((*cred)->type != NULL) free((*cred)->type);
+ if ((*cred)->value != NULL) free((*cred)->value);
-
- if ((*cred)->conditions!= NULL)
- inv_major_status = oldgaa_release_cond_bindings(&inv_minor_status,
- &((*cred)->conditions));
- if ((*cred)->mech_spec_cred!= NULL)
- {
- inv_major_status =
- oldgaa_release_buffer_contents(&inv_minor_status,
- (*cred)->mech_spec_cred);
- inv_major_status =oldgaa_release_buffer(&inv_minor_status,
- &((*cred)->mech_spec_cred));
- }
+ if ((*cred)->conditions!= NULL)
+ oldgaa_release_cond_bindings(&inv_minor_status,
+ &((*cred)->conditions));
- if ((*cred)->next!= NULL)
- inv_major_status = oldgaa_release_attributes(&inv_minor_status,
- &((*cred)->next));
+ if ((*cred)->mech_spec_cred!= NULL)
+ {
+ oldgaa_release_buffer_contents(&inv_minor_status,
+ (*cred)->mech_spec_cred);
+ oldgaa_release_buffer(&inv_minor_status, &((*cred)->mech_spec_cred));
+ }
- free(*cred);
+ if ((*cred)->next!= NULL)
+ oldgaa_release_attributes(&inv_minor_status, &((*cred)->next));
- return OLDGAA_SUCCESS;
+ free(*cred);
+
+ return OLDGAA_SUCCESS;
} /* oldgaa_rlease_attributes */
@@ -403,56 +389,51 @@ fprintf(stderr, "\noldgaa_release_attributes:\n");
Function: oldgaa_rlease_uneval_cred()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_uneval_cred(uint32 *minor_status,
- oldgaa_uneval_cred_ptr *uneval_cred)
+oldgaa_error_code
+oldgaa_release_uneval_cred(uint32 *minor_status,
+ oldgaa_uneval_cred_ptr *uneval_cred)
{
- oldgaa_uneval_cred_ptr *cred = uneval_cred;
- uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_uneval_cred_ptr *cred = uneval_cred;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_uneval_cred:\n");
+ fprintf(stderr, "\noldgaa_release_uneval_cred:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_UNEVAL_CRED)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_UNEVAL_CRED)
+ return OLDGAA_SUCCESS;
+
+ /* ignore errors to allow for incomplete context handles */
- /* ignore errors to allow for incomplete context handles */
-
- if ((*cred)->grantor != NULL)
- inv_major_status = oldgaa_release_principals(&inv_minor_status,
- &((*cred)->grantor));
-
+ if ((*cred)->grantor != NULL)
+ oldgaa_release_principals(&inv_minor_status, &((*cred)->grantor));
- if ((*cred)->grantee != NULL)
- inv_major_status = oldgaa_release_principals(&inv_minor_status,
- &((*cred)->grantee));
+ if ((*cred)->grantee != NULL)
+ oldgaa_release_principals(&inv_minor_status, &((*cred)->grantee));
- if ((*cred)->mech_spec_cred!= NULL)
- {
- inv_major_status =
- oldgaa_release_buffer_contents(&inv_minor_status,
- (*cred)->mech_spec_cred);
- inv_major_status = oldgaa_release_buffer(&inv_minor_status,
- &((*cred)->mech_spec_cred));
- }
- if ((*cred)->next!= NULL)
- inv_major_status = oldgaa_release_uneval_cred(&inv_minor_status,
- &((*cred)->next));
+ if ((*cred)->mech_spec_cred!= NULL)
+ {
+ oldgaa_release_buffer_contents(&inv_minor_status,
+ (*cred)->mech_spec_cred);
+ oldgaa_release_buffer(&inv_minor_status, &((*cred)->mech_spec_cred));
+ }
- free(*cred);
+ if ((*cred)->next!= NULL)
+ oldgaa_release_uneval_cred(&inv_minor_status, &((*cred)->next));
+
+ free(*cred);
return OLDGAA_SUCCESS;
@@ -462,47 +443,45 @@ fprintf(stderr, "\noldgaa_release_uneval_cred:\n");
Function: oldgaa_rlease_principals()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_principals(uint32 *minor_status,
- oldgaa_principals_ptr *principals)
+oldgaa_error_code
+oldgaa_release_principals(uint32 *minor_status,
+ oldgaa_principals_ptr *principals)
{
-oldgaa_principals_ptr *cred = principals;
-uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_principals_ptr *cred = principals;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_principals:\n");
+ fprintf(stderr, "\noldgaa_release_principals:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_PRINCIPALS)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_PRINCIPALS)
+ return OLDGAA_SUCCESS;
- /* ignore errors to allow for incomplete context handles */
+ /* ignore errors to allow for incomplete context handles */
- if ((*cred)->rights != NULL)
- inv_major_status = oldgaa_release_rights(&inv_minor_status,
- &((*cred)->rights));
+ if ((*cred)->rights != NULL)
+ oldgaa_release_rights(&inv_minor_status, &((*cred)->rights));
- if ((*cred)->next != NULL)
- inv_major_status = oldgaa_release_principals(&inv_minor_status,
- &((*cred)->next));
-
- if ((*cred)->type != NULL) free((*cred)->type);
- if ((*cred)->authority != NULL) free((*cred)->authority);
- if ((*cred)->value != NULL) free((*cred)->value);
-
+ if ((*cred)->next != NULL)
+ oldgaa_release_principals(&inv_minor_status, &((*cred)->next));
+
+ if ((*cred)->type != NULL) free((*cred)->type);
+ if ((*cred)->authority != NULL) free((*cred)->authority);
+ if ((*cred)->value != NULL) free((*cred)->value);
+
free(*cred);
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
} /* oldgaa_rlease_principals */
@@ -510,31 +489,31 @@ fprintf(stderr, "\noldgaa_release_principals:\n");
Function: oldgaa_rlease_rights()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_rights(uint32 *minor_status,
- oldgaa_rights_ptr *rights)
+oldgaa_error_code
+oldgaa_release_rights(uint32 *minor_status,
+ oldgaa_rights_ptr *rights)
{
-oldgaa_rights_ptr *cred = rights;
-uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_rights_ptr *cred = rights;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_rights:\n");
+ fprintf(stderr, "\noldgaa_release_rights:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_RIGHTS)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_RIGHTS)
+ return OLDGAA_SUCCESS;
#ifdef DEBUG
-fprintf(stderr, "rights:%p:ref:%d\n",*cred,(*cred)->reference_count);
+ fprintf(stderr, "rights:%p:ref:%d\n",*cred,(*cred)->reference_count);
#endif /* DEBUG */
(*cred)->reference_count--;
@@ -543,27 +522,26 @@ fprintf(stderr, "rights:%p:ref:%d\n",*cred,(*cred)->reference_count);
return OLDGAA_SUCCESS;
}
- /* ignore errors to allow for incomplete context handles */
+ /* ignore errors to allow for incomplete context handles */
-
- if ((*cred)->cond_bindings != NULL)
- inv_major_status = oldgaa_release_cond_bindings(&inv_minor_status,
- &((*cred)->cond_bindings));
-
- if ((*cred)->next != NULL)
- inv_major_status = oldgaa_release_rights(&inv_minor_status,
- &((*cred)->next));
-
- if ((*cred)->type != NULL) free((*cred)->type);
- if ((*cred)->authority != NULL) free((*cred)->authority);
- if ((*cred)->value != NULL) free((*cred)->value);
+ if ((*cred)->cond_bindings != NULL)
+ oldgaa_release_cond_bindings(&inv_minor_status,
+ &((*cred)->cond_bindings));
+
+
+ if ((*cred)->next != NULL)
+ oldgaa_release_rights(&inv_minor_status, &((*cred)->next));
+
+ if ((*cred)->type != NULL) free((*cred)->type);
+ if ((*cred)->authority != NULL) free((*cred)->authority);
+ if ((*cred)->value != NULL) free((*cred)->value);
+
-
free(*cred);
*rights = NULL;
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
} /* oldgaa_rlease_rights */
@@ -571,82 +549,80 @@ fprintf(stderr, "rights:%p:ref:%d\n",*cred,(*cred)->reference_count);
Function: oldgaa_rlease_cond_bindings()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_cond_bindings(uint32 *minor_status,
- oldgaa_cond_bindings_ptr *cond_bind)
+oldgaa_error_code
+oldgaa_release_cond_bindings(uint32 *minor_status,
+ oldgaa_cond_bindings_ptr *cond_bind)
{
- oldgaa_cond_bindings_ptr *cred = cond_bind;
- uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_cond_bindings_ptr *cred = cond_bind;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_cond_bindings:\n");
+ fprintf(stderr, "\noldgaa_release_cond_bindings:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_COND_BINDINGS)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_COND_BINDINGS)
+ return OLDGAA_SUCCESS;
#ifdef DEBUG
-fprintf(stderr, "cond:%p:ref:%d\n",*cred,(*cred)->reference_count);
+ fprintf(stderr, "cond:%p:ref:%d\n",*cred,(*cred)->reference_count);
#endif /* DEBUG */
- (*cred)->reference_count--;
- if ((*cred)->reference_count > 0) {
- *cond_bind = NULL;
- return OLDGAA_SUCCESS;
+ (*cred)->reference_count--;
+ if ((*cred)->reference_count > 0) {
+ *cond_bind = NULL;
+ return OLDGAA_SUCCESS;
}
- /* ignore errors to allow for incomplete context handles */
+ /* ignore errors to allow for incomplete context handles */
+
+ if ((*cred)->condition != NULL)
+ oldgaa_release_conditions(&inv_minor_status, &((*cred)->condition));
- if ((*cred)->condition != NULL)
- inv_major_status = oldgaa_release_conditions(&inv_minor_status,
- &((*cred)->condition));
+ if ((*cred)->next != NULL)
+ oldgaa_release_cond_bindings(&inv_minor_status, &((*cred)->next));
- if ((*cred)->next != NULL)
- inv_major_status = oldgaa_release_cond_bindings(&inv_minor_status,
- &((*cred)->next));
-
free(*cred);
- *cond_bind = NULL;
+ *cond_bind = NULL;
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
-}
+}
/**********************************************************************
Function: oldgaa_rlease_conditions()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_conditions(uint32 *minor_status,
- oldgaa_conditions_ptr *cond)
+oldgaa_error_code
+oldgaa_release_conditions(uint32 *minor_status,
+ oldgaa_conditions_ptr *cond)
{
- oldgaa_conditions_ptr *cred = cond;
- uint32 inv_minor_status = 0, inv_major_status = 0;
+ oldgaa_conditions_ptr *cred = cond;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
-fprintf(stderr, "\noldgaa_release_conditions:\n");
+ fprintf(stderr, "\noldgaa_release_conditions:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_CONDITIONS)
- return OLDGAA_SUCCESS;
+ if (*cred == NULL || *cred == OLDGAA_NO_CONDITIONS)
+ return OLDGAA_SUCCESS;
#ifdef DEBUG
-fprintf(stderr, "conditions:%p:ref:%d\n",*cred,(*cred)->reference_count);
+ fprintf(stderr, "conditions:%p:ref:%d\n",*cred,(*cred)->reference_count);
#endif /* DEBUG */
(*cred)->reference_count--;
@@ -654,57 +630,54 @@ fprintf(stderr, "conditions:%p:ref:%d\n",*cred,(*cred)->reference_count);
*cond = NULL;
return OLDGAA_SUCCESS;
}
- /* ignore errors to allow for incomplete context handles */
+ /* ignore errors to allow for incomplete context handles */
- if ((*cred)->next != NULL)
- inv_major_status = oldgaa_release_conditions(&inv_minor_status,
- &((*cred)->next));
-
- if ((*cred)->type != NULL) free((*cred)->type);
- if ((*cred)->authority != NULL) free((*cred)->authority);
- if ((*cred)->value != NULL) free((*cred)->value);
+ if ((*cred)->next != NULL)
+ oldgaa_release_conditions(&inv_minor_status, &((*cred)->next));
+
+ if ((*cred)->type != NULL) free((*cred)->type);
+ if ((*cred)->authority != NULL) free((*cred)->authority);
+ if ((*cred)->value != NULL) free((*cred)->value);
free(*cred);
- return OLDGAA_SUCCESS;
+ return OLDGAA_SUCCESS;
-}
+}
/**********************************************************************
Function: oldgaa_rlease_answer()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_answer(uint32 *minor_status,
- oldgaa_answer_ptr *answer)
+oldgaa_error_code
+oldgaa_release_answer(uint32 *minor_status,
+ oldgaa_answer_ptr *answer)
{
oldgaa_answer_ptr * cred = answer;
uint32 inv_minor_status = 0;
- uint32 inv_major_status = 0;
#ifdef DEBUG
fprintf(stderr, "\noldgaa_release_answer:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_ANSWER)
+ if (*cred == NULL || *cred == OLDGAA_NO_ANSWER)
{
return OLDGAA_SUCCESS;
}
- if ((*cred)->rights!= NULL)
- {
- /* ignore errors to allow for incomplete context handles */
- inv_major_status =
- oldgaa_release_rights(&inv_minor_status, &((*cred)->rights));
- }
-
+ if ((*cred)->rights!= NULL)
+ {
+ /* ignore errors to allow for incomplete context handles */
+ oldgaa_release_rights(&inv_minor_status, &((*cred)->rights));
+ }
+
if ((*cred)->valid_time != NULL)
{
free((*cred)->valid_time);
@@ -720,35 +693,33 @@ oldgaa_release_answer(uint32 *minor_status,
Function: oldgaa_rlease_principals()
Description:
- delete the security context
+ delete the security context
Parameters:
Returns:
**********************************************************************/
-oldgaa_error_code
-oldgaa_release_sec_attrb(uint32 *minor_status,
- oldgaa_sec_attrb_ptr *attributes)
+oldgaa_error_code
+oldgaa_release_sec_attrb(uint32 *minor_status,
+ oldgaa_sec_attrb_ptr *attributes)
{
oldgaa_sec_attrb_ptr * cred = attributes;
- uint32 inv_minor_status = 0;
- uint32 inv_major_status = 0;
+ uint32 inv_minor_status = 0;
#ifdef DEBUG
fprintf(stderr, "\noldgaa_release_sec_attrb:\n");
#endif /* DEBUG */
- if (*cred == NULL || *cred == OLDGAA_NO_SEC_ATTRB)
+ if (*cred == NULL || *cred == OLDGAA_NO_SEC_ATTRB)
{
return OLDGAA_SUCCESS;
}
- if ((*cred)->next != NULL)
+ if ((*cred)->next != NULL)
{
/* ignore errors to allow for incomplete context handles */
- inv_major_status =
- oldgaa_release_sec_attrb(&inv_minor_status, &((*cred)->next));
+ oldgaa_release_sec_attrb(&inv_minor_status, &((*cred)->next));
}
if ((*cred)->type != NULL) free((*cred)->type);
@@ -758,6 +729,6 @@ oldgaa_release_sec_attrb(uint32 *minor_status,
free(*cred);
return OLDGAA_SUCCESS;
-}
+}
/**********************************************************************/
diff --git a/gsi/callback/source/library/oldgaa/oldgaa_utils.c b/gsi/callback/source/library/oldgaa/oldgaa_utils.c
index 1f5c2a1eef..7c9fd6df28 100644
--- a/gsi/callback/source/library/oldgaa/oldgaa_utils.c
+++ b/gsi/callback/source/library/oldgaa/oldgaa_utils.c
@@ -477,7 +477,7 @@ oldgaa_regex_matches_string(
{
/* Our result (1 == match) */
int result = 0;
- char * star;
+ const char * star;
/* Check arguments */
if (!string || !regex)
diff --git a/gsi/cert_utils/source/configure.ac b/gsi/cert_utils/source/configure.ac
index 9280827ee0..d892a13262 100644
--- a/gsi/cert_utils/source/configure.ac
+++ b/gsi/cert_utils/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gsi_cert_utils], [10.11], [https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gsi_cert_utils], [10.12], [https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/cert_utils/source/library/globus_gsi_cert_utils.c b/gsi/cert_utils/source/library/globus_gsi_cert_utils.c
index a898f54d89..602ba1bf44 100644
--- a/gsi/cert_utils/source/library/globus_gsi_cert_utils.c
+++ b/gsi/cert_utils/source/library/globus_gsi_cert_utils.c
@@ -73,7 +73,7 @@ globus_l_gsi_cert_utils_activate(void)
if(tmp_string != GLOBUS_NULL)
{
globus_i_gsi_cert_utils_debug_level = atoi(tmp_string);
-
+
if(globus_i_gsi_cert_utils_debug_level < 0)
{
globus_i_gsi_cert_utils_debug_level = 0;
@@ -103,7 +103,7 @@ globus_l_gsi_cert_utils_activate(void)
{
goto activate_openssl_fail;
}
-
+
result = globus_module_activate(GLOBUS_GSI_OPENSSL_ERROR_MODULE);
if (result != GLOBUS_SUCCESS)
{
@@ -220,7 +220,7 @@ globus_gsi_cert_utils_make_time(
* values returned, see globus_gsi_cert_utils_cert_type_t.
*
* @param cert
- * The X509 certificate
+ * The X509 certificate
* @param type
* The returned X509 certificate type
*
@@ -229,15 +229,23 @@ globus_gsi_cert_utils_make_time(
*/
globus_result_t
globus_gsi_cert_utils_get_cert_type(
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509 * cert,
+#else
+ const X509 * cert,
+#endif
globus_gsi_cert_utils_cert_type_t * type)
{
- X509_NAME * subject = NULL;
+ const X509_NAME * subject = NULL;
X509_NAME * name = NULL;
- X509_NAME_ENTRY * ne = NULL;
+ const X509_NAME_ENTRY * ne = NULL;
X509_NAME_ENTRY * new_ne = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_EXTENSION * pci_ext = NULL;
- ASN1_STRING * data = NULL;
+#else
+ const X509_EXTENSION * pci_ext = NULL;
+#endif
+ const ASN1_STRING * data = NULL;
PROXY_CERT_INFO_EXTENSION * pci = NULL;
PROXY_POLICY * policy = NULL;
ASN1_OBJECT * policy_lang = NULL;
@@ -248,13 +256,13 @@ globus_gsi_cert_utils_get_cert_type(
BASIC_CONSTRAINTS * x509v3_bc = NULL;
static char * _function_name_ =
"globus_gsi_cert_utils_get_cert_type";
-
+
GLOBUS_I_GSI_CERT_UTILS_DEBUG_ENTER;
/* assume it is a EEC if nothing else matches */
-
+
*type = GLOBUS_GSI_CERT_UTILS_TYPE_EEC;
-
+
if((x509v3_bc = X509_get_ext_d2i(cert,
NID_basic_constraints,
&critical,
@@ -263,9 +271,9 @@ globus_gsi_cert_utils_get_cert_type(
*type = GLOBUS_GSI_CERT_UTILS_TYPE_CA;
goto exit;
}
-
+
subject = X509_get_subject_name(cert);
-
+
if((ne = X509_NAME_get_entry(subject, X509_NAME_entry_count(subject)-1))
== NULL)
{
@@ -280,11 +288,13 @@ globus_gsi_cert_utils_get_cert_type(
{
/* the name entry is of the type: common name */
data = X509_NAME_ENTRY_get_data(ne);
- if(data->length == 5 && !memcmp(data->data,"proxy",5))
+ if(ASN1_STRING_length(data) == 5 &&
+ !memcmp(ASN1_STRING_get0_data(data), "proxy", 5))
{
*type = GLOBUS_GSI_CERT_UTILS_TYPE_GSI_2_PROXY;
}
- else if(data->length == 13 && !memcmp(data->data,"limited proxy",13))
+ else if(ASN1_STRING_length(data) == 13 &&
+ !memcmp(ASN1_STRING_get0_data(data), "limited proxy", 13))
{
*type = GLOBUS_GSI_CERT_UTILS_TYPE_GSI_2_LIMITED_PROXY;
}
@@ -303,7 +313,7 @@ globus_gsi_cert_utils_get_cert_type(
"extension to internal form")));
goto exit;
}
-
+
if((policy = pci->proxyPolicy) == NULL)
{
GLOBUS_GSI_CERT_UTILS_OPENSSL_ERROR_RESULT(
@@ -324,7 +334,7 @@ globus_gsi_cert_utils_get_cert_type(
}
policy_nid = OBJ_obj2nid(policy_lang);
-
+
if (policy_nid == NID_id_ppl_inheritAll)
{
*type = GLOBUS_GSI_CERT_UTILS_TYPE_RFC_IMPERSONATION_PROXY;
@@ -341,11 +351,11 @@ globus_gsi_cert_utils_get_cert_type(
{
*type = GLOBUS_GSI_CERT_UTILS_TYPE_RFC_RESTRICTED_PROXY;
}
-
+
if(X509_get_ext_by_NID(cert,
NID_proxyCertInfo,
index) != -1)
- {
+ {
GLOBUS_GSI_CERT_UTILS_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_CERT_UTILS_ERROR_NON_COMPLIANT_PROXY,
@@ -368,7 +378,7 @@ globus_gsi_cert_utils_get_cert_type(
"extension to internal form")));
goto exit;
}
-
+
if((policy = pci->proxyPolicy) == NULL)
{
GLOBUS_GSI_CERT_UTILS_OPENSSL_ERROR_RESULT(
@@ -389,7 +399,7 @@ globus_gsi_cert_utils_get_cert_type(
}
policy_nid = OBJ_obj2nid(policy_lang);
-
+
if (policy_nid == NID_id_ppl_inheritAll)
{
*type = GLOBUS_GSI_CERT_UTILS_TYPE_GSI_3_IMPERSONATION_PROXY;
@@ -406,11 +416,11 @@ globus_gsi_cert_utils_get_cert_type(
{
*type = GLOBUS_GSI_CERT_UTILS_TYPE_GSI_3_RESTRICTED_PROXY;
}
-
+
if(X509_get_ext_by_NID(cert,
OBJ_txt2nid(PROXYCERTINFO_OLD_OID),
index) != -1)
- {
+ {
GLOBUS_GSI_CERT_UTILS_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_CERT_UTILS_ERROR_NON_COMPLIANT_PROXY,
@@ -427,8 +437,8 @@ globus_gsi_cert_utils_get_cert_type(
*/
GLOBUS_I_GSI_CERT_UTILS_DEBUG_FPRINTF(
- 2, (globus_i_gsi_cert_utils_debug_fstream,
- "Subject is %s\n", data->data));
+ 2, (globus_i_gsi_cert_utils_debug_fstream,
+ "Subject is %s\n", ASN1_STRING_get0_data(data)));
if((name = X509_NAME_dup(
X509_get_issuer_name(cert))) == NULL)
@@ -439,18 +449,20 @@ globus_gsi_cert_utils_get_cert_type(
(_CUSL("Error copying X509_NAME struct")));
goto exit;
}
-
+
if((new_ne = X509_NAME_ENTRY_create_by_NID(NULL, NID_commonName,
- data->type,
- data->data, -1)) == NULL)
+ ASN1_STRING_type(data),
+ ASN1_STRING_get0_data(data),
+ -1)) == NULL)
{
GLOBUS_GSI_CERT_UTILS_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_CERT_UTILS_ERROR_GETTING_CN_ENTRY,
- (_CUSL("Error creating X509 name entry of: %s"), data->data));
+ (_CUSL("Error creating X509 name entry of: %s"),
+ ASN1_STRING_get0_data(data)));
goto exit;
}
-
+
if(!X509_NAME_add_entry(name, new_ne, X509_NAME_entry_count(name),0))
{
X509_NAME_ENTRY_free(new_ne);
@@ -459,16 +471,16 @@ globus_gsi_cert_utils_get_cert_type(
result,
GLOBUS_GSI_CERT_UTILS_ERROR_ADDING_CN_TO_SUBJECT,
(_CUSL("Error adding name entry with value: %s, to subject"),
- data->data));
+ ASN1_STRING_get0_data(data)));
goto exit;
}
-
+
if(new_ne)
{
X509_NAME_ENTRY_free(new_ne);
new_ne = NULL;
}
-
+
if (X509_NAME_cmp(name,subject))
{
/*
@@ -535,7 +547,7 @@ globus_gsi_cert_utils_get_cert_type(
* The resulting X509_NAME object
*
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -573,7 +585,7 @@ globus_gsi_cert_utils_get_x509_name(
if (*index == '/')
{
/* skip first / */
- name_entry_str = index + 1;
+ name_entry_str = index + 1;
while ((index != NULL) && (*index != '\0'))
{
/* point at name = */
@@ -588,35 +600,35 @@ globus_gsi_cert_utils_get_x509_name(
goto exit;
}
/* terminate name string */
- *index = '\0';
+ *index = '\0';
name_value_str = index + 1;
/* find next =, then last / */
- index = strchr(name_value_str, '=');
+ index = strchr(name_value_str, '=');
if (index != NULL)
{
/* for now set = to \0 */
- *index = '\0';
-
+ *index = '\0';
+
/* find last / in value */
- index2 = strrchr(name_value_str, '/');
+ index2 = strrchr(name_value_str, '/');
/* reset = */
- *index = '=';
+ *index = '=';
if (index2 != NULL)
{
/* terminate value string */
- *index2 = '\0';
+ *index2 = '\0';
}
}
nid = OBJ_txt2nid(name_entry_str);
-
+
if (nid == NID_undef)
{
- /*
+ /*
* not found, lets try upper case instead
*/
uc_index = name_entry_str;
@@ -641,7 +653,7 @@ globus_gsi_cert_utils_get_x509_name(
x509_name_entry = X509_NAME_ENTRY_create_by_NID(
&x509_name_entry,
nid,
- V_ASN1_APP_CHOOSE,
+ V_ASN1_APP_CHOOSE,
(unsigned char *) name_value_str,
-1);
@@ -654,8 +666,8 @@ globus_gsi_cert_utils_get_x509_name(
name_entry_str, name_value_str));
goto exit;
}
-
- res = X509_NAME_add_entry(x509_name, x509_name_entry,
+
+ res = X509_NAME_add_entry(x509_name, x509_name_entry,
X509_NAME_entry_count(x509_name), 0);
if (!res)
{
@@ -665,7 +677,7 @@ globus_gsi_cert_utils_get_x509_name(
(_CUSL("Couldn't add name entry to X509_NAME object")));
goto exit;
}
-
+
X509_NAME_ENTRY_free(x509_name_entry);
x509_name_entry = NULL;
@@ -763,9 +775,9 @@ globus_gsi_cert_utils_get_base_name(
break;
}
}
-
- /*
- * drop all the proxy related /CN=* entries
+
+ /*
+ * drop all the proxy related /CN=* entries
*/
for(i=0;iattrs);
+ result = globus_gsi_cred_handle_attrs_init(&(*handle)->attrs);
}
else
{
result = globus_gsi_cred_handle_attrs_copy(
- handle_attrs,
- & (*handle)->attrs);
+ handle_attrs,
+ & (*handle)->attrs);
}
if(result != GLOBUS_SUCCESS)
@@ -130,7 +130,7 @@ globus_gsi_cred_handle_init(
*
* @param handle
* The credential handle to be destroyed
- * @return
+ * @return
* GLOBUS_SUCCESS
*/
globus_result_t
@@ -160,7 +160,7 @@ globus_gsi_cred_handle_destroy(
globus_libc_free(handle);
}
-
+
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return GLOBUS_SUCCESS;
@@ -198,7 +198,7 @@ globus_gsi_cred_handle_copy(
(_GCRSL("Null parameter passed to function")));
goto exit;
}
-
+
if(source->attrs)
{
result = globus_gsi_cred_handle_init(dest, source->attrs);
@@ -254,13 +254,13 @@ globus_gsi_cred_handle_copy(
{
int chain_index = 0;
(*dest)->cert_chain = sk_X509_new_null();
- for(chain_index = 0;
- chain_index < sk_X509_num(source->cert_chain);
+ for(chain_index = 0;
+ chain_index < sk_X509_num(source->cert_chain);
++chain_index)
{
- sk_X509_insert((*dest)->cert_chain,
+ sk_X509_insert((*dest)->cert_chain,
X509_dup(sk_X509_value(source->cert_chain,
- chain_index)),
+ chain_index)),
chain_index);
}
}
@@ -272,7 +272,7 @@ globus_gsi_cred_handle_copy(
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
}
-
+
/**
* @brief Get the handle attributes
* @ingroup globus_gsi_cred_handle
@@ -361,7 +361,7 @@ globus_gsi_cred_get_goodtill(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL cred handle parameter passed to function: %s"),
+ (_GCRSL("NULL cred handle parameter passed to function: %s"),
__func__));
goto error_exit;
}
@@ -406,7 +406,7 @@ globus_gsi_cred_get_lifetime(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL credential handle passed to function: %s"),
+ (_GCRSL("NULL credential handle passed to function: %s"),
__func__));
goto error_exit;
}
@@ -437,7 +437,7 @@ globus_gsi_cred_get_lifetime(
* @return
* GLOBUS_SUCCESS or an error captured in a globus_result_t
*/
-globus_result_t
+globus_result_t
globus_gsi_cred_get_key_bits(
globus_gsi_cred_handle_t cred_handle,
int * key_bits)
@@ -452,21 +452,21 @@ globus_gsi_cred_get_key_bits(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL cred handle parameter passed to function: %s"),
+ (_GCRSL("NULL cred handle parameter passed to function: %s"),
__func__));
goto error_exit;
}
-
+
if(key_bits == NULL)
{
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL key_bits parameter passed to function: %s"),
+ (_GCRSL("NULL key_bits parameter passed to function: %s"),
__func__));
goto error_exit;
}
-
+
if(cred_handle->cert == NULL)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -475,7 +475,7 @@ globus_gsi_cred_get_key_bits(
(_GCRSL("The credential's cert is NULL")));
goto error_exit;
}
-
+
pkey = X509_get_pubkey(cred_handle->cert);
if(pkey == NULL)
{
@@ -520,7 +520,7 @@ globus_gsi_cred_get_key_bits(
* passed in can be NULL which will set the cert in
* the handle to NULL, freeing the current cert in the
* handle.
- * @return
+ * @return
* GLOBUS_SUCCESS or an error object id if an error
*/
globus_result_t
@@ -537,7 +537,7 @@ globus_gsi_cred_set_cert(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL credential handle passed to function: %s"),
+ (_GCRSL("NULL credential handle passed to function: %s"),
__func__));
goto error_exit;
}
@@ -580,7 +580,7 @@ globus_gsi_cred_set_cert(
* @brief Get the credential's certificate
* @ingroup globus_gsi_cred_handle
* @details
- * Get the certificate of a credential
+ * Get the certificate of a credential
*
* @param handle
* The credential handle to get the certificate from
@@ -647,10 +647,10 @@ globus_gsi_cred_get_cert(
*
* @param handle
* The handle on which to set the key.
- * @param key
+ * @param key
* The private key to set the handle's key to. This
* value can be NULL, in which case the current handle's
- * key is freed.
+ * key is freed.
*/
globus_result_t
globus_gsi_cred_set_key(
@@ -720,7 +720,7 @@ globus_gsi_cred_set_key(
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
-}
+}
/* globus_gsi_cred_set_key() */
/**
@@ -733,9 +733,9 @@ globus_gsi_cred_set_key(
* The credential handle containing the private key to get
* @param key
* The private key which after this function returns is set
- * to a duplicate of the private key of the credential
+ * to a duplicate of the private key of the credential
* handle. This variable needs to be freed by the user when
- * it is no longer used via the function EVP_PKEY_free.
+ * it is no longer used via the function EVP_PKEY_free.
*
* @return
* GLOBUS_SUCCESS or an error object identifier
@@ -801,7 +801,7 @@ globus_gsi_cred_get_key(
return result;
}
/* globus_gsi_cred_get_key() */
-
+
/**
* @brief Set the certificate chain
* @ingroup globus_gsi_cred_handle
@@ -865,7 +865,7 @@ globus_gsi_cred_set_cert_chain(
(_GCRSL("Couldn't initialize credential's cert chain")));
goto error_exit;
}
-
+
for(i = 0; i < numcerts; ++i)
{
if((tmp_cert = X509_dup(sk_X509_value(cert_chain, i))) == NULL)
@@ -940,7 +940,7 @@ globus_gsi_cred_get_cert_chain(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL cert chain parameter passed to function: %s"),
+ (_GCRSL("NULL cert chain parameter passed to function: %s"),
__func__));
goto error_exit;
}
@@ -988,7 +988,7 @@ globus_gsi_cred_get_cert_chain(
* @param subject_name
* The subject name as an X509_NAME object. This should be freed
* using X509_NAME_free when the user is finished with it
- * @return
+ * @return
* GLOBUS_SUCCESS if no error, a error object id otherwise
*/
globus_result_t
@@ -1014,12 +1014,12 @@ globus_gsi_cred_get_X509_subject_name(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL subject name parameter passed to function: %s"),
+ (_GCRSL("NULL subject name parameter passed to function: %s"),
__func__));
goto error_exit;
}
- if((*subject_name =
+ if((*subject_name =
X509_NAME_dup(X509_get_subject_name(handle->cert))) == NULL)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1064,7 +1064,7 @@ globus_gsi_cred_get_X509_identity_name(
STACK_OF(X509) * cert_chain = NULL;
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
-
+
if(handle == NULL)
{
GLOBUS_GSI_CRED_ERROR_RESULT(
@@ -1082,7 +1082,7 @@ globus_gsi_cred_get_X509_identity_name(
(_GCRSL("NULL identity name passed to function: %s"), __func__));
goto error_exit;
}
-
+
identity = X509_NAME_dup(X509_get_subject_name(handle->cert));
if(handle->cert_chain == NULL)
@@ -1120,7 +1120,7 @@ globus_gsi_cred_get_X509_identity_name(
{
sk_X509_free(cert_chain);
}
-
+
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
}
@@ -1138,7 +1138,7 @@ globus_gsi_cred_get_X509_identity_name(
* @param subject_name
* The subject name as a string. This should be freed
* using OPENSSL_free() when the user is finished with it
- * @return
+ * @return
* GLOBUS_SUCCESS if no error, a error object id otherwise
*/
globus_result_t
@@ -1161,7 +1161,7 @@ globus_gsi_cred_get_subject_name(
}
/* ToDo: This logic needs fixing. The subject_name is passed up and is
- freed by the caller - but it must be freed with OPENSSL_free(),
+ freed by the caller - but it must be freed with OPENSSL_free(),
not free() and the caller cant be expected to know that */
if((*subject_name = X509_NAME_oneline(x509_subject, NULL, 0)) == NULL)
{
@@ -1202,7 +1202,7 @@ globus_gsi_cred_get_subject_name(
* the stack of policies retrieved from the handle's cert chain
* @return
* GLOBUS_SUCCESS or an error object if an error occurred
- */
+ */
globus_result_t
globus_gsi_cred_get_policies(
globus_gsi_cred_handle_t handle,
@@ -1263,7 +1263,7 @@ globus_gsi_cred_get_policies(
{
/* no proxycertinfo extension = so no policy for this cert */
policy_string = (unsigned char *) GLOBUS_NULL_POLICY;
- policy_string_length = strlen(GLOBUS_NULL_POLICY);
+ policy_string_length = strlen(GLOBUS_NULL_POLICY);
}
else
{
@@ -1278,7 +1278,7 @@ globus_gsi_cred_get_policies(
goto exit;
}
memcpy(policy_string,
- ASN1_STRING_data(policy->policy),
+ ASN1_STRING_get0_data(policy->policy),
policy_string_length);
}
@@ -1311,7 +1311,7 @@ globus_gsi_cred_get_policies(
goto error_exit;
}
- final_policy_string = NULL;
+ final_policy_string = NULL;
PROXY_CERT_INFO_EXTENSION_free(pci);
pci = NULL;
@@ -1336,9 +1336,9 @@ globus_gsi_cred_get_policies(
sk_OPENSSL_STRING_pop_free(*policies, (void (*) (char *)) free);
}
*policies = NULL;
-
+
exit:
-
+
if(pci != NULL)
{
PROXY_CERT_INFO_EXTENSION_free(pci);
@@ -1362,7 +1362,7 @@ globus_gsi_cred_get_policies(
* the stack of policies retrieved from the handle's cert chain
* @return
* GLOBUS_SUCCESS or an error object if an error occurred
- */
+ */
globus_result_t
globus_gsi_cred_get_policy_languages(
globus_gsi_cred_handle_t handle,
@@ -1419,7 +1419,7 @@ globus_gsi_cred_get_policy_languages(
if(pci == NULL || (policy = pci->proxyPolicy) == NULL)
{
- /* no proxycertinfo extension, so no policy
+ /* no proxycertinfo extension, so no policy
* language for this cert */
policy_language = GLOBUS_NULL;
}
@@ -1428,7 +1428,7 @@ globus_gsi_cred_get_policy_languages(
policy_language = policy->policyLanguage;
}
- if(sk_ASN1_OBJECT_push(*policy_languages,
+ if(sk_ASN1_OBJECT_push(*policy_languages,
OBJ_dup(policy_language)) == 0)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1454,9 +1454,9 @@ globus_gsi_cred_get_policy_languages(
}
*policy_languages = NULL;
-
+
exit:
-
+
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
@@ -1475,7 +1475,7 @@ globus_gsi_cred_get_policy_languages(
* @param issuer_name
* The issuer name as an X509_NAME object. This should be freed
* using X509_NAME_free when the user is finished with it
- * @return
+ * @return
* GLOBUS_SUCCESS if no error, a error object id otherwise
*/
globus_result_t
@@ -1501,12 +1501,12 @@ globus_gsi_cred_get_X509_issuer_name(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL issuer name parameter passed to function: %s"),
+ (_GCRSL("NULL issuer name parameter passed to function: %s"),
__func__));
goto error_exit;
}
- if((*issuer_name =
+ if((*issuer_name =
X509_NAME_dup(X509_get_issuer_name(handle->cert))) == NULL)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1567,9 +1567,9 @@ globus_gsi_cred_get_issuer_name(
(_GCRSL("NULL issuer name passed to function: %s"), __func__));
goto error_exit;
}
-
+
/* TODO: This logic needs fixing. The issuer_name is passed up and is
- freed by the caller - but it must be freed with OPENSSL_free(),
+ freed by the caller - but it must be freed with OPENSSL_free(),
not free() and the caller cant be expected to know that */
if((*issuer_name = X509_NAME_oneline(
X509_get_issuer_name(handle->cert), NULL, 0)) == NULL)
@@ -1580,9 +1580,9 @@ globus_gsi_cred_get_issuer_name(
(_GCRSL("Couldn't get subject name of credential's cert")));
goto error_exit;
}
-
+
result = GLOBUS_SUCCESS;
-
+
error_exit:
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
@@ -1635,7 +1635,7 @@ globus_gsi_cred_get_identity_name(
}
result = globus_gsi_cred_get_X509_identity_name(handle, &identity);
-
+
if(result != GLOBUS_SUCCESS)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -1645,7 +1645,7 @@ globus_gsi_cred_get_identity_name(
}
/* ToDo: This logic needs fixing. The identity_name is passed up and is
- freed by the caller - but it must be freed with OPENSSL_free(),
+ freed by the caller - but it must be freed with OPENSSL_free(),
not free() and the caller cant be expected to know that */
*identity_name = X509_NAME_oneline(identity, NULL, 0);
@@ -1656,7 +1656,7 @@ globus_gsi_cred_get_identity_name(
GLOBUS_GSI_CRED_ERROR_WITH_CRED_CERT_NAME,
(_GCRSL("Unable to convert X509_NAME to string")));
}
-
+
error_exit:
if(identity)
@@ -1700,7 +1700,7 @@ globus_gsi_cred_verify_cert_chain(
globus_result_t result = GLOBUS_SUCCESS;
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
-
+
cert_store = X509_STORE_new();
if (cert_store == NULL)
{
@@ -1710,7 +1710,7 @@ globus_gsi_cred_verify_cert_chain(
goto exit;
}
- X509_STORE_set_verify_cb_func(cert_store,
+ X509_STORE_set_verify_cb_func(cert_store,
globus_gsi_callback_create_proxy_callback);
X509_STORE_set_depth(cert_store, GLOBUS_GSI_CALLBACK_VERIFY_DEPTH);
@@ -1725,7 +1725,7 @@ globus_gsi_cred_verify_cert_chain(
tmp_cert = cred_handle->cert;
cert = tmp_cert;
-
+
if (X509_STORE_load_locations(cert_store, NULL, cert_dir))
{
#if OPENSSL_VERSION_NUMBER < 0x10100000L
@@ -1746,17 +1746,17 @@ globus_gsi_cred_verify_cert_chain(
X509_STORE_CTX_set_ex_data(
store_context,
- callback_data_index,
+ callback_data_index,
(void *)callback_data);
-
+
/*
* If this is not set, OpenSSL-0.9.8 (check_chain_extensions()
* called by x509_verify_cert()) treats the cert next to proxy
* in the chain to be CA cert and throws invalid CA error
- */
+ */
#if defined(X509_V_FLAG_ALLOW_PROXY_CERTS)
- X509_STORE_CTX_set_flags(
+ X509_STORE_CTX_set_flags(
store_context, X509_V_FLAG_ALLOW_PROXY_CERTS);
#endif
@@ -1783,7 +1783,7 @@ globus_gsi_cred_verify_cert_chain(
{
local_result = callback_error;
}
-
+
result = globus_i_gsi_cred_error_join_chains_result(
result,
local_result);
@@ -1791,7 +1791,7 @@ globus_gsi_cred_verify_cert_chain(
goto exit;
}
}
-
+
exit:
if(cert_store)
@@ -1852,8 +1852,8 @@ globus_gsi_cred_verify_cert_chain_when(
globus_result_t result = GLOBUS_SUCCESS;
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
-
-
+
+
if(callback_data_in != NULL)
{
callback_data = callback_data_in;
@@ -1861,7 +1861,7 @@ globus_gsi_cred_verify_cert_chain_when(
else
{
char * certdir = NULL;
-
+
/* initialize the callback data */
result = globus_gsi_callback_data_init(&callback_data);
if(result != GLOBUS_SUCCESS)
@@ -1869,8 +1869,8 @@ globus_gsi_cred_verify_cert_chain_when(
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
result, GLOBUS_GSI_CRED_ERROR_WITH_CALLBACK_DATA);
goto exit;
- }
-
+ }
+
/* set the cert_dir in the callback data */
result = GLOBUS_GSI_SYSCONFIG_GET_CERT_DIR(&certdir);
if(result != GLOBUS_SUCCESS)
@@ -1882,7 +1882,7 @@ globus_gsi_cred_verify_cert_chain_when(
if(certdir)
{
result = globus_gsi_callback_set_cert_dir(
- callback_data,
+ callback_data,
certdir);
free(certdir);
if(result != GLOBUS_SUCCESS)
@@ -1893,7 +1893,7 @@ globus_gsi_cred_verify_cert_chain_when(
}
}
}
-
+
cert_store = X509_STORE_new();
if(cert_store == NULL)
{
@@ -1902,7 +1902,7 @@ globus_gsi_cred_verify_cert_chain_when(
goto exit;
}
- X509_STORE_set_verify_cb_func(cert_store,
+ X509_STORE_set_verify_cb_func(cert_store,
globus_gsi_callback_create_proxy_callback);
X509_STORE_set_depth(cert_store, GLOBUS_GSI_CALLBACK_VERIFY_DEPTH);
@@ -1917,7 +1917,7 @@ globus_gsi_cred_verify_cert_chain_when(
tmp_cert = cred_handle->cert;
cert = tmp_cert;
-
+
if (X509_STORE_load_locations(cert_store, NULL, cert_dir))
{
/* override the check_issued with our version */
@@ -1938,17 +1938,17 @@ globus_gsi_cred_verify_cert_chain_when(
X509_STORE_CTX_set_ex_data(
store_context,
- callback_data_index,
+ callback_data_index,
(void *)callback_data);
-
+
/*
* If this is not set, OpenSSL-0.9.8 (check_chain_extensions()
* called by x509_verify_cert()) treats the cert next to proxy
* in the chain to be CA cert and throws invalid CA error
- */
+ */
#if defined(X509_V_FLAG_ALLOW_PROXY_CERTS)
- X509_STORE_CTX_set_flags(
+ X509_STORE_CTX_set_flags(
store_context, X509_V_FLAG_ALLOW_PROXY_CERTS);
#endif
@@ -1985,7 +1985,7 @@ globus_gsi_cred_verify_cert_chain_when(
{
local_result = callback_error;
}
-
+
result = globus_i_gsi_cred_error_join_chains_result(
result,
local_result);
@@ -1993,14 +1993,14 @@ globus_gsi_cred_verify_cert_chain_when(
goto exit;
}
}
-
+
exit:
if(callback_data && !callback_data_in)
{
globus_gsi_callback_data_destroy(callback_data);
}
-
+
if(cert_store)
{
X509_STORE_free(cert_store);
@@ -2069,7 +2069,7 @@ globus_gsi_cred_verify(
(_GCRSL("Error getting public key from issuer certificate")));
goto error;
}
-
+
if(!X509_verify(handle->cert,issuer_pkey))
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -2081,7 +2081,7 @@ globus_gsi_cred_verify(
EVP_PKEY_free(issuer_pkey);
error:
-
+
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
}
@@ -2124,11 +2124,11 @@ globus_i_gsi_cred_goodtill(
{
cert_count = sk_X509_num(cred_handle->cert_chain);
}
-
+
while(current_cert)
{
result = globus_gsi_cert_utils_make_time(
- X509_get_notAfter(current_cert),
+ X509_get_notAfter(current_cert),
&tmp_goodtill);
if(result != GLOBUS_SUCCESS)
{
@@ -2142,7 +2142,7 @@ globus_i_gsi_cred_goodtill(
{
*goodtill = tmp_goodtill;
}
-
+
if(cred_handle->cert_chain && cert_count)
{
cert_count--;
diff --git a/gsi/credential/source/library/globus_gsi_credential.c b/gsi/credential/source/library/globus_gsi_credential.c
index ee83d55ec9..319c7a7a9b 100644
--- a/gsi/credential/source/library/globus_gsi_credential.c
+++ b/gsi/credential/source/library/globus_gsi_credential.c
@@ -70,7 +70,7 @@ globus_l_gsi_credential_activate(void)
if(tmp_string != GLOBUS_NULL)
{
globus_i_gsi_cred_debug_level = atoi(tmp_string);
-
+
if(globus_i_gsi_cred_debug_level < 0)
{
globus_i_gsi_cred_debug_level = 0;
@@ -101,7 +101,7 @@ globus_l_gsi_credential_activate(void)
{
goto exit;
}
-
+
result = globus_module_activate(GLOBUS_GSI_SYSCONFIG_MODULE);
if(result != GLOBUS_SUCCESS)
@@ -115,11 +115,11 @@ globus_l_gsi_credential_activate(void)
{
goto exit;
}
-
+
OpenSSL_add_all_algorithms();
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
-
+
exit:
return result;
@@ -173,7 +173,7 @@ globus_l_gsi_cred_subject_cmp(
* @details
* Read a credential from a filesystem location. The credential
* to read will be determined by the search order specified in the handle
- * attributes.
+ * attributes.
* @param handle
* The credential handle to set. This credential handle
* should already be initialized using globus_gsi_cred_handle_init.
@@ -211,7 +211,7 @@ globus_gsi_cred_read(
char * key = NULL;
char * proxy = NULL;
char * service_name = NULL;
-
+
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
for(result_index = 0; result_index < 4; ++result_index)
@@ -238,7 +238,7 @@ globus_gsi_cred_read(
case GLOBUS_PROXY:
results[result_index] = GLOBUS_GSI_SYSCONFIG_GET_PROXY_FILENAME(
- &proxy,
+ &proxy,
GLOBUS_PROXY_FILE_INPUT);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -248,7 +248,7 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_PROXY_CRED);
break;
}
-
+
results[result_index] = globus_gsi_cred_read_proxy(handle, proxy);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -257,11 +257,11 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_PROXY_CRED);
goto exit;
}
-
+
if(desired_subject != NULL)
{
results[result_index] = globus_gsi_cred_get_X509_subject_name(
- handle,
+ handle,
&found_subject);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -275,8 +275,8 @@ globus_gsi_cred_read(
desired_subject);
X509_NAME_free(found_subject);
- found_subject = NULL;
-
+ found_subject = NULL;
+
if(results[result_index] != GLOBUS_SUCCESS)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -296,15 +296,15 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_WITH_CRED);
goto exit;
}
-
+
if(lifetime <= 0)
{
char * subject = NULL;
-
+
subject = X509_NAME_oneline(
X509_get_subject_name(handle->cert),
NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
results[result_index],
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
@@ -313,18 +313,18 @@ globus_gsi_cred_read(
proxy,
subject,
(-lifetime)/60));
-
+
OPENSSL_free(subject);
goto exit;
}
GLOBUS_I_GSI_CRED_DEBUG_FPRINTF(1, (globus_i_gsi_cred_debug_fstream,
- "Using Proxy file (%s)\n", proxy));
+ "Using Proxy file (%s)\n", proxy));
goto exit;
case GLOBUS_USER:
-
- results[result_index] =
+
+ results[result_index] =
GLOBUS_GSI_SYSCONFIG_GET_USER_CERT_FILENAME(&cert, &key);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -334,7 +334,7 @@ globus_gsi_cred_read(
results[result_index],
GLOBUS_GSI_CRED_ERROR_READING_CRED);
break;
- }
+ }
results[result_index] = globus_gsi_cred_read_cert(handle, cert);
if(results[result_index] != GLOBUS_SUCCESS)
@@ -346,14 +346,14 @@ globus_gsi_cred_read(
}
results[result_index] = globus_gsi_cred_read_key(
- handle,
- key,
+ handle,
+ key,
globus_i_gsi_cred_password_callback_no_prompt);
if(results[result_index] != GLOBUS_SUCCESS)
{
globus_object_t * error_obj;
error_obj = globus_error_peek(results[result_index]);
- if(globus_error_get_type(error_obj) ==
+ if(globus_error_get_type(error_obj) ==
GLOBUS_GSI_CRED_ERROR_KEY_IS_PASS_PROTECTED)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -382,7 +382,7 @@ globus_gsi_cred_read(
if(desired_subject != NULL)
{
results[result_index] = globus_gsi_cred_get_X509_subject_name(
- handle,
+ handle,
&found_subject);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -391,14 +391,14 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_CRED);
goto exit;
}
-
+
results[result_index] = globus_l_gsi_cred_subject_cmp(
found_subject,
desired_subject);
X509_NAME_free(found_subject);
found_subject = NULL;
-
+
if(results[result_index] != GLOBUS_SUCCESS)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -418,15 +418,15 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_WITH_CRED);
goto exit;
}
-
+
if(lifetime <= 0)
{
char * subject = NULL;
-
+
subject = X509_NAME_oneline(
X509_get_subject_name(handle->cert),
NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
results[result_index],
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
@@ -435,18 +435,18 @@ globus_gsi_cred_read(
cert,
subject,
(-lifetime)/60));
-
+
OPENSSL_free(subject);
goto exit;
}
GLOBUS_I_GSI_CRED_DEBUG_FPRINTF(1, (globus_i_gsi_cred_debug_fstream,
- "Using User cert file (%s), key file (%s)\n", cert, key));
+ "Using User cert file (%s), key file (%s)\n", cert, key));
goto exit;
case GLOBUS_HOST:
-
- results[result_index] =
+
+ results[result_index] =
GLOBUS_GSI_SYSCONFIG_GET_HOST_CERT_FILENAME(&cert, &key);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -456,7 +456,7 @@ globus_gsi_cred_read(
results[result_index],
GLOBUS_GSI_CRED_ERROR_READING_HOST_CRED);
break;
- }
+ }
results[result_index] = globus_gsi_cred_read_cert(handle, cert);
if(results[result_index] != GLOBUS_SUCCESS)
@@ -468,14 +468,14 @@ globus_gsi_cred_read(
}
results[result_index] = globus_gsi_cred_read_key(
- handle,
- key,
+ handle,
+ key,
globus_i_gsi_cred_password_callback_no_prompt);
if(results[result_index] != GLOBUS_SUCCESS)
{
globus_object_t * error_obj;
error_obj = globus_error_peek(results[result_index]);
- if(globus_error_get_type(error_obj) ==
+ if(globus_error_get_type(error_obj) ==
GLOBUS_GSI_CRED_ERROR_KEY_IS_PASS_PROTECTED)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -504,9 +504,9 @@ globus_gsi_cred_read(
if(desired_subject != NULL)
{
results[result_index] = globus_gsi_cred_get_X509_subject_name(
- handle,
+ handle,
&found_subject);
-
+
if(results[result_index] != GLOBUS_SUCCESS)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -514,13 +514,13 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_HOST_CRED);
goto exit;
}
-
+
results[result_index] = globus_l_gsi_cred_subject_cmp(found_subject,
desired_subject);
X509_NAME_free(found_subject);
- found_subject = NULL;
-
+ found_subject = NULL;
+
if(results[result_index] != GLOBUS_SUCCESS)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -529,7 +529,7 @@ globus_gsi_cred_read(
goto exit;
}
}
-
+
results[result_index] = globus_gsi_cred_get_lifetime(
handle,
&lifetime);
@@ -540,15 +540,15 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_WITH_CRED);
goto exit;
}
-
+
if(lifetime <= 0)
{
char * subject = NULL;
-
+
subject = X509_NAME_oneline(
X509_get_subject_name(handle->cert),
NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
results[result_index],
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
@@ -557,23 +557,23 @@ globus_gsi_cred_read(
cert,
subject,
(-lifetime)/60));
-
+
OPENSSL_free(subject);
goto exit;
}
GLOBUS_I_GSI_CRED_DEBUG_FPRINTF(1, (globus_i_gsi_cred_debug_fstream,
- "Using Host cert file (%s), key file (%s)\n", cert, key));
+ "Using Host cert file (%s), key file (%s)\n", cert, key));
goto exit;
-
+
case GLOBUS_SERVICE:
if(desired_subject != NULL)
- {
+ {
results[result_index] =
globus_l_gsi_cred_get_service(desired_subject,
&service_name);
-
+
if(results[result_index] != GLOBUS_SUCCESS)
{
service_name = NULL;
@@ -581,9 +581,9 @@ globus_gsi_cred_read(
results[result_index],
GLOBUS_GSI_CRED_ERROR_READING_SERVICE_CRED);
break;
- }
-
- results[result_index] =
+ }
+
+ results[result_index] =
GLOBUS_GSI_SYSCONFIG_GET_SERVICE_CERT_FILENAME(
service_name, &cert, &key);
if(results[result_index] != GLOBUS_SUCCESS)
@@ -594,9 +594,9 @@ globus_gsi_cred_read(
results[result_index],
GLOBUS_GSI_CRED_ERROR_READING_SERVICE_CRED);
break;
- }
+ }
- results[result_index] =
+ results[result_index] =
globus_gsi_cred_read_cert(handle, cert);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -605,16 +605,16 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_SERVICE_CRED);
goto exit;
}
-
+
results[result_index] = globus_gsi_cred_read_key(
- handle,
- key,
+ handle,
+ key,
globus_i_gsi_cred_password_callback_no_prompt);
if(results[result_index] != GLOBUS_SUCCESS)
{
globus_object_t * error_obj;
error_obj = globus_error_peek(results[result_index]);
- if(globus_error_get_type(error_obj) ==
+ if(globus_error_get_type(error_obj) ==
GLOBUS_GSI_CRED_ERROR_KEY_IS_PASS_PROTECTED)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -628,7 +628,7 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_SERVICE_CRED);
goto exit;
}
-
+
results[result_index] = globus_i_gsi_cred_goodtill(
handle,
&(handle->goodtill));
@@ -643,7 +643,7 @@ globus_gsi_cred_read(
if(desired_subject != NULL)
{
results[result_index] = globus_gsi_cred_get_X509_subject_name(
- handle,
+ handle,
&found_subject);
if(results[result_index] != GLOBUS_SUCCESS)
{
@@ -652,13 +652,13 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_READING_SERVICE_CRED);
goto exit;
}
-
+
results[result_index] = globus_l_gsi_cred_subject_cmp(found_subject,
desired_subject);
X509_NAME_free(found_subject);
- found_subject = NULL;
-
+ found_subject = NULL;
+
if(results[result_index] != GLOBUS_SUCCESS)
{
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
@@ -667,7 +667,7 @@ globus_gsi_cred_read(
break;
}
}
-
+
results[result_index] = globus_gsi_cred_get_lifetime(
handle,
&lifetime);
@@ -678,15 +678,15 @@ globus_gsi_cred_read(
GLOBUS_GSI_CRED_ERROR_WITH_CRED);
goto exit;
}
-
+
if(lifetime <= 0)
{
char * subject = NULL;
-
+
subject = X509_NAME_oneline(
X509_get_subject_name(handle->cert),
NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
results[result_index],
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
@@ -695,13 +695,13 @@ globus_gsi_cred_read(
cert,
subject,
(-lifetime)/60));
-
+
OPENSSL_free(subject);
goto exit;
}
GLOBUS_I_GSI_CRED_DEBUG_FPRINTF(1, (globus_i_gsi_cred_debug_fstream,
- "Using Service cert file (%s), key file (%s)\n", cert, key));
+ "Using Service cert file (%s), key file (%s)\n", cert, key));
goto exit;
}
else
@@ -709,17 +709,17 @@ globus_gsi_cred_read(
result_index--;
break;
}
-
+
case GLOBUS_SO_END:
{
globus_object_t * multiple_obj;
-
+
multiple_obj = globus_error_construct_multiple(
GLOBUS_GSI_CREDENTIAL_MODULE,
GLOBUS_GSI_CRED_ERROR_NO_CRED_FOUND,
_GCRSL(globus_l_gsi_cred_error_strings[
GLOBUS_GSI_CRED_ERROR_NO_CRED_FOUND]));
-
+
while(result_index--)
{
globus_error_mutliple_add_chain(
@@ -728,11 +728,11 @@ globus_gsi_cred_read(
_GCRSL("Attempt %d"),
result_index + 1);
}
-
+
result_index = 0;
results[result_index] = globus_error_put(multiple_obj);
}
-
+
GLOBUS_GSI_CRED_ERROR_CHAIN_RESULT(
results[result_index],
GLOBUS_GSI_CRED_ERROR_NO_CRED_FOUND);
@@ -744,28 +744,28 @@ globus_gsi_cred_read(
free(proxy);
proxy = NULL;
}
-
+
if(cert)
{
free(cert);
cert = NULL;
}
-
+
if(key)
{
free(key);
key = NULL;
}
-
+
if(service_name)
{
free(service_name);
service_name = NULL;
}
-
+
result_index++;
} while(++index);
-
+
exit:
result = results[result_index];
@@ -783,7 +783,7 @@ globus_gsi_cred_read(
{
free(proxy);
}
-
+
if(cert)
{
free(cert);
@@ -793,7 +793,7 @@ globus_gsi_cred_read(
{
free(key);
}
-
+
if(service_name)
{
free(service_name);
@@ -826,7 +826,7 @@ globus_gsi_cred_read_proxy(
{
BIO * proxy_bio = NULL;
globus_result_t result;
-
+
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
if(handle == NULL)
@@ -874,10 +874,10 @@ globus_gsi_cred_read_proxy(
* @brief Read proxy credential from a BIO
* @ingroup globus_gsi_cred_operations
* @details
- * Read a Proxy Credential from a BIO stream and set the
+ * Read a Proxy Credential from a BIO stream and set the
* credential handle to represent the read credential.
* The values read from the stream, in order, will be
- * the signed certificate, the private key,
+ * the signed certificate, the private key,
* and the certificate chain.
*
* @param handle
@@ -1118,7 +1118,7 @@ globus_gsi_cred_read_proxy_bio(
* @param key_filename
* the filename of the key to read
* @param pw_cb
- * the callback for obtaining a password for decrypting the key.
+ * the callback for obtaining a password for decrypting the key.
*
* @return
* GLOBUS_SUCCESS or an error object identifier
@@ -1152,7 +1152,7 @@ globus_gsi_cred_read_key(
"key file: %s for reading"), key_filename));
goto exit;
}
-
+
/* read in the key */
if(handle->key != NULL)
@@ -1294,7 +1294,7 @@ globus_gsi_cred_read_cert_bio(
}
/* read in the cert */
-
+
if(handle->cert != NULL)
{
X509_free(handle->cert);
@@ -1314,7 +1314,7 @@ globus_gsi_cred_read_cert_bio(
{
sk_X509_pop_free(handle->cert_chain, X509_free);
}
-
+
if((handle->cert_chain = sk_X509_new_null()) == NULL)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1323,7 +1323,7 @@ globus_gsi_cred_read_cert_bio(
(_GCRSL("Can't initialize cert chain\n")));
goto exit;
}
-
+
while(!BIO_eof(bio))
{
X509 * tmp_cert = NULL;
@@ -1346,7 +1346,7 @@ globus_gsi_cred_read_cert_bio(
}
++i;
}
-
+
result = globus_i_gsi_cred_goodtill(handle, &(handle->goodtill));
if(result != GLOBUS_SUCCESS)
@@ -1356,7 +1356,7 @@ globus_gsi_cred_read_cert_bio(
GLOBUS_GSI_CRED_ERROR_WITH_CRED);
goto exit;
}
-
+
result = GLOBUS_SUCCESS;
exit:
@@ -1415,19 +1415,19 @@ globus_gsi_cred_read_cert_buffer(
bp = BIO_new(BIO_s_mem());
BIO_write(bp, pem_buf, strlen(pem_buf));
-
+
result = globus_gsi_cred_handle_init(&handle, NULL);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
-
+
result = globus_gsi_cred_read_cert_bio(handle, bp);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
-
+
if(out_cert)
{
result = globus_gsi_cred_get_cert(handle, &cert);
@@ -1437,7 +1437,7 @@ globus_gsi_cred_read_cert_buffer(
}
*out_cert = cert;
}
-
+
if(out_cert_chain)
{
result = globus_gsi_cred_get_cert_chain(handle, &cert_chain);
@@ -1447,7 +1447,7 @@ globus_gsi_cred_read_cert_buffer(
}
*out_cert_chain = cert_chain;
}
-
+
if(out_subject)
{
result = globus_gsi_cred_get_identity_name(handle, &subject);
@@ -1455,9 +1455,9 @@ globus_gsi_cred_read_cert_buffer(
{
goto error;
}
- *out_subject = subject;
+ *out_subject = subject;
}
-
+
if(out_handle)
{
*out_handle = handle;
@@ -1466,11 +1466,11 @@ globus_gsi_cred_read_cert_buffer(
{
globus_gsi_cred_handle_destroy(handle);
}
-
+
BIO_free(bp);
return GLOBUS_SUCCESS;
-
+
error:
if(bp)
{
@@ -1495,7 +1495,7 @@ globus_gsi_cred_read_cert_buffer(
{
globus_gsi_cred_handle_destroy(handle);
}
-
+
return result;
}
/* globus_gsi_cred_read_cert_buffer() */
@@ -1529,6 +1529,7 @@ globus_gsi_cred_read_pkcs12(
PKCS7 * pkcs7 = NULL;
STACK_OF(PKCS7) * auth_safes = NULL;
PKCS8_PRIV_KEY_INFO * pkcs8 = NULL;
+ const PKCS8_PRIV_KEY_INFO * pkcs8c = NULL;
BIO * pkcs12_bio = NULL;
int i, j, bag_NID;
@@ -1542,7 +1543,7 @@ globus_gsi_cred_read_pkcs12(
(_GCRSL("NULL handle passed to function: %s"), __func__));
goto exit;
}
-
+
pkcs12_bio = BIO_new_file(pkcs12_filename, "r");
if(!pkcs12_bio)
{
@@ -1575,7 +1576,7 @@ globus_gsi_cred_read_pkcs12(
}
auth_safes = PKCS12_unpack_authsafes(pkcs12);
-
+
if(!auth_safes)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1586,13 +1587,13 @@ globus_gsi_cred_read_pkcs12(
}
pkcs12_certs = sk_X509_new_null();
-
+
for (i = 0; i < sk_PKCS7_num(auth_safes); i++)
{
pkcs7 = sk_PKCS7_value(auth_safes, i);
-
+
bag_NID = OBJ_obj2nid(pkcs7->type);
-
+
if(bag_NID == NID_pkcs7_data)
{
pkcs12_safebags = PKCS12_unpack_p7data(pkcs7);
@@ -1624,18 +1625,18 @@ globus_gsi_cred_read_pkcs12(
for (j = 0; j < sk_PKCS12_SAFEBAG_num(pkcs12_safebags); j++)
{
bag = sk_PKCS12_SAFEBAG_value(pkcs12_safebags, j);
-
+
if(PKCS12_bag_type(bag) == NID_certBag &&
PKCS12_cert_bag_type(bag) == NID_x509Certificate)
{
- sk_X509_push(pkcs12_certs,
+ sk_X509_push(pkcs12_certs,
PKCS12_certbag2x509(bag));
}
else if(PKCS12_bag_type(bag) == NID_keyBag &&
handle->key == NULL)
{
- pkcs8 = PKCS12_SAFEBAG_get0_p8inf(bag);
- handle->key = EVP_PKCS82PKEY(pkcs8);
+ pkcs8c = PKCS12_SAFEBAG_get0_p8inf(bag);
+ handle->key = EVP_PKCS82PKEY(pkcs8c);
if (!handle->key)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1646,7 +1647,7 @@ globus_gsi_cred_read_pkcs12(
goto exit;
}
}
- else if(PKCS12_bag_type(bag) ==
+ else if(PKCS12_bag_type(bag) ==
NID_pkcs8ShroudedKeyBag &&
handle->key == NULL)
{
@@ -1661,7 +1662,7 @@ globus_gsi_cred_read_pkcs12(
(_GCRSL("Couldn't get PKCS8 key from PKCS12 credential")));
goto exit;
}
-
+
handle->key = EVP_PKCS82PKEY(pkcs8);
if (!handle->key)
{
@@ -1671,7 +1672,7 @@ globus_gsi_cred_read_pkcs12(
(_GCRSL("Couldn't get private key from PKCS12 credential")));
goto exit;
}
-
+
PKCS8_PRIV_KEY_INFO_free(pkcs8);
}
}
@@ -1687,12 +1688,12 @@ globus_gsi_cred_read_pkcs12(
goto exit;
}
- j = sk_X509_num(pkcs12_certs);
+ j = sk_X509_num(pkcs12_certs);
for(i = 0 ; i < j; i++)
{
handle->cert = sk_X509_pop(pkcs12_certs);
- if(X509_check_private_key(handle->cert, handle->key))
+ if(X509_check_private_key(handle->cert, handle->key))
{
sk_X509_pop_free(pkcs12_certs, X509_free);
pkcs12_certs = NULL;
@@ -1752,7 +1753,7 @@ globus_gsi_cred_read_pkcs12(
* Write out a credential to a BIO. The credential parameters written,
* in order, are the signed certificate, the RSA private key,
* and the certificate chain (a set of X509 certificates).
- * the credential is written out in PEM format.
+ * the credential is written out in PEM format.
*
* @param handle
* The credential to write out
@@ -1780,7 +1781,7 @@ globus_gsi_cred_write(
(_GCRSL("NULL handle passed to function: %s"), __func__));
goto error_exit;
}
-
+
if(bio == NULL)
{
GLOBUS_GSI_CRED_ERROR_RESULT(
@@ -1789,7 +1790,7 @@ globus_gsi_cred_write(
(_GCRSL("NULL bio variable passed to function: %s"), __func__));
goto error_exit;
}
-
+
if(!PEM_write_bio_X509(bio, handle->cert))
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -1798,7 +1799,7 @@ globus_gsi_cred_write(
(_GCRSL("Can't write PEM formatted X509 cert to BIO stream")));
goto error_exit;
}
-
+
if(!PEM_write_bio_PrivateKey(bio, handle->key,
NULL, NULL, 0, NULL, NULL))
{
@@ -1808,7 +1809,7 @@ globus_gsi_cred_write(
(_GCRSL("Can't write PEM formatted private key to BIO stream")));
goto error_exit;
}
-
+
for(i = 0; i < sk_X509_num(handle->cert_chain); ++i)
{
if(!PEM_write_bio_X509(bio, sk_X509_value(handle->cert_chain, i)))
@@ -1821,14 +1822,14 @@ globus_gsi_cred_write(
goto error_exit;
}
}
-
+
error_exit:
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
-}
+}
/* globus_gsi_cred_write() */
-
+
/**
* @brief Write a proxy credential
* @ingroup globus_gsi_cred_operations
@@ -1836,7 +1837,7 @@ globus_gsi_cred_write(
* Write out a credential to a file. The credential parameters written,
* in order, are the signed certificate, the RSA private key,
* and the certificate chain (a set of X509 certificates).
- * the credential is written out in PEM format.
+ * the credential is written out in PEM format.
*
* @param handle
* The credential to write out
@@ -1856,7 +1857,7 @@ globus_gsi_cred_write_proxy(
mode_t oldmask;
FILE * temp_proxy_fp = NULL;
int temp_proxy_fd = -1;
-
+
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
/*
@@ -1873,10 +1874,10 @@ globus_gsi_cred_write_proxy(
goto exit;
}
- /*
+ /*
* We always unlink the file first; it is the only way to be
* certain that the file we open has never in its entire lifetime
- * had the world-readable bit set.
+ * had the world-readable bit set.
*/
#if _WIN32
/* Win32 API won't allow removing a read-only file */
@@ -1884,8 +1885,8 @@ globus_gsi_cred_write_proxy(
#endif
temp_proxy_fd = remove(proxy_filename);
- /*
- * Now, we must open w/ O_EXCL to make certain that WE are
+ /*
+ * Now, we must open w/ O_EXCL to make certain that WE are
* creating the file, so we know that the file was BORN w/ mode 0600.
* As a bonus, O_EXCL flag will cause a failure in the presence
* of a symlink, so we are safe from zaping a file due to the
@@ -1904,18 +1905,18 @@ globus_gsi_cred_write_proxy(
temp_proxy_fp = fdopen(temp_proxy_fd,"w");
/* Hand the stream over to ssl */
- if( !(temp_proxy_fp) ||
+ if( !(temp_proxy_fp) ||
!(proxy_bio = BIO_new_fp(temp_proxy_fp, BIO_CLOSE)))
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WRITING_PROXY_CRED,
(_GCRSL("Can't open bio stream for writing to file: %s"), proxy_filename));
- if ( temp_proxy_fp )
+ if ( temp_proxy_fp )
{
fclose(temp_proxy_fp);
- }
- else if (temp_proxy_fd >= 0 )
+ }
+ else if (temp_proxy_fd >= 0 )
{
/* close underlying fd if we do not have a stream */
close(temp_proxy_fd);
@@ -1924,7 +1925,7 @@ globus_gsi_cred_write_proxy(
goto exit;
}
- /*
+ /*
* Note: at this point, calling BIO_free(proxy_bio) will
* fclose the temp_proxy_fp, which in turn should close temp_proxy_fd.
*/
@@ -1957,7 +1958,7 @@ globus_gsi_cred_write_proxy(
globus_libc_umask(oldmask);
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
-}
+}
/* globus_gsi_cred_write_proxy() */
/**
@@ -1983,7 +1984,7 @@ globus_gsi_cred_get_cert_type(
globus_result_t result;
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
-
+
result = globus_gsi_cert_utils_get_cert_type(handle->cert, type);
if(result != GLOBUS_SUCCESS)
{
@@ -2026,7 +2027,11 @@ globus_i_gsi_cred_get_proxycertinfo(
{
globus_result_t result = GLOBUS_SUCCESS;
int pci_old_NID;
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_EXTENSION * pci_extension = NULL;
+#else
+ const X509_EXTENSION * pci_extension = NULL;
+#endif
int extension_loc;
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
@@ -2048,7 +2053,7 @@ globus_i_gsi_cred_get_proxycertinfo(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_WITH_CRED,
- (_GCRSL("NULL X509 cert parameter passed to function: %s"),
+ (_GCRSL("NULL X509 cert parameter passed to function: %s"),
__func__));
goto exit;
}
@@ -2061,7 +2066,7 @@ globus_i_gsi_cred_get_proxycertinfo(
goto exit;
}
- if((pci_extension = X509_get_ext(cert,
+ if((pci_extension = X509_get_ext(cert,
extension_loc)) == NULL)
{
GLOBUS_GSI_CRED_OPENSSL_ERROR_RESULT(
@@ -2081,9 +2086,9 @@ globus_i_gsi_cred_get_proxycertinfo(
"extension to internal form")));
goto exit;
}
-
+
exit:
-
+
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
return result;
}
@@ -2125,16 +2130,16 @@ globus_l_gsi_cred_subject_cmp(
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
-
+
/* if desired subject is NULL return success */
-
+
if(!desired_subject)
{
goto exit;
}
/* check for single /CN entry */
-
+
if(X509_NAME_entry_count(desired_subject) == 1)
{
/* make sure we actually got a common name */
@@ -2156,7 +2161,7 @@ globus_l_gsi_cred_subject_cmp(
cn_index = X509_NAME_get_index_by_NID(actual_subject, NID_commonName, -1);
/* error if no common name was found */
-
+
if(cn_index < 0)
{
actual_str = X509_NAME_oneline(actual_subject, NULL, 0);
@@ -2168,7 +2173,7 @@ globus_l_gsi_cred_subject_cmp(
}
/* check that actual subject only has one CN entry */
-
+
if(X509_NAME_get_index_by_NID(actual_subject, NID_commonName, cn_index) != -1)
{
actual_str = X509_NAME_oneline(actual_subject, NULL, 0);
@@ -2183,7 +2188,7 @@ globus_l_gsi_cred_subject_cmp(
length = X509_NAME_get_text_by_NID(desired_subject, NID_commonName,
NULL, 1024) + 1;
-
+
desired_cn = malloc(length);
X509_NAME_get_text_by_NID(desired_subject, NID_commonName,
@@ -2193,7 +2198,7 @@ globus_l_gsi_cred_subject_cmp(
length = X509_NAME_get_text_by_NID(actual_subject, NID_commonName,
NULL, 1024) + 1;
-
+
actual_cn = malloc(length);
X509_NAME_get_text_by_NID(actual_subject, NID_commonName,
@@ -2219,7 +2224,7 @@ globus_l_gsi_cred_subject_cmp(
actual_service = actual_cn;
actual_host++;
}
-
+
desired_host = strchr(desired_cn,'/');
if(desired_host == NULL)
@@ -2233,7 +2238,7 @@ globus_l_gsi_cred_subject_cmp(
desired_service = desired_cn;
desired_host++;
}
-
+
if(desired_service == NULL &&
actual_service == NULL)
{
@@ -2258,7 +2263,7 @@ globus_l_gsi_cred_subject_cmp(
{
actual_str = X509_NAME_oneline(actual_subject, NULL, 0);
desired_str = X509_NAME_oneline(desired_subject, NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_SUBJECT_CMP,
@@ -2269,7 +2274,7 @@ globus_l_gsi_cred_subject_cmp(
desired_str,
actual_str));
}
-
+
goto exit;
}
else if(actual_service == NULL)
@@ -2278,7 +2283,7 @@ globus_l_gsi_cred_subject_cmp(
{
actual_str = X509_NAME_oneline(actual_subject, NULL, 0);
desired_str = X509_NAME_oneline(desired_subject, NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_SUBJECT_CMP,
@@ -2289,8 +2294,8 @@ globus_l_gsi_cred_subject_cmp(
desired_str,
actual_str));
}
-
- goto exit;
+
+ goto exit;
}
else
{
@@ -2298,7 +2303,7 @@ globus_l_gsi_cred_subject_cmp(
{
actual_str = X509_NAME_oneline(actual_subject, NULL, 0);
desired_str = X509_NAME_oneline(desired_subject, NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_SUBJECT_CMP,
@@ -2309,7 +2314,7 @@ globus_l_gsi_cred_subject_cmp(
desired_str,
actual_str));
}
-
+
goto exit;
}
@@ -2322,7 +2327,7 @@ globus_l_gsi_cred_subject_cmp(
{
actual_str = X509_NAME_oneline(actual_subject, NULL, 0);
desired_str = X509_NAME_oneline(desired_subject, NULL, 0);
-
+
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_SUBJECT_CMP,
@@ -2335,7 +2340,7 @@ globus_l_gsi_cred_subject_cmp(
}
goto exit;
}
-
+
exit:
if(actual_cn)
@@ -2347,7 +2352,7 @@ globus_l_gsi_cred_subject_cmp(
{
free(desired_cn);
}
-
+
if(actual_str)
{
OPENSSL_free(actual_str);
@@ -2359,7 +2364,7 @@ globus_l_gsi_cred_subject_cmp(
}
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
-
+
return result;
}
@@ -2378,9 +2383,9 @@ globus_l_gsi_cred_get_service(
GLOBUS_I_GSI_CRED_DEBUG_ENTER;
*service = NULL;
-
+
/* if desired subject is NULL return success */
-
+
if(!subject)
{
goto exit;
@@ -2391,7 +2396,7 @@ globus_l_gsi_cred_get_service(
cn_index = X509_NAME_get_index_by_NID(subject, NID_commonName, -1);
/* error if no common name was found */
-
+
if(cn_index < 0)
{
subject_str = X509_NAME_oneline(subject, NULL, 0);
@@ -2403,7 +2408,7 @@ globus_l_gsi_cred_get_service(
}
/* check that subject only has one CN entry */
-
+
if(X509_NAME_get_index_by_NID(subject, NID_commonName, cn_index) != -1)
{
subject_str = X509_NAME_oneline(subject, NULL, 0);
@@ -2418,12 +2423,12 @@ globus_l_gsi_cred_get_service(
length = X509_NAME_get_text_by_NID(subject, NID_commonName,
NULL, 1024) + 1;
-
+
cn = malloc(length);
-
+
X509_NAME_get_text_by_NID(subject, NID_commonName,
cn, length);
-
+
host = strchr(cn,'/');
if(host == NULL)
@@ -2455,9 +2460,9 @@ globus_l_gsi_cred_get_service(
GLOBUS_GSI_CRED_ERROR_RESULT(
result,
GLOBUS_GSI_CRED_ERROR_GETTING_SERVICE_NAME,
- (_GCRSL("No service name found in subject %s.\n"), subject_str));
+ (_GCRSL("No service name found in subject %s.\n"), subject_str));
}
-
+
goto exit;
exit:
@@ -2473,7 +2478,7 @@ globus_l_gsi_cred_get_service(
}
GLOBUS_I_GSI_CRED_DEBUG_EXIT;
-
+
return result;
}
@@ -2484,8 +2489,8 @@ globus_l_credential_sort_cert_list(
{
X509 * tmp_cert = NULL;
X509 * tmp_signer = NULL;
- X509_NAME * candidate_issuer;
- X509_NAME * signer_subject;
+ const X509_NAME * candidate_issuer;
+ const X509_NAME * signer_subject;
STACK_OF(X509) * ordered_certs;
int i, j, issuer_idx;
diff --git a/gsi/gridmap_eppn_callout/configure.ac b/gsi/gridmap_eppn_callout/configure.ac
index 534ece6ba4..09dd5ea3f5 100644
--- a/gsi/gridmap_eppn_callout/configure.ac
+++ b/gsi/gridmap_eppn_callout/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gridmap_eppn_callout],[2.2],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gridmap_eppn_callout],[2.3],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/gridmap_eppn_callout/globus_gridmap_eppn.c b/gsi/gridmap_eppn_callout/globus_gridmap_eppn.c
index deff089c8a..65e9dc1714 100644
--- a/gsi/gridmap_eppn_callout/globus_gridmap_eppn.c
+++ b/gsi/gridmap_eppn_callout/globus_gridmap_eppn.c
@@ -294,9 +294,13 @@ ggvm_get_eppn(
{
ASN1_OBJECT * eppn_obj;
int extpos;
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_EXTENSION * eppn_ext;
- ASN1_STRING * eppn_str;
- unsigned char * eppn_data;
+#else
+ const X509_EXTENSION * eppn_ext;
+#endif
+ const ASN1_STRING * eppn_str;
+ const unsigned char * eppn_data;
int tag;
int xclass;
@@ -312,14 +316,14 @@ ggvm_get_eppn(
if (!(eppn_str = X509_EXTENSION_get_data(eppn_ext)))
return GLOBUS_FAILURE;
- eppn_data = eppn_str->data;
+ eppn_data = ASN1_STRING_get0_data(eppn_str);
if (ASN1_get_object(GT_ASN1_GET_OBJECT_CAST &eppn_data,
- length, &tag, &xclass, eppn_str->length) == 0x80)
+ length, &tag, &xclass, ASN1_STRING_length(eppn_str)) == 0x80)
return GLOBUS_FAILURE;
*data = (char *) eppn_data;
- *length = eppn_str->length;
+ *length = ASN1_STRING_length(eppn_str);
return GLOBUS_SUCCESS;
}
diff --git a/gsi/gss_assist/source/configure.ac b/gsi/gss_assist/source/configure.ac
index 551b250f9e..287d27da55 100644
--- a/gsi/gss_assist/source/configure.ac
+++ b/gsi/gss_assist/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gss_assist], [12.7],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gss_assist], [12.8],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/gss_assist/source/hostname.c b/gsi/gss_assist/source/hostname.c
index 4a80b298d7..47e955b163 100644
--- a/gsi/gss_assist/source/hostname.c
+++ b/gsi/gss_assist/source/hostname.c
@@ -25,22 +25,22 @@
#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
#define BUFFER_SIZE 8192
-#ifndef NI_MAXHOST
+#ifndef NI_MAXHOST
#define NI_MAXHOST 255
#endif
#endif
/**
- * @ingroup globus_gss_assist_name
+ * @ingroup globus_gss_assist
* Create a GSS Name structure from the given hostname. This function tries to
* resolve the given host name string to the canonical DNS name for the host.
*
* @param hostname
- * The host name or numerical address to be resolved and transform
+ * The host name or numerical address to be resolved and transform
* into a GSS Name
* @param authorization_hostname
* The resulting GSS Name
- *
+ *
* @return GLOBUS_SUCCESS on successful completion, a error object otherwise
*/
globus_result_t
@@ -55,7 +55,7 @@ globus_gss_assist_authorization_host_name(
OM_uint32 major_status;
OM_uint32 minor_status;
globus_result_t result = GLOBUS_SUCCESS;
- int i;
+ int i;
globus_addrinfo_t hints;
globus_addrinfo_t * addrinfo;
@@ -65,13 +65,13 @@ globus_gss_assist_authorization_host_name(
hints.ai_protocol = 0;
/* If hostname is an ip address, do a non-canonname getaddrinfo to get
- * the sockaddr, then getnameinfo to get the hostname from that addr */
+ * the sockaddr, then getnameinfo to get the hostname from that addr */
hints.ai_flags = GLOBUS_AI_NUMERICHOST;
result = globus_libc_getaddrinfo(hostname, NULL, &hints, &addrinfo);
/* if this succeeds then the hostname must be numeric */
if(result == GLOBUS_SUCCESS)
- {
+ {
if(addrinfo == NULL || addrinfo->ai_addr == NULL)
{
GLOBUS_GSI_GSS_ASSIST_ERROR_CHAIN_RESULT(
@@ -79,12 +79,12 @@ globus_gss_assist_authorization_host_name(
GLOBUS_GSI_GSS_ASSIST_ERROR_CANONICALIZING_HOSTNAME);
goto error_exit;
}
-
- /*
+
+ /*
* For connections to localhost, check for certificate
* matching our real hostname, not "localhost"
*/
-
+
if(globus_libc_addr_is_loopback(
(const globus_sockaddr_t *) addrinfo->ai_addr) == GLOBUS_TRUE)
{
@@ -93,8 +93,8 @@ globus_gss_assist_authorization_host_name(
}
else
{
- /* use GLOBUS_NI_NAMEREQD to fail if address can't be looked up?
- * if not, realhostname will just be the same ip address
+ /* use GLOBUS_NI_NAMEREQD to fail if address can't be looked up?
+ * if not, realhostname will just be the same ip address
* we pass in */
result = globus_libc_getnameinfo(
(const globus_sockaddr_t *) addrinfo->ai_addr,
@@ -112,16 +112,16 @@ globus_gss_assist_authorization_host_name(
goto error_exit;
}
}
-
+
globus_libc_freeaddrinfo(addrinfo);
- }
-
- /* else just do a getaddrinfo lookup of the hostname */
+ }
+
+ /* else just do a getaddrinfo lookup of the hostname */
else
{
hints.ai_flags = GLOBUS_AI_CANONNAME;
result = globus_libc_getaddrinfo(hostname, NULL, &hints, &addrinfo);
-
+
if(result != GLOBUS_SUCCESS ||
addrinfo == NULL ||
addrinfo->ai_canonname == NULL)
@@ -130,13 +130,13 @@ globus_gss_assist_authorization_host_name(
result,
GLOBUS_GSI_GSS_ASSIST_ERROR_CANONICALIZING_HOSTNAME);
goto error_exit;
- }
+ }
- /*
+ /*
* For connections to localhost, check for certificate
* matching our real hostname, not "localhost"
*/
-
+
if(globus_libc_addr_is_loopback(
(const globus_sockaddr_t *) addrinfo->ai_addr) == GLOBUS_TRUE)
{
@@ -145,30 +145,30 @@ globus_gss_assist_authorization_host_name(
}
else
{
- strncpy(&realhostname[5], addrinfo->ai_canonname,
+ strncpy(&realhostname[5], addrinfo->ai_canonname,
sizeof(realhostname) - 5);
realhostname[sizeof(realhostname) - 1] = '\0';
}
-
+
globus_libc_freeaddrinfo(addrinfo);
}
-
+
/*
* To work around the GSI GSSAPI library being case sensitive
* convert the hostname to lower case as no one seems to
* request uppercase name certificates.
*/
-
+
for (i = 5; realhostname[i] && (i < sizeof(realhostname)); i++)
{
realhostname[i] = tolower(realhostname[i]);
}
-
+
name_tok.value = realhostname;
name_tok.length = strlen(realhostname) + 1;
- major_status = gss_import_name(&minor_status,
- &name_tok,
- GSS_C_NT_HOSTBASED_SERVICE,
+ major_status = gss_import_name(&minor_status,
+ &name_tok,
+ GSS_C_NT_HOSTBASED_SERVICE,
authorization_hostname);
if(GSS_ERROR(major_status))
diff --git a/gsi/gss_assist/source/test/gridmap_test.c b/gsi/gss_assist/source/test/gridmap_test.c
index 782f93c7ca..11dbd9242a 100644
--- a/gsi/gss_assist/source/test/gridmap_test.c
+++ b/gsi/gss_assist/source/test/gridmap_test.c
@@ -129,6 +129,10 @@ create_contexts(void)
NULL,
NULL);
}
+ else
+ {
+ maj_stat = 0;
+ }
if (GSS_ERROR(maj_stat))
{
@@ -153,7 +157,7 @@ int gridmap_bad_params_test(void)
char * userid = "userid";
int rc;
char * gridmap;
-
+
gridmap = create_file_path(gridmap_dir, "grid-mapfile");
rc = globus_libc_setenv("GRIDMAP", gridmap, 1);
@@ -194,7 +198,7 @@ userok_bad_params_test(void)
char * userid = "userid";
int rc;
char * gridmap;
-
+
gridmap = create_file_path(gridmap_dir, "grid-mapfile");
rc = globus_libc_setenv("GRIDMAP", gridmap, 1);
@@ -235,7 +239,7 @@ map_local_user_bad_params_test(void)
char * userid = "joe";
int rc;
char * gridmap;
-
+
gridmap = create_file_path(gridmap_dir, "grid-mapfile");
rc = globus_libc_setenv("GRIDMAP", gridmap, 1);
@@ -277,7 +281,7 @@ lookup_all_globusid_bad_params_test(void)
int dn_count;
int rc;
char * gridmap;
-
+
gridmap = create_file_path(gridmap_dir, "grid-mapfile");
rc = globus_libc_setenv("GRIDMAP", gridmap, 1);
@@ -328,7 +332,7 @@ map_and_authorize_bad_params_test(void)
char * identity_buffer = "id";
unsigned int identity_buffer_length = 2;
char * gridmap;
-
+
gridmap = create_file_path(gridmap_dir, "grid-mapfile");
@@ -388,7 +392,7 @@ gridmap_test(void)
int failed;
int rc;
char * gridmap;
-
+
for (i = 0, failed = 0; i < SIZEOF_ARRAY(tests); i++)
{
diff --git a/gsi/gss_assist/source/wrap.c b/gsi/gss_assist/source/wrap.c
index 61df54f8b2..dffb3857ad 100644
--- a/gsi/gss_assist/source/wrap.c
+++ b/gsi/gss_assist/source/wrap.c
@@ -29,24 +29,24 @@
/**
* @brief Wrap
- * @ingroup globus_gsi_gss_assist
+ * @ingroup globus_gss_assist
*
* @param minor_status
- * GSSAPI return code. If the call was successful, the minor
+ * GSSAPI return code. If the call was successful, the minor
* status is equal to GLOBUS_SUCCESS. Otherwise, it is an
- * error object ID for which
+ * error object ID for which
* globus_error_get() and globus_object_free()
* can be used to get and destroy it.
* @param context_handle
- * the context.
+ * the context.
* @param data
* pointer to application data to wrap and send
* @param length
* length of the @a data array
* @param token_status
- * assist routine get/send token status
+ * assist routine get/send token status
* @param gss_assist_send_token
- * a send_token routine
+ * a send_token routine
* @param gss_assist_send_context
* first arg for the send_token
* @param fperr
@@ -54,7 +54,7 @@
*
* @return
* GSS_S_COMPLETE on success
- * Other GSSAPI errors on failure.
+ * Other GSSAPI errors on failure.
*
* @see gss_wrap()
*/
@@ -62,9 +62,9 @@ OM_uint32
globus_gss_assist_wrap_send(
OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
- char * data,
- size_t length,
- int * token_status,
+ char * data,
+ size_t length,
+ int * token_status,
int (*gss_assist_send_token)(void *, void *, size_t),
void * gss_assist_send_context,
FILE * fperr)
@@ -91,12 +91,12 @@ globus_gss_assist_wrap_send(
input_token,
NULL,
output_token);
-
+
GLOBUS_I_GSI_GSS_ASSIST_DEBUG_FPRINTF(
3, (globus_i_gsi_gss_assist_debug_fstream,
_GASL("Wrap_send:maj:%8.8x min:%8.8x inlen:%u outlen:%u\n"),
- (unsigned int) major_status,
- (unsigned int) *minor_status,
+ (unsigned int) major_status,
+ (unsigned int) *minor_status,
input_token->length = length,
output_token->length));
@@ -118,7 +118,7 @@ globus_gss_assist_wrap_send(
local_minor_status,
*token_status);
}
-
+
local_result = globus_error_put(error_copy);
GLOBUS_GSI_GSS_ASSIST_ERROR_CHAIN_RESULT(
local_result,
@@ -135,7 +135,7 @@ globus_gss_assist_wrap_send(
GLOBUS_GSI_GSS_ASSIST_ERROR_RESULT(
local_result,
GLOBUS_GSI_GSS_ASSIST_ERROR_WITH_WRAP,
- (_GASL("Error sending output token. token status: %d\n"),
+ (_GASL("Error sending output token. token status: %d\n"),
*token_status));
*minor_status = (OM_uint32) local_result;
major_status = GSS_S_FAILURE;
@@ -160,7 +160,7 @@ globus_gss_assist_wrap_send(
output_token);
exit:
-
+
GLOBUS_I_GSI_GSS_ASSIST_DEBUG_EXIT;
return major_status;
}
diff --git a/gsi/gssapi/source/configure.ac b/gsi/gssapi/source/configure.ac
index 1f313cdceb..523152edc0 100644
--- a/gsi/gssapi/source/configure.ac
+++ b/gsi/gssapi/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gssapi_gsi],[14.20],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gssapi_gsi],[14.21],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/gssapi/source/library/compare_name.c b/gsi/gssapi/source/library/compare_name.c
index 5ddc5aebbb..d08528d3b9 100644
--- a/gsi/gssapi/source/library/compare_name.c
+++ b/gsi/gssapi/source/library/compare_name.c
@@ -37,7 +37,7 @@
#endif
/* Comparison types */
-typedef enum
+typedef enum
{
GSS_I_COMPARE_NT_ANONYMOUS,
GSS_I_COMPARE_NT_X509,
@@ -174,7 +174,7 @@ gss_l_get_oid_type(
* @ingroup globus_gsi_gssapi
* @details
* Compare two names. GSSAPI names in this implementation
- * are pointers to X.509 names.
+ * are pointers to X.509 names.
*
* @param minor_status
* currently is always set to GLOBUS_SUCCESS
@@ -185,7 +185,7 @@ gss_l_get_oid_type(
* @return
* currently always returns GSS_S_COMPLETE
*/
-OM_uint32
+OM_uint32
GSS_CALLCONV gss_compare_name(
OM_uint32 * minor_status,
const gss_name_t name1_P,
@@ -272,7 +272,7 @@ GSS_CALLCONV gss_compare_name(
_GGSL("Name 2 is of type %s:\n"),
gss_l_name_types[type2]));
- /* Normalize order of name1 and name2 so we can have fewer comparisons
+ /* Normalize order of name1 and name2 so we can have fewer comparisons
* below
*/
if (type1 > type2)
@@ -377,7 +377,7 @@ GSS_CALLCONV gss_compare_name(
GLOBUS_I_GSI_GSSAPI_DEBUG_EXIT;
return major_status;
-}
+}
/* gss_compare_name */
static
@@ -415,7 +415,7 @@ gss_l_compare_x509_to_x509(
{
dns_alt_name_found1 = GLOBUS_TRUE;
- ns1 = (char *) ASN1_STRING_data(gn1->d.dNSName);
+ ns1 = (char *) ASN1_STRING_get0_data(gn1->d.dNSName);
for (i2 = 0; i2 < name_count2; i2++)
{
@@ -423,7 +423,7 @@ gss_l_compare_x509_to_x509(
if (gn2->type == GEN_DNS)
{
- ns2 = (char *) ASN1_STRING_data(gn2->d.dNSName);
+ ns2 = (char *) ASN1_STRING_get0_data(gn2->d.dNSName);
dns_alt_name_found2 = GLOBUS_TRUE;
major_status = gss_l_compare_hostnames_with_wildcards(
@@ -472,7 +472,7 @@ gss_l_compare_x509_to_x509(
if (gn2->type == GEN_DNS)
{
- ns2 = (char *) ASN1_STRING_data(gn2->d.dNSName);
+ ns2 = (char *) ASN1_STRING_get0_data(gn2->d.dNSName);
major_status = gss_l_compare_hostnames_with_wildcards(
minor_status,
@@ -596,7 +596,7 @@ gss_l_compare_x509_to_hostbased_service(
gn1 = sk_GENERAL_NAME_value(name1->subjectAltNames, i1);
if (gn1->type == GEN_DNS)
{
- ns1 = (char *) ASN1_STRING_data(gn1->d.dNSName);
+ ns1 = (char *) ASN1_STRING_get0_data(gn1->d.dNSName);
/* In strict RFC mode, we're going to require the service
* portion of the hostbased service name to be "host" (the
@@ -691,7 +691,7 @@ gss_l_compare_x509_to_host_ip(
gn1 = sk_GENERAL_NAME_value(name1->subjectAltNames, i1);
if (gn1->type == GEN_DNS)
{
- ns1 = (char *) ASN1_STRING_data(gn1->d.dNSName);
+ ns1 = (char *) ASN1_STRING_get0_data(gn1->d.dNSName);
major_status = gss_l_compare_hostnames_with_wildcards(
minor_status,
@@ -714,7 +714,7 @@ gss_l_compare_x509_to_host_ip(
{
int ip_as_ints[16], j;
int len = ASN1_STRING_length(gn1->d.iPAddress);
- ns1 = (char *) ASN1_STRING_data(gn1->d.iPAddress);
+ ns1 = (char *) ASN1_STRING_get0_data(gn1->d.iPAddress);
for (j = 0; j < len; j++)
{
@@ -911,7 +911,7 @@ gss_l_compare_hostbased_service_to_hostbased_service(
ns1 = name1->host_name;
ns2 = name2->host_name;
- /* In strict mode, we compare service names, for backward compatibility,
+ /* In strict mode, we compare service names, for backward compatibility,
* we ignore them.
*/
if (gss_i_name_compatibility_mode == GSS_I_COMPATIBILITY_STRICT_RFC2818 &&
@@ -1012,7 +1012,7 @@ gss_l_compare_host_ip_to_host_ip(
{
*name_equal = GSS_NAMES_EQUAL;
}
- else if (gss_i_name_compatibility_mode != GSS_I_COMPATIBILITY_STRICT_RFC2818)
+ else if (gss_i_name_compatibility_mode != GSS_I_COMPATIBILITY_STRICT_RFC2818)
{
ns1 = name1->ip_name;
major_status = gss_l_compare_hostnames_with_wildcards(
@@ -1182,7 +1182,7 @@ gss_l_compare_hostnames_with_wildcards(
}
}
- else if (wildcards2 == GSS_I_WILDCARD_GT2 && *tok2 == '-'
+ else if (wildcards2 == GSS_I_WILDCARD_GT2 && *tok2 == '-'
&& first_token)
{
if (*tok1 != '\0')
@@ -1243,7 +1243,7 @@ gss_l_strsep(char **stringp, const char * delim)
/* Convert oid struct to integer
*
* @param oid
- * OID to convert to a gss_l_compare_type_t (or -1 if the
+ * OID to convert to a gss_l_compare_type_t (or -1 if the
* name type is not supported.
*/
static
@@ -1259,7 +1259,7 @@ gss_l_get_oid_type(
{
return GSS_I_COMPARE_NT_X509;
}
- else if (g_OID_equal(oid, GSS_C_NO_OID) ||
+ else if (g_OID_equal(oid, GSS_C_NO_OID) ||
g_OID_equal(oid, GSS_C_NT_USER_NAME))
{
return GSS_I_COMPARE_NT_NO_OID;
diff --git a/gsi/gssapi/source/library/display_name.c b/gsi/gssapi/source/library/display_name.c
index 0a3d76a2ef..f1523be295 100644
--- a/gsi/gssapi/source/library/display_name.c
+++ b/gsi/gssapi/source/library/display_name.c
@@ -34,15 +34,15 @@
* @details
* Produces a single line version of the internal X.509 name
*
- * @param minor_status
+ * @param minor_status
* @param input_name_P
* @param output_name
* @param output_name_type
*
- * @return
+ * @return
*/
-OM_uint32
-GSS_CALLCONV
+OM_uint32
+GSS_CALLCONV
gss_display_name(
OM_uint32 * minor_status,
const gss_name_t input_name_P,
@@ -51,7 +51,7 @@ gss_display_name(
{
OM_uint32 major_status = GSS_S_COMPLETE;
- const gss_name_desc* input_name =
+ const gss_name_desc* input_name =
(gss_name_desc*) input_name_P;
GLOBUS_I_GSI_GSSAPI_DEBUG_ENTER;
@@ -62,7 +62,7 @@ gss_display_name(
{
major_status = GSS_S_FAILURE;
GLOBUS_GSI_GSSAPI_ERROR_RESULT(
- minor_status,
+ minor_status,
GLOBUS_GSI_GSSAPI_ERROR_BAD_ARGUMENT,
("Bad argument"));
goto exit;
@@ -146,7 +146,7 @@ gss_display_name(
{
int name_length;
GENERAL_NAME * name;
- unsigned char * dns;
+ const unsigned char * dns;
int i;
name_length = sk_GENERAL_NAME_num(input_name->subjectAltNames);
@@ -156,9 +156,9 @@ gss_display_name(
if (name->type == GEN_DNS)
{
- dns = ASN1_STRING_data(name->d.dNSName);
+ dns = ASN1_STRING_get0_data(name->d.dNSName);
output_name->value =
- globus_common_create_string("/CN=%s", (char *) dns);
+ globus_common_create_string("/CN=%s", (const char *) dns);
if (output_name->value == NULL)
{
GLOBUS_GSI_GSSAPI_MALLOC_ERROR(minor_status);
@@ -174,7 +174,7 @@ gss_display_name(
{
major_status = GSS_S_BAD_NAME;
GLOBUS_GSI_GSSAPI_ERROR_RESULT(
- minor_status,
+ minor_status,
GLOBUS_GSI_GSSAPI_ERROR_BAD_NAME,
("X.509 Name contains no SubjectName and no dNSName."));
goto exit;
@@ -184,12 +184,12 @@ gss_display_name(
{
major_status = GSS_S_FAILURE;
GLOBUS_GSI_GSSAPI_ERROR_RESULT(
- minor_status,
+ minor_status,
GLOBUS_GSI_GSSAPI_ERROR_BAD_NAME,
("Bad Name"));
goto exit;
}
-
+
if(output_name_type)
{
*output_name_type = input_name->name_oid;
@@ -199,5 +199,5 @@ gss_display_name(
GLOBUS_I_GSI_GSSAPI_DEBUG_EXIT;
return major_status;
-}
+}
/* gss_display_name */
diff --git a/gsi/gssapi/source/library/globus_i_gsi_gss_utils.c b/gsi/gssapi/source/library/globus_i_gsi_gss_utils.c
index 6e40d8aa1e..5a3a79e8eb 100644
--- a/gsi/gssapi/source/library/globus_i_gsi_gss_utils.c
+++ b/gsi/gssapi/source/library/globus_i_gsi_gss_utils.c
@@ -2690,12 +2690,18 @@ globus_i_gsi_gss_get_context_goodtill(
*
* @return
*/
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
int globus_i_gsi_gss_verify_extensions_callback(
globus_gsi_callback_data_t callback_data,
X509_EXTENSION * extension)
+#else
+int globus_i_gsi_gss_verify_extensions_callback(
+ globus_gsi_callback_data_t callback_data,
+ const X509_EXTENSION * extension)
+#endif
{
gss_OID_set extension_oids;
- ASN1_OBJECT * extension_obj;
+ const ASN1_OBJECT * extension_obj;
int index;
int return_val = 0;
globus_result_t local_result;
@@ -2756,9 +2762,9 @@ globus_i_gsi_gssapi_get_hostname(
int common_name_NID;
int index;
unsigned int length;
- unsigned char * data;
- unsigned char * p;
- X509_NAME_ENTRY * name_entry = NULL;
+ const unsigned char * data;
+ const unsigned char * p;
+ const X509_NAME_ENTRY * name_entry = NULL;
name->service_name = name->host_name = NULL;
*minor_status = GLOBUS_SUCCESS;
@@ -2769,9 +2775,9 @@ globus_i_gsi_gssapi_get_hostname(
name_entry = X509_NAME_get_entry(name->x509n, index);
if (OBJ_obj2nid(X509_NAME_ENTRY_get_object(name_entry)) == common_name_NID)
{
- ASN1_STRING *s = X509_NAME_ENTRY_get_data(name_entry);
+ const ASN1_STRING *s = X509_NAME_ENTRY_get_data(name_entry);
length = ASN1_STRING_length(s);
- data = ASN1_STRING_data(s);
+ data = ASN1_STRING_get0_data(s);
p = memchr(data, '/', length);
diff --git a/gsi/gssapi/source/library/globus_i_gsi_gss_utils.h b/gsi/gssapi/source/library/globus_i_gsi_gss_utils.h
index c8b81e3997..9a136162c8 100644
--- a/gsi/gssapi/source/library/globus_i_gsi_gss_utils.h
+++ b/gsi/gssapi/source/library/globus_i_gsi_gss_utils.h
@@ -128,7 +128,7 @@ extern globus_bool_t globus_i_gssapi_active;
{ \
globus_libc_fprintf _MESSAGE_; \
} \
-}
+}
#define GLOBUS_I_GSI_GSSAPI_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) \
{ \
@@ -151,7 +151,7 @@ extern globus_bool_t globus_i_gssapi_active;
"%s", _MESSAGE_); \
} \
}
-
+
#define GLOBUS_I_GSI_GSSAPI_DEBUG_PRINT_OBJECT(_LEVEL_, _TYPE_, _OBJ_) \
{ \
if (GLOBUS_I_GSI_GSSAPI_DEBUG(_LEVEL_)) \
@@ -245,9 +245,15 @@ globus_i_gsi_gss_create_cred(
globus_gsi_cred_handle_t * cred_handle,
globus_bool_t sni_context);
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
int globus_i_gsi_gss_verify_extensions_callback(
globus_gsi_callback_data_t callback_data,
X509_EXTENSION * extension);
+#else
+int globus_i_gsi_gss_verify_extensions_callback(
+ globus_gsi_callback_data_t callback_data,
+ const X509_EXTENSION * extension);
+#endif
OM_uint32
globus_i_gsi_gss_handshake(
diff --git a/gsi/gssapi/source/library/import_name.c b/gsi/gssapi/source/library/import_name.c
index f13e345050..d873ae1fb6 100644
--- a/gsi/gssapi/source/library/import_name.c
+++ b/gsi/gssapi/source/library/import_name.c
@@ -41,7 +41,7 @@ gss_l_resolve_ip(
*
* Creates a new gss_name_t which contains a mechanism-specific representation
* of the input name. GSSAPI OpenSSL implements the following name types, based
- * on the input_name_type OID:
+ * on the input_name_type OID:
*
* - GSS_C_NT_ANONYMOUS (input_name_buffer is ignored)
* - GSS_C_NT_HOSTBASED_SERVICE (input_name_buffer contains a string
@@ -84,7 +84,7 @@ gss_l_resolve_ip(
* indicates that the requested operation could not be performed for
* reasons unspecified at the GSS-API level.
*/
-OM_uint32
+OM_uint32
GSS_CALLCONV gss_import_name(
OM_uint32 * minor_status,
const gss_buffer_t input_name_buffer,
@@ -119,14 +119,14 @@ GSS_CALLCONV gss_import_name(
*minor_status = (OM_uint32) GLOBUS_SUCCESS;
output_name = calloc(1, sizeof(gss_name_desc));
-
+
if (output_name == NULL)
{
GLOBUS_GSI_GSSAPI_MALLOC_ERROR(minor_status);
major_status = GSS_S_FAILURE;
goto out;
- }
-
+ }
+
output_name->name_oid = input_name_type;
output_name->x509n = X509_NAME_new();
if (output_name->x509n == NULL)
@@ -289,7 +289,7 @@ GSS_CALLCONV gss_import_name(
goto release_name_out;
}
memcpy(output_name->user_name,
- input_name_buffer->value,
+ input_name_buffer->value,
input_name_buffer->length);
output_name->user_name[input_name_buffer->length] = '\0';
@@ -411,7 +411,7 @@ GSS_CALLCONV gss_import_name(
}
else if (g_OID_equal(GLOBUS_GSS_C_NT_X509, input_name_type))
{
- X509_NAME *n;
+ const X509_NAME *n;
X509 *x509_input;
GENERAL_NAMES *subject_alt_name;
int idx;
@@ -465,7 +465,7 @@ GSS_CALLCONV gss_import_name(
idx != -1;
idx = X509_get_ext_by_NID(x509_input, NID_subject_alt_name, idx))
{
- X509_EXTENSION * ext_value;
+ const X509_EXTENSION * ext_value;
ext_value = X509_get_ext(x509_input, idx);
if (!ext_value)
@@ -493,7 +493,7 @@ GSS_CALLCONV gss_import_name(
else
{
GLOBUS_GSI_GSSAPI_ERROR_RESULT(
- minor_status,
+ minor_status,
GLOBUS_GSI_GSSAPI_ERROR_BAD_NAME,
(_GGSL("Bad name type")));
@@ -510,12 +510,12 @@ GSS_CALLCONV gss_import_name(
}
*output_name_P = output_name;
-
+
out:
GLOBUS_I_GSI_GSSAPI_DEBUG_EXIT;
return major_status;
-}
+}
/* gss_import_name */
diff --git a/gsi/gssapi/source/library/inquire_cred_by_oid.c b/gsi/gssapi/source/library/inquire_cred_by_oid.c
index 668b93b9ee..a22ebd17cb 100644
--- a/gsi/gssapi/source/library/inquire_cred_by_oid.c
+++ b/gsi/gssapi/source/library/inquire_cred_by_oid.c
@@ -31,8 +31,8 @@
/**
* @brief Inquire Cred By OID
* @ingroup globus_gsi_gssapi_extensions
- * @details
- * NOTE: Checks both the cert in the credential and
+ * @details
+ * NOTE: Checks both the cert in the credential and
* the certs in the cert chain for a valid extension
* that matches the desired OID. The first one found
* is used, starting with the endpoint cert, and then
@@ -55,24 +55,24 @@ GSS_CALLCONV gss_inquire_cred_by_oid(
{
OM_uint32 major_status = GSS_S_COMPLETE;
OM_uint32 local_minor_status;
- X509_EXTENSION * extension;
+ const X509_EXTENSION * extension;
X509 * cert = NULL;
STACK_OF(X509) * cert_chain = NULL;
ASN1_OBJECT * desired_asn1_obj;
- ASN1_OCTET_STRING * asn1_oct_string;
+ const ASN1_OCTET_STRING * asn1_oct_string;
gss_buffer_desc data_set_buffer;
int chain_index;
int found_index;
globus_result_t local_result = GLOBUS_SUCCESS;
GLOBUS_I_GSI_GSSAPI_DEBUG_ENTER;
-
+
if(minor_status == NULL)
{
major_status = GSS_S_FAILURE;
goto exit;
}
-
+
*minor_status = (OM_uint32) GLOBUS_SUCCESS;
/* parameter checking goes here */
@@ -121,7 +121,7 @@ GSS_CALLCONV gss_inquire_cred_by_oid(
}
major_status = gss_create_empty_buffer_set(
- &local_minor_status,
+ &local_minor_status,
data_set);
if(GSS_ERROR(major_status))
@@ -199,9 +199,9 @@ GSS_CALLCONV gss_inquire_cred_by_oid(
goto exit;
}
- data_set_buffer.value = asn1_oct_string->data;
- data_set_buffer.length = asn1_oct_string->length;
-
+ data_set_buffer.value = (unsigned char *) ASN1_STRING_get0_data(asn1_oct_string);
+ data_set_buffer.length = ASN1_STRING_length(asn1_oct_string);
+
major_status = gss_add_buffer_set_member(
&local_minor_status,
&data_set_buffer,
@@ -224,9 +224,9 @@ GSS_CALLCONV gss_inquire_cred_by_oid(
{
sk_X509_pop_free(cert_chain, X509_free);
}
-
+
GLOBUS_I_GSI_GSSAPI_DEBUG_EXIT;
return major_status;
}
-
+
#endif /* _HAVE_GSI_EXTENDED_GSSAPI */
diff --git a/gsi/gssapi/source/library/inquire_sec_context_by_oid.c b/gsi/gssapi/source/library/inquire_sec_context_by_oid.c
index ebd3cefc10..4f33cdee16 100644
--- a/gsi/gssapi/source/library/inquire_sec_context_by_oid.c
+++ b/gsi/gssapi/source/library/inquire_sec_context_by_oid.c
@@ -47,11 +47,12 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
int found_index;
int chain_index;
int cert_count;
- X509_EXTENSION * extension;
+ const X509_EXTENSION * extension;
X509 * cert = NULL;
STACK_OF(X509) * cert_chain = NULL;
ASN1_OBJECT * asn1_desired_obj = NULL;
ASN1_OCTET_STRING * asn1_oct_string;
+ const ASN1_OCTET_STRING * asn1_oct_string_c;
gss_buffer_desc data_set_buffer = GSS_C_EMPTY_BUFFER;
globus_result_t local_result = GLOBUS_SUCCESS;
unsigned char * tmp_ptr;
@@ -69,7 +70,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
major_status = GSS_S_FAILURE;
goto exit;
}
-
+
if(context_handle == GSS_C_NO_CONTEXT)
{
GLOBUS_GSI_GSSAPI_ERROR_RESULT(
@@ -108,7 +109,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
/* lock the context mutex */
globus_mutex_lock(&context->mutex);
- local_result =
+ local_result =
globus_gsi_callback_get_cert_depth(context->callback_data,
&cert_count);
if(local_result != GLOBUS_SUCCESS)
@@ -124,7 +125,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
{
goto unlock_exit;
}
-
+
major_status = gss_create_empty_buffer_set(&local_minor_status, data_set);
if(GSS_ERROR(major_status))
@@ -134,7 +135,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
GLOBUS_GSI_GSSAPI_ERROR_WITH_BUFFER);
goto unlock_exit;
}
-
+
local_result = globus_gsi_callback_get_cert_chain(
context->callback_data,
&cert_chain);
@@ -260,7 +261,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
gss_ext_x509_cert_chain_oid->length))
{
/* figure out what object was asked for */
-
+
asn1_desired_obj = ASN1_OBJECT_create(
NID_undef,
desired_object->elements,
@@ -285,10 +286,10 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
data_set_buffer.value = NULL;
data_set_buffer.length = 0;
- found_index = X509_get_ext_by_OBJ(cert,
- asn1_desired_obj,
+ found_index = X509_get_ext_by_OBJ(cert,
+ asn1_desired_obj,
found_index);
-
+
if(found_index >= 0)
{
extension = X509_get_ext(cert, found_index);
@@ -303,8 +304,8 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
goto unlock_exit;
}
- asn1_oct_string = X509_EXTENSION_get_data(extension);
- if(!asn1_oct_string)
+ asn1_oct_string_c = X509_EXTENSION_get_data(extension);
+ if(!asn1_oct_string_c)
{
GLOBUS_GSI_GSSAPI_OPENSSL_ERROR_RESULT(
minor_status,
@@ -315,7 +316,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
goto unlock_exit;
}
- asn1_oct_string = ASN1_OCTET_STRING_dup(asn1_oct_string);
+ asn1_oct_string = ASN1_OCTET_STRING_dup(asn1_oct_string_c);
if(!asn1_oct_string)
{
@@ -327,11 +328,11 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
goto unlock_exit;
}
- data_set_buffer.value = asn1_oct_string->data;
- data_set_buffer.length = asn1_oct_string->length;
+ data_set_buffer.value = (unsigned char *) ASN1_STRING_get0_data(asn1_oct_string);
+ data_set_buffer.length = ASN1_STRING_length(asn1_oct_string);
OPENSSL_free(asn1_oct_string);
-
+
major_status = gss_add_buffer_set_member(
&local_minor_status,
&data_set_buffer,
@@ -344,7 +345,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
goto unlock_exit;
}
}
- }
+ }
}
else
{
@@ -363,9 +364,9 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
GLOBUS_GSI_GSSAPI_ERROR_WITH_OPENSSL,
(_GGSL("Failed to serialize certificate")));
major_status = GSS_S_FAILURE;
- goto unlock_exit;
+ goto unlock_exit;
}
-
+
tmp_ptr = realloc(data_set_buffer.value,
data_set_buffer.length);
@@ -373,11 +374,11 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
{
GLOBUS_GSI_GSSAPI_MALLOC_ERROR(minor_status);
major_status = GSS_S_FAILURE;
- goto unlock_exit;
+ goto unlock_exit;
}
data_set_buffer.value = tmp_ptr;
-
+
if(i2d_X509(cert,&tmp_ptr) < 0)
{
free(data_set_buffer.value);
@@ -386,7 +387,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
GLOBUS_GSI_GSSAPI_ERROR_WITH_OPENSSL,
(_GGSL("Failed to serialize certificate")));
major_status = GSS_S_FAILURE;
- goto unlock_exit;
+ goto unlock_exit;
}
major_status = gss_add_buffer_set_member(
@@ -401,7 +402,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
goto unlock_exit;
}
}
-
+
if(data_set_buffer.value != NULL)
{
free(data_set_buffer.value);
@@ -421,7 +422,7 @@ GSS_CALLCONV gss_inquire_sec_context_by_oid(
{
sk_X509_pop_free(cert_chain, X509_free);
}
-
+
GLOBUS_I_GSI_GSSAPI_DEBUG_EXIT;
return major_status;
}
diff --git a/gsi/gssapi/source/test/alpn-test.c b/gsi/gssapi/source/test/alpn-test.c
index a0870b5e71..87ad9968cd 100644
--- a/gsi/gssapi/source/test/alpn-test.c
+++ b/gsi/gssapi/source/test/alpn-test.c
@@ -54,7 +54,6 @@ init_no_client_alpn(void)
{
3, 'g', 's', 'i',
};
- const char *why = "";
major_status = gss_set_sec_context_option(
&minor_status,
@@ -67,9 +66,7 @@ init_no_client_alpn(void)
});
if (major_status != GSS_S_COMPLETE)
{
- why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
do
@@ -95,7 +92,6 @@ init_no_client_alpn(void)
if (GSS_ERROR(major_status))
{
- why = "gss_init_sec_context";
result = false;
break;
}
@@ -120,7 +116,6 @@ init_no_client_alpn(void)
if (GSS_ERROR(major_status))
{
- why = "accept_sec_context";
result = false;
}
}
@@ -139,15 +134,12 @@ init_no_client_alpn(void)
if (major_status != GSS_S_COMPLETE)
{
- why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
if (data->count != 0)
{
- why = "inquire_result";
result = false;
goto fail;
}
@@ -212,7 +204,6 @@ init_no_server_alpn(void)
gss_buffer_desc accept_generated_token = {0};
bool result = true;
OM_uint32 ignore_minor_status = 0;
- const char *why = "";
unsigned char client_alpn[] =
{
3, 'g', 's', 'i',
@@ -229,9 +220,7 @@ init_no_server_alpn(void)
});
if (major_status != GSS_S_COMPLETE)
{
- why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
do
@@ -257,7 +246,6 @@ init_no_server_alpn(void)
if (GSS_ERROR(major_status))
{
- why = "gss_init_sec_context";
result = false;
break;
}
@@ -282,7 +270,6 @@ init_no_server_alpn(void)
if (GSS_ERROR(major_status))
{
- why = "accept_sec_context";
result = false;
}
}
@@ -300,15 +287,12 @@ init_no_server_alpn(void)
&data);
if (major_status != GSS_S_COMPLETE)
{
- why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
if (data->count != 0)
{
- why = "inquire_result";
result = false;
goto fail;
}
@@ -387,7 +371,6 @@ init_alpn1(void)
gss_buffer_desc accept_generated_token = {0};
bool result = true;
OM_uint32 ignore_minor_status = 0;
- const char *why = "";
unsigned char server_alpn[] =
{
3, 'g', 's', 'i',
@@ -408,9 +391,7 @@ init_alpn1(void)
});
if (major_status != GSS_S_COMPLETE)
{
- why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
major_status = gss_set_sec_context_option(
@@ -424,9 +405,7 @@ init_alpn1(void)
});
if (major_status != GSS_S_COMPLETE)
{
- why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
@@ -453,7 +432,6 @@ init_alpn1(void)
if (GSS_ERROR(major_status))
{
- why = "gss_init_sec_context";
result = false;
break;
}
@@ -478,7 +456,6 @@ init_alpn1(void)
if (GSS_ERROR(major_status))
{
- why = "accept_sec_context";
result = false;
}
}
@@ -495,9 +472,7 @@ init_alpn1(void)
&data);
if (major_status != GSS_S_COMPLETE)
{
- why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
@@ -508,7 +483,6 @@ init_alpn1(void)
&server_alpn[1],
server_alpn[0]) != 0)
{
- why = "inquire_result";
result = false;
goto fail;
}
@@ -521,9 +495,7 @@ init_alpn1(void)
&data);
if (major_status != GSS_S_COMPLETE)
{
- why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
@@ -534,7 +506,6 @@ init_alpn1(void)
&client_alpn[1],
client_alpn[0]) != 0)
{
- why = "inquire_result";
result = false;
goto fail;
}
@@ -611,7 +582,6 @@ init_alpn_secondary_match(void)
gss_buffer_desc accept_generated_token = {0};
bool result = true;
OM_uint32 ignore_minor_status = 0;
- const char *why = "";
unsigned char server_alpn[] =
{
3, 'g', 's', 's',
@@ -633,9 +603,7 @@ init_alpn_secondary_match(void)
});
if (major_status != GSS_S_COMPLETE)
{
- why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
@@ -650,9 +618,7 @@ init_alpn_secondary_match(void)
});
if (major_status != GSS_S_COMPLETE)
{
- why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
do
@@ -678,7 +644,6 @@ init_alpn_secondary_match(void)
if (GSS_ERROR(major_status))
{
- why = "gss_init_sec_context";
result = false;
break;
}
@@ -703,7 +668,6 @@ init_alpn_secondary_match(void)
if (GSS_ERROR(major_status))
{
- why = "accept_sec_context";
result = false;
}
}
@@ -721,9 +685,7 @@ init_alpn_secondary_match(void)
&data);
if (major_status != GSS_S_COMPLETE)
{
- why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
@@ -734,7 +696,6 @@ init_alpn_secondary_match(void)
&server_alpn[5],
server_alpn[4]) != 0)
{
- why = "inquire_result";
result = false;
goto fail;
}
@@ -747,9 +708,7 @@ init_alpn_secondary_match(void)
&data);
if (major_status != GSS_S_COMPLETE)
{
- why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
@@ -760,7 +719,6 @@ init_alpn_secondary_match(void)
&client_alpn[1],
client_alpn[0]) != 0)
{
- why = "inquire_result";
result = false;
goto fail;
}
@@ -856,7 +814,6 @@ init_alpn_nomatch(void)
{
why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
@@ -873,7 +830,6 @@ init_alpn_nomatch(void)
{
why = "gss_set_sec_context_option";
result = false;
-
goto fail;
}
do
@@ -946,7 +902,6 @@ init_alpn_nomatch(void)
{
why = "inquire_context_by_oid";
result = false;
-
goto fail;
}
@@ -1095,7 +1050,7 @@ main(int argc, char *argv[])
fprintf(stderr, "ALPN not supported\n");
exit(77);
}
-
+
size_t num_test_cases = sizeof(test_cases)/sizeof(test_cases[0]);
printf("1..%zu\n", num_test_cases);
diff --git a/gsi/gssapi/source/test/duplicate_name_test.c b/gsi/gssapi/source/test/duplicate_name_test.c
index 97ac37334e..68d0743b07 100644
--- a/gsi/gssapi/source/test/duplicate_name_test.c
+++ b/gsi/gssapi/source/test/duplicate_name_test.c
@@ -37,7 +37,7 @@ duplicate_bad_params_test(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NT_HOSTBASED_SERVICE;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -96,7 +96,7 @@ duplicate_username_test(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NO_OID;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -165,7 +165,7 @@ duplicate_anonymous_test(void)
name_tok.value = NULL;
name_tok.length = 0;
name_type = GSS_C_NT_ANONYMOUS;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -178,7 +178,7 @@ duplicate_anonymous_test(void)
return 1;
}
-
+
major_status = gss_duplicate_name(&minor_status, gss_name, &name_copy);
if(major_status != GSS_S_COMPLETE)
{
@@ -191,7 +191,7 @@ duplicate_anonymous_test(void)
name_copy,
&name_tok,
NULL);
-
+
if(major_status != GSS_S_COMPLETE)
{
globus_gsi_gssapi_test_print_error(stderr, major_status, minor_status);
@@ -253,7 +253,7 @@ duplicate_hostbase_service_test(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NT_HOSTBASED_SERVICE;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -325,7 +325,7 @@ duplicate_host_ip_test(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GLOBUS_GSS_C_NT_HOST_IP;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -407,7 +407,7 @@ duplicate_x509_test(void)
for (i = 0; i < SIZEOF_ARRAY(test_certs); i++)
{
char * test_cert;
-
+
if (test_cert_dir)
{
test_cert = globus_common_create_string("%s/%s",
@@ -417,15 +417,15 @@ duplicate_x509_test(void)
{
test_cert = test_certs[i];
}
-
+
result = globus_gsi_cred_handle_init(&cred_handle, NULL);
if (result != GLOBUS_SUCCESS)
{
globus_gsi_gssapi_test_print_result(stderr, result);
if (test_cert_dir)
- {
- free(test_cert);
+ {
+ free(test_cert);
}
return 2;
@@ -454,7 +454,7 @@ duplicate_x509_test(void)
name_tok.value = x509;
name_tok.length = sizeof(x509);
name_type = GLOBUS_GSS_C_NT_X509;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -532,7 +532,7 @@ duplicate_x509_test(void)
int main()
{
- int i, rc = 0, failed = 0;
+ int i, rc = 0;
globus_module_descriptor_t *modules[] =
{
GLOBUS_COMMON_MODULE,
@@ -562,10 +562,6 @@ int main()
{
rc = (*(tests[i].func))();
- if (rc != 0)
- {
- failed++;
- }
printf("%s %s\n", rc == 0 ? "ok" : "not ok", tests[i].name);
}
diff --git a/gsi/gssapi/source/test/gssapi_test_utils.c b/gsi/gssapi/source/test/gssapi_test_utils.c
index 0a87c3489f..62aff00808 100644
--- a/gsi/gssapi/source/test/gssapi_test_utils.c
+++ b/gsi/gssapi/source/test/gssapi_test_utils.c
@@ -72,13 +72,13 @@ init_sec_context(
gss_ctx_id_t * context);
-gss_cred_id_t
+gss_cred_id_t
globus_gsi_gssapi_test_acquire_credential()
{
gss_cred_id_t credential = GSS_C_NO_CREDENTIAL;
OM_uint32 major_status = GSS_S_COMPLETE;
OM_uint32 minor_status;
-
+
major_status = gss_acquire_cred(&minor_status,
GSS_C_NO_NAME,
GSS_C_INDEFINITE,
@@ -87,18 +87,18 @@ globus_gsi_gssapi_test_acquire_credential()
&credential,
NULL,
NULL);
-
+
if(major_status != GSS_S_COMPLETE)
{
globus_gsi_gssapi_test_print_error(stderr, major_status, minor_status);
globus_gsi_gssapi_test_print_result(stderr, minor_status);
return GSS_C_NO_CREDENTIAL;
}
-
+
return credential;
}
-void
+void
globus_gsi_gssapi_test_release_credential(
gss_cred_id_t * credential)
{
@@ -110,27 +110,27 @@ globus_gsi_gssapi_test_release_credential(
globus_bool_t
globus_gsi_gssapi_test_authenticate(
int fd,
- globus_bool_t server,
- gss_cred_id_t credential,
- gss_ctx_id_t * context_handle,
- char ** user_id,
+ globus_bool_t server,
+ gss_cred_id_t credential,
+ gss_ctx_id_t * context_handle,
+ char ** user_id,
gss_cred_id_t * delegated_cred)
{
OM_uint32 major_status = GSS_S_COMPLETE;
-
- if (server == GLOBUS_TRUE)
+
+ if (server == GLOBUS_TRUE)
{
- major_status = accept_sec_context(fd,
- user_id,
- context_handle,
- delegated_cred,
- credential);
+ major_status = accept_sec_context(fd,
+ user_id,
+ context_handle,
+ delegated_cred,
+ credential);
}
- else
+ else
{
major_status = init_sec_context(fd,
- credential,
- context_handle);
+ credential,
+ context_handle);
}
return major_status == GSS_S_COMPLETE ? GLOBUS_TRUE : GLOBUS_FALSE;
@@ -144,7 +144,7 @@ test_establish_contexts_with_mechs(
OM_uint32 flags,
OM_uint32 *major_status,
OM_uint32 *minor_status)
-
+
{
int rc = 0;
OM_uint32 init_major_status;
@@ -225,7 +225,7 @@ test_establish_contexts_with_mechs(
}
while (init_major_status == GSS_S_CONTINUE_NEEDED &&
accept_major_status == GSS_S_CONTINUE_NEEDED);
-
+
if (rc != 0)
{
init_fail:
@@ -261,7 +261,7 @@ test_establish_contexts(
OM_uint32 flags,
OM_uint32 *major_status,
OM_uint32 *minor_status)
-
+
{
return test_establish_contexts_with_mechs(
init_context,
@@ -273,18 +273,18 @@ test_establish_contexts(
}
-void
+void
globus_gsi_gssapi_test_cleanup(
gss_ctx_id_t * context_handle,
char * userid,
gss_cred_id_t * delegated_cred)
{
OM_uint32 minor_status;
-
+
free(userid);
-
+
gss_delete_sec_context(&minor_status, context_handle, GSS_C_NO_BUFFER);
-
+
if (delegated_cred != NULL)
{
gss_release_cred(&minor_status, delegated_cred);
@@ -321,11 +321,11 @@ globus_gsi_gssapi_test_export_context(
__LINE__);
gss_release_buffer(&minor_status, &export_token);
result = GLOBUS_FALSE;
- goto exit;
+ goto exit;
}
gss_release_buffer(&minor_status, &export_token);
-
+
exit:
return result;
}
@@ -346,7 +346,7 @@ globus_gsi_gssapi_test_import_context(
import_token.value = malloc(import_token.length);
fread(import_token.value, import_token.length, 1, context_file);
-
+
major_status = gss_import_sec_context(
&minor_status,
(gss_buffer_t) & import_token,
@@ -360,9 +360,9 @@ globus_gsi_gssapi_test_import_context(
result = GLOBUS_FALSE;
goto exit;
}
-
+
gss_release_buffer(&minor_status, &import_token);
-
+
exit:
return result;
@@ -379,12 +379,12 @@ globus_gsi_gssapi_test_send_hello(
static char * hello = "HelloHello";
gss_buffer_desc send_token = GSS_C_EMPTY_BUFFER;
gss_buffer_desc input_token;
- long rc;
+ long rc = 0;
long written = 0;
-
+
input_token.length = 11;
input_token.value = hello;
-
+
major_status = gss_wrap(&minor_status,
context,
0,
@@ -392,7 +392,7 @@ globus_gsi_gssapi_test_send_hello(
(gss_buffer_t) &input_token,
NULL,
(gss_buffer_t) &send_token);
-
+
if(GSS_ERROR(major_status))
{
globus_gsi_gssapi_test_print_error(
@@ -412,10 +412,10 @@ globus_gsi_gssapi_test_send_hello(
}
/*printf("Wrote %d out of %d bytes\n", written, send_token.length); */
-
+
gss_release_buffer(&minor_status, &send_token);
-
+
exit:
return result;
}
@@ -432,7 +432,7 @@ globus_gsi_gssapi_test_receive_hello(
long rc;
gss_buffer_desc recv_token = GSS_C_EMPTY_BUFFER;
gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
-
+
while((rc = recv(fd,&buffer[recv_token.length],128,0)) > 0 &&
(recv_token.length += rc));
@@ -444,7 +444,7 @@ globus_gsi_gssapi_test_receive_hello(
}
/* printf("Read %d bytes\n", recv_token.length); */
-
+
recv_token.value = buffer;
major_status = gss_unwrap(&minor_status,
@@ -466,7 +466,7 @@ globus_gsi_gssapi_test_receive_hello(
result = GLOBUS_FALSE;
}
- gss_release_buffer(&minor_status, &output_token);
+ gss_release_buffer(&minor_status, &output_token);
exit:
return result;
@@ -483,11 +483,11 @@ globus_gsi_gssapi_test_dump_cert_chain(
globus_bool_t result = GLOBUS_TRUE;
FILE * dump_file;
gss_OID_desc cert_chain_oid =
- {11, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01\x01\x08"};
+ {11, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01\x01\x08"};
gss_buffer_set_t cert_chain_buffers;
X509 * cert;
const unsigned char * tmp_ptr;
-
+
dump_file = fopen(filename,"w");
if(dump_file == NULL)
@@ -526,7 +526,7 @@ globus_gsi_gssapi_test_dump_cert_chain(
&cert_chain_buffers);
goto exit;
}
-
+
X509_print_fp(dump_file,
cert);
X509_free(cert);
@@ -539,7 +539,7 @@ globus_gsi_gssapi_test_dump_cert_chain(
{
fclose(dump_file);
}
-
+
return result;
}
@@ -562,20 +562,20 @@ get_token(
if(n_read < 0)
{
if(errno == EINTR)
- {
+ {
continue;
}
else
- {
+ {
return errno;
}
}
else
- {
+ {
num_read += n_read;
}
}
-
+
/* decode the token length from network byte order: 4 byte, big endian */
*token_length = (((size_t) token_length_buffer[0]) << 24) & 0xffff;
@@ -588,7 +588,7 @@ get_token(
/* token too large */
return 1;
}
-
+
*token = malloc(*token_length);
if(*token == NULL)
@@ -607,20 +607,20 @@ get_token(
if(n_read < 0)
{
if(errno == EINTR)
- {
+ {
continue;
}
else
- {
+ {
return errno;
}
}
else
- {
+ {
num_read += n_read;
}
}
-
+
return 0;
}
@@ -649,20 +649,20 @@ put_token(
if(n_written < 0)
{
if(errno == EINTR)
- {
+ {
continue;
}
else
- {
+ {
return errno;
}
}
else
- {
+ {
num_written += n_written;
}
}
-
+
num_written = 0;
while(num_written < token_length)
@@ -673,16 +673,16 @@ put_token(
if(n_written < 0)
{
if(errno == EINTR)
- {
+ {
continue;
}
else
- {
+ {
return errno;
}
}
else
- {
+ {
num_written += n_written;
}
}
@@ -710,7 +710,7 @@ accept_sec_context(
gss_buffer_desc name_buffer;
gss_OID mech_type = GSS_C_NO_OID;
OM_uint32 time_ret;
-
+
if(credential == GSS_C_NO_CREDENTIAL)
{
globus_libc_printf("Failed to acquire credentials\n");
@@ -740,9 +740,9 @@ accept_sec_context(
&time_ret,
delegated_cred);
- if(major_status != GSS_S_COMPLETE &&
- major_status != GSS_S_CONTINUE_NEEDED)
- {
+ if(major_status != GSS_S_COMPLETE &&
+ major_status != GSS_S_CONTINUE_NEEDED)
+ {
char * error_string = NULL;
globus_object_t * error_obj = NULL;
@@ -751,8 +751,8 @@ accept_sec_context(
fprintf(stderr, "ERROR CHAIN:\n%s\n", error_string);
free(error_string);
globus_object_free(error_obj);
- abort();
- }
+ abort();
+ }
if(output_token.length != 0)
{
@@ -764,7 +764,7 @@ accept_sec_context(
major_status =
GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE;
}
-
+
gss_release_buffer(&minor_status2,
&output_token);
}
@@ -799,9 +799,9 @@ accept_sec_context(
/* authentication succeeded, figure out who it is */
major_status = gss_display_name(&minor_status,
- client_name,
- &name_buffer,
- NULL);
+ client_name,
+ &name_buffer,
+ NULL);
*name = (char *)name_buffer.value;
@@ -817,50 +817,50 @@ init_sec_context(
gss_cred_id_t credential,
gss_ctx_id_t * context)
{
- OM_uint32 minor_status2 = 0;
- OM_uint32 minor_status = 0;
- OM_uint32 major_status = GSS_S_COMPLETE;
- OM_uint32 req_flags = GSS_C_MUTUAL_FLAG|GSS_C_DELEG_FLAG;
- OM_uint32 ret_flags = 0;
- int token_status = 0;
- gss_name_t target_name = GSS_C_NO_NAME;
- globus_bool_t context_established = GLOBUS_FALSE;
- gss_OID * actual_mech_type = NULL;
- OM_uint32 time_ret;
- gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
- gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
+ OM_uint32 minor_status2 = 0;
+ OM_uint32 minor_status = 0;
+ OM_uint32 major_status = GSS_S_COMPLETE;
+ OM_uint32 req_flags = GSS_C_MUTUAL_FLAG|GSS_C_DELEG_FLAG;
+ OM_uint32 ret_flags = 0;
+ int token_status = 0;
+ gss_name_t target_name = GSS_C_NO_NAME;
+ globus_bool_t context_established = GLOBUS_FALSE;
+ gss_OID * actual_mech_type = NULL;
+ OM_uint32 time_ret;
+ gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
+ gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
major_status = gss_inquire_cred(&minor_status,
- credential,
- &target_name,
- NULL,
- NULL,
- NULL);
+ credential,
+ &target_name,
+ NULL,
+ NULL,
+ NULL);
if(major_status != GSS_S_COMPLETE)
{
- globus_libc_printf("Failed to determine my name\n");
- return 1;
+ globus_libc_printf("Failed to determine my name\n");
+ return 1;
}
while(!context_established)
{
- major_status = gss_init_sec_context(&minor_status,
- credential,
- context,
- target_name,
- GSS_C_NO_OID, /*mech_type*/
- req_flags,
- 0, /* default time */
- GSS_C_NO_CHANNEL_BINDINGS,
- &input_token,
- actual_mech_type,
- &output_token,
- &ret_flags,
- &time_ret);
- if(major_status != GSS_S_COMPLETE &&
- major_status != GSS_S_CONTINUE_NEEDED)
- {
+ major_status = gss_init_sec_context(&minor_status,
+ credential,
+ context,
+ target_name,
+ GSS_C_NO_OID, /*mech_type*/
+ req_flags,
+ 0, /* default time */
+ GSS_C_NO_CHANNEL_BINDINGS,
+ &input_token,
+ actual_mech_type,
+ &output_token,
+ &ret_flags,
+ &time_ret);
+ if(major_status != GSS_S_COMPLETE &&
+ major_status != GSS_S_CONTINUE_NEEDED)
+ {
char * error_string = NULL;
globus_object_t * error_obj = NULL;
@@ -869,61 +869,61 @@ init_sec_context(
fprintf(stderr, "ERROR CHAIN:\n%s\n", error_string);
free(error_string);
globus_object_free(error_obj);
- abort();
- }
- /* free any token we've just processed */
- if(input_token.length > 0)
- {
- gss_release_buffer(&minor_status2,
+ abort();
+ }
+ /* free any token we've just processed */
+ if(input_token.length > 0)
+ {
+ gss_release_buffer(&minor_status2,
&input_token);
- }
-
- /* and send any new token to the server */
- if(output_token.length != 0)
- {
- token_status = put_token(client_fd,
- output_token.value,
- output_token.length);
- if(token_status != 0)
- {
- major_status =
- GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE;
- }
+ }
+
+ /* and send any new token to the server */
+ if(output_token.length != 0)
+ {
+ token_status = put_token(client_fd,
+ output_token.value,
+ output_token.length);
+ if(token_status != 0)
+ {
+ major_status =
+ GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE;
+ }
gss_release_buffer(&minor_status,
&output_token);
- }
-
- if (GSS_ERROR(major_status))
- {
- printf(" Failed to establish security context (init).\n");
+ }
+
+ if (GSS_ERROR(major_status))
+ {
+ printf(" Failed to establish security context (init).\n");
globus_gsi_gssapi_test_print_error(
stderr, major_status, minor_status);
- if (*context != GSS_C_NO_CONTEXT)
- {
- gss_delete_sec_context(&minor_status2,
- context,
- GSS_C_NO_BUFFER);
- break;
- }
- }
-
- if(major_status & GSS_S_CONTINUE_NEEDED)
- {
- token_status = get_token(client_fd,
- (unsigned char **) &input_token.value,
- &input_token.length);
- if(token_status != 0)
- {
- major_status =
- GSS_S_DEFECTIVE_TOKEN | GSS_S_CALL_INACCESSIBLE_READ;
- break;
- }
- }
- else
- {
- context_established = 1;
- }
+ if (*context != GSS_C_NO_CONTEXT)
+ {
+ gss_delete_sec_context(&minor_status2,
+ context,
+ GSS_C_NO_BUFFER);
+ break;
+ }
+ }
+
+ if(major_status & GSS_S_CONTINUE_NEEDED)
+ {
+ token_status = get_token(client_fd,
+ (unsigned char **) &input_token.value,
+ &input_token.length);
+ if(token_status != 0)
+ {
+ major_status =
+ GSS_S_DEFECTIVE_TOKEN | GSS_S_CALL_INACCESSIBLE_READ;
+ break;
+ }
+ }
+ else
+ {
+ context_established = 1;
+ }
} /* while() */
if (target_name != GSS_C_NO_NAME)
diff --git a/gsi/gssapi/source/test/indicate_mechs_test.c b/gsi/gssapi/source/test/indicate_mechs_test.c
index 2cd888e443..a6bf4489ed 100644
--- a/gsi/gssapi/source/test/indicate_mechs_test.c
+++ b/gsi/gssapi/source/test/indicate_mechs_test.c
@@ -69,7 +69,7 @@ indicate_mechs_test(void)
for (i = 0; i < oids->count; i++)
{
- static gss_OID_desc gssapi_mech_gsi =
+ static gss_OID_desc gssapi_mech_gsi =
{9, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01"};
if (oids->elements[i].length == gssapi_mech_gsi.length &&
memcmp(oids->elements[i].elements,
@@ -105,8 +105,8 @@ indicate_mechs_v2_test(void)
OM_uint32 major_status = 0;
OM_uint32 minor_status = 0;
int i;
- static gss_OID_desc gssapi_mech_gsi =
- {10, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01\x01"};
+ static gss_OID_desc gssapi_mech_gsi =
+ {10, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01\x01"};
if (OPENSSL_VERSION_NUMBER < 0x10001000L)
{
@@ -150,7 +150,7 @@ indicate_mechs_v2_test(void)
int main()
{
- int i, rc = 0, failed = 0;
+ int i, rc = 0;
globus_module_descriptor_t *modules[] =
{
GLOBUS_COMMON_MODULE,
@@ -189,7 +189,6 @@ int main()
}
else
{
- failed++;
format = "not ok %d - %s\n";
}
diff --git a/gsi/gssapi/source/test/release_name_test.c b/gsi/gssapi/source/test/release_name_test.c
index 5a30a43f43..60b203fc99 100644
--- a/gsi/gssapi/source/test/release_name_test.c
+++ b/gsi/gssapi/source/test/release_name_test.c
@@ -36,7 +36,7 @@ release_bad_params(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NT_HOSTBASED_SERVICE;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -90,7 +90,7 @@ release_username(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NO_OID;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -127,7 +127,7 @@ release_anonymous(void)
name_tok.value = NULL;
name_tok.length = 0;
name_type = GSS_C_NT_ANONYMOUS;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -166,7 +166,7 @@ release_hostbase_service(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NT_HOSTBASED_SERVICE;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -205,7 +205,7 @@ release_host_ip(void)
name_tok.value = subject;
name_tok.length = strlen(subject) + 1;
name_type = GSS_C_NT_HOSTBASED_SERVICE;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -258,7 +258,7 @@ release_x509(void)
for (i = 0; i < SIZEOF_ARRAY(test_certs); i++)
{
char * test_cert;
-
+
test_cert = globus_common_create_string("%s/%s",
test_cert_dir, test_certs[i]);
@@ -290,7 +290,7 @@ release_x509(void)
name_tok.value = x509;
name_tok.length = sizeof(x509);
name_type = GLOBUS_GSS_C_NT_X509;
-
+
major_status = gss_import_name(&minor_status,
&name_tok,
name_type,
@@ -326,7 +326,7 @@ release_x509(void)
int main()
{
- int i, rc = 0, failed = 0;
+ int i, rc = 0;
globus_module_descriptor_t *modules[] =
{
GLOBUS_COMMON_MODULE,
@@ -356,10 +356,6 @@ int main()
{
rc = (*(tests[i].func))();
- if (rc != 0)
- {
- failed++;
- }
printf("%s %s\n", rc == 0 ? "ok" : "not ok", tests[i].name);
}
diff --git a/gsi/openssl_module/source/configure.ac b/gsi/openssl_module/source/configure.ac
index 9018db9484..920ed91d68 100644
--- a/gsi/openssl_module/source/configure.ac
+++ b/gsi/openssl_module/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_openssl_module],[5.2],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_openssl_module],[5.3],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/openssl_module/source/library/globus_openssl.c b/gsi/openssl_module/source/library/globus_openssl.c
index 4393432c4d..510549ab23 100644
--- a/gsi/openssl_module/source/library/globus_openssl.c
+++ b/gsi/openssl_module/source/library/globus_openssl.c
@@ -38,7 +38,7 @@ globus_l_openssl_deactivate(void);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static unsigned long
globus_l_openssl_thread_id(void);
-
+
static void
globus_l_openssl_locking_cb(
int mode,
@@ -71,9 +71,8 @@ globus_l_openssl_activate(void)
{
int pci_NID;
int pci_old_NID;
- X509V3_EXT_METHOD * pci_x509v3_ext_meth = NULL;
X509V3_EXT_METHOD * pci_old_x509v3_ext_meth = NULL;
-
+
SSL_library_init();
globus_module_activate(GLOBUS_COMMON_MODULE);
globus_module_activate(GLOBUS_GSI_OPENSSL_ERROR_MODULE);
@@ -161,7 +160,9 @@ static
int
globus_l_openssl_deactivate(void)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int i;
+#endif
OBJ_cleanup();
diff --git a/gsi/proxy/proxy_core/source/configure.ac b/gsi/proxy/proxy_core/source/configure.ac
index cc2a4a2f66..04aaa11dbf 100644
--- a/gsi/proxy/proxy_core/source/configure.ac
+++ b/gsi/proxy/proxy_core/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gsi_proxy_core],[9.9],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gsi_proxy_core],[9.10],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/proxy/proxy_core/source/library/globus_gsi_proxy.c b/gsi/proxy/proxy_core/source/library/globus_gsi_proxy.c
index 0a4878436e..b07c1fecd7 100644
--- a/gsi/proxy/proxy_core/source/library/globus_gsi_proxy.c
+++ b/gsi/proxy/proxy_core/source/library/globus_gsi_proxy.c
@@ -73,7 +73,7 @@ globus_l_gsi_proxy_determine_type(
/**
* Module descriptor static initializer.
*/
-globus_module_descriptor_t globus_i_gsi_proxy_module =
+globus_module_descriptor_t globus_i_gsi_proxy_module =
{
"globus_gsi_proxy",
globus_l_gsi_proxy_activate,
@@ -98,7 +98,7 @@ globus_l_gsi_proxy_activate(void)
/* set the debug level */
tmpstring = globus_module_getenv("GLOBUS_GSI_PROXY_DEBUG_LEVEL");
-
+
if(tmpstring != GLOBUS_NULL)
{
globus_i_gsi_proxy_debug_level = atoi(tmpstring);
@@ -109,7 +109,7 @@ globus_l_gsi_proxy_activate(void)
}
}
- /* set the location for the debugging for the
+ /* set the location for the debugging for the
* debugging output (file or stderr)
*/
tmpstring = globus_module_getenv("GLOBUS_GSI_PROXY_DEBUG_FILE");
@@ -151,7 +151,7 @@ globus_l_gsi_proxy_activate(void)
{
goto exit;
}
-
+
result = globus_module_activate(GLOBUS_GSI_CREDENTIAL_MODULE);
if(result != GLOBUS_SUCCESS)
{
@@ -192,19 +192,19 @@ globus_l_gsi_proxy_deactivate(void)
/* globus_l_gsi_proxy_deactivate() */
#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
-
+
/**
* @brief Create a proxy credential request
* @ingroup globus_gsi_proxy_operations
* @details
- * This function creates a proxy credential request, an unsigned
+ * This function creates a proxy credential request, an unsigned
* certificate and the corresponding private key, based on the handle
* that is passed in.
*
* The public part of the request is written to the BIO supplied in
* the output_bio parameter. After the request is written, the
* PROXYCERTINFO extension contained in the handle is written
- * to the BIO.
+ * to the BIO.
*
* The proxy handle is updated with the private key.
*
@@ -213,7 +213,7 @@ globus_l_gsi_proxy_deactivate(void)
* @param[out] output_bio
* A BIO to write the resulting request structure to.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -231,7 +231,7 @@ globus_gsi_proxy_create_req(
int rc = 0;
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(handle == NULL)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -275,7 +275,7 @@ globus_gsi_proxy_create_req(
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
- GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
+ GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
(_PCSL("Couldn't generate RSA key pair for proxy handle")));
goto exit;
}
@@ -285,7 +285,7 @@ globus_gsi_proxy_create_req(
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
- GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
+ GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
(_PCSL("Couldn't generate RSA key pair for proxy handle")));
goto exit;
}
@@ -294,7 +294,7 @@ globus_gsi_proxy_create_req(
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
- GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
+ GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
(_PCSL("Couldn't generate RSA key pair for proxy handle")));
goto exit;
}
@@ -303,7 +303,7 @@ globus_gsi_proxy_create_req(
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
- GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
+ GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
(_PCSL("Couldn't generate RSA key pair for proxy handle")));
goto exit;
}
@@ -317,7 +317,7 @@ globus_gsi_proxy_create_req(
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
- GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
+ GLOBUS_GSI_PROXY_ERROR_WITH_PRIVATE_KEY,
(_PCSL("Couldn't generate RSA key pair for proxy handle")));
goto exit;
}
@@ -361,7 +361,7 @@ globus_gsi_proxy_create_req(
}
req_name_entry = X509_NAME_ENTRY_create_by_NID(
- NULL,
+ NULL,
NID_commonName,
V_ASN1_APP_CHOOSE,
(unsigned char *) "NULL SUBJECT NAME ENTRY",
@@ -398,7 +398,7 @@ globus_gsi_proxy_create_req(
X509_REQ_set_subject_name(handle->req, req_name);
X509_NAME_free(req_name);
req_name = NULL;
-
+
if(GLOBUS_GSI_CERT_UTILS_IS_GSI_3_PROXY(handle->type))
{
pci_NID = OBJ_txt2nid(PROXYCERTINFO_OLD_OID);
@@ -422,7 +422,7 @@ globus_gsi_proxy_create_req(
if (ext_method->i2d)
{
-
+
length = ext_method->i2d(handle->proxy_cert_info, NULL);
if(length < 0)
{
@@ -433,7 +433,7 @@ globus_gsi_proxy_create_req(
" to DER encoded form")));
goto error_exit;
}
-
+
data = malloc(length);
if(!data)
@@ -443,9 +443,9 @@ globus_gsi_proxy_create_req(
}
der_data = data;
-
+
length = ext_method->i2d(handle->proxy_cert_info, &der_data);
-
+
if(length < 0)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -458,7 +458,7 @@ globus_gsi_proxy_create_req(
}
ext_data = ASN1_OCTET_STRING_new();
-
+
if(!ASN1_OCTET_STRING_set(ext_data, data, length))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -468,11 +468,11 @@ globus_gsi_proxy_create_req(
" to DER encoded form")));
ASN1_OCTET_STRING_free(ext_data);
free(data);
- goto error_exit;
+ goto error_exit;
}
free(data);
-
+
pci_ext = X509_EXTENSION_create_by_NID(NULL,
pci_NID,
1,
@@ -486,7 +486,7 @@ globus_gsi_proxy_create_req(
ASN1_OCTET_STRING_free(ext_data);
goto error_exit;
}
-
+
ASN1_OCTET_STRING_free(ext_data);
}
@@ -548,7 +548,7 @@ globus_gsi_proxy_create_req(
}
memcpy(
policy,
- ASN1_STRING_data(handle->proxy_cert_info->proxyPolicy->policy),
+ ASN1_STRING_get0_data(handle->proxy_cert_info->proxyPolicy->policy),
policy_len);
policy[policy_len] = '\0';
tmp = globus_common_create_string("%s,policy:text:%s",
@@ -593,7 +593,7 @@ globus_gsi_proxy_create_req(
GLOBUS_I_GSI_PROXY_DEBUG_PRINT_PCI(3, handle->proxy_cert_info);
GLOBUS_I_GSI_PROXY_DEBUG_PRINT(3, "****** END PROXYCERTINFO ******\n");
}
-
+
if (!X509_REQ_sign(handle->req, handle->proxy_key,
handle->attrs->signing_algorithm
? handle->attrs->signing_algorithm
@@ -665,7 +665,7 @@ globus_gsi_proxy_create_req(
* @param[in] input_bio
* A BIO to read a request structure from.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -676,7 +676,7 @@ globus_gsi_proxy_inquire_req(
globus_result_t result = GLOBUS_SUCCESS;
PROXY_POLICY * policy = NULL;
ASN1_OBJECT * policy_lang = NULL;
- ASN1_OBJECT * extension_oid = NULL;
+ const ASN1_OBJECT * extension_oid = NULL;
int policy_nid = NID_undef;
int pci_NID = NID_undef;
int pci_old_NID = NID_undef;
@@ -684,7 +684,7 @@ globus_gsi_proxy_inquire_req(
int i = 0;
STACK_OF(X509_EXTENSION) * req_extensions = NULL;
X509_EXTENSION * extension = NULL;
-
+
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
if(handle == NULL)
@@ -725,13 +725,13 @@ globus_gsi_proxy_inquire_req(
pci_NID = OBJ_txt2nid(PROXYCERTINFO_OID);
pci_old_NID = OBJ_txt2nid(PROXYCERTINFO_OLD_OID);
-
+
for(i=0;iproxy_cert_info)
@@ -752,7 +752,7 @@ globus_gsi_proxy_inquire_req(
break;
}
}
-
+
if(handle->proxy_cert_info != NULL)
{
if((policy = handle->proxy_cert_info->proxyPolicy) == NULL)
@@ -763,7 +763,7 @@ globus_gsi_proxy_inquire_req(
(_PCSL("Can't get policy from PROXYCERTINFO extension")));
goto done;
}
-
+
if((policy_lang = policy->policyLanguage) == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -773,11 +773,11 @@ globus_gsi_proxy_inquire_req(
" PROXYCERTINFO extension")));
goto done;
}
-
+
policy_nid = OBJ_obj2nid(policy_lang);
if(nid == pci_old_NID)
- {
+ {
if(policy_nid == OBJ_txt2nid(IMPERSONATION_PROXY_OID))
{
handle->type=
@@ -843,7 +843,7 @@ globus_gsi_proxy_inquire_req(
{
sk_X509_EXTENSION_pop_free(req_extensions, X509_EXTENSION_free);
}
-
+
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
}
@@ -863,7 +863,7 @@ globus_gsi_proxy_inquire_req(
* A GSI Proxy handle to use for the signing operation.
* @param[in] issuer_credential
* The credential structure to be used for signing the proxy
- * certificate.
+ * certificate.
* @param[in] peer_credential
* The credential structure that contains the certificate to
* be resigned.
@@ -871,7 +871,7 @@ globus_gsi_proxy_inquire_req(
* A credential structure that upon return will contain the resigned
* certificate and associated certificate chain.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -887,9 +887,9 @@ globus_gsi_proxy_resign_cert(
EVP_PKEY * peer_pubkey = NULL;
X509 * new_pc = NULL;
STACK_OF(X509) * issuer_cert_chain = NULL;
-
+
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(handle == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -928,7 +928,7 @@ globus_gsi_proxy_resign_cert(
__func__));
goto done;
}
-
+
result = globus_gsi_cred_get_cert(peer_credential, &peer_cert);
if(result != GLOBUS_SUCCESS)
{
@@ -980,7 +980,7 @@ globus_gsi_proxy_resign_cert(
result = globus_gsi_cred_get_cert_chain(issuer_credential,
&issuer_cert_chain);
-
+
if(result != GLOBUS_SUCCESS)
{
GLOBUS_GSI_PROXY_ERROR_CHAIN_RESULT(
@@ -992,8 +992,8 @@ globus_gsi_proxy_resign_cert(
if(issuer_cert_chain == NULL)
{
issuer_cert_chain = sk_X509_new_null();
- }
-
+ }
+
result = globus_gsi_cred_get_cert(issuer_credential, &issuer_cert);
if(result != GLOBUS_SUCCESS)
@@ -1006,7 +1006,7 @@ globus_gsi_proxy_resign_cert(
sk_X509_unshift(issuer_cert_chain, issuer_cert);
issuer_cert = NULL;
-
+
result = globus_gsi_cred_set_cert_chain(*resigned_credential,
issuer_cert_chain);
@@ -1055,11 +1055,11 @@ globus_gsi_proxy_resign_cert(
* A GSI Proxy handle to use for the signing operation.
* @param[in] issuer_credential
* The credential structure to be used for signing the proxy
- * certificate.
+ * certificate.
* @param[out] output_bio
* A BIO to write the resulting certificate to.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -1072,9 +1072,9 @@ globus_gsi_proxy_sign_req(
EVP_PKEY * req_pubkey = NULL;
globus_result_t result = GLOBUS_SUCCESS;
int res;
-
+
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(handle == NULL || issuer_credential == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1083,7 +1083,7 @@ globus_gsi_proxy_sign_req(
(_PCSL("NULL handle passed to function: %s"), __func__));
goto done;
}
-
+
if(output_bio == NULL)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -1140,14 +1140,14 @@ globus_gsi_proxy_sign_req(
if(new_pc)
{
- X509_free(new_pc);
+ X509_free(new_pc);
}
-
+
if(req_pubkey)
{
EVP_PKEY_free(req_pubkey);
}
-
+
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
}
@@ -1169,6 +1169,7 @@ globus_l_gsi_proxy_sign_key(
X509 * issuer_cert = NULL;
X509_EXTENSION * pci_ext = NULL;
X509_EXTENSION * extension;
+ const X509_EXTENSION * extension_c;
const EVP_MD * issuer_digest;
int position;
EVP_PKEY * issuer_pkey = NULL;
@@ -1176,9 +1177,9 @@ globus_l_gsi_proxy_sign_key(
ASN1_INTEGER * serial_number = NULL;
globus_gsi_cert_utils_cert_type_t proxy_type = 0;
globus_gsi_cert_utils_cert_type_t old_type = 0;
-
+
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(handle == NULL || issuer_credential == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1187,7 +1188,7 @@ globus_l_gsi_proxy_sign_key(
(_PCSL("NULL handle passed to function: %s"), __func__));
goto done;
}
-
+
if(signed_cert == NULL)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -1217,7 +1218,7 @@ globus_l_gsi_proxy_sign_key(
}
*signed_cert = NULL;
-
+
result = globus_gsi_cred_get_cert(issuer_credential, &issuer_cert);
if(result != GLOBUS_SUCCESS)
{
@@ -1274,7 +1275,7 @@ globus_l_gsi_proxy_sign_key(
{
pci_NID = OBJ_txt2nid(PROXYCERTINFO_OID);
}
-
+
if(pci_NID != NID_undef)
{
const EVP_MD * sha1 = EVP_sha1();
@@ -1287,8 +1288,8 @@ globus_l_gsi_proxy_sign_key(
ASN1_digest((i2d_of_void *) i2d_PUBKEY,sha1,(char *) public_key,md,&len);
- sub_hash = md[0] + (md[1] + (md[2] + (md[3] >> 1) * 256) * 256) * 256;
-
+ sub_hash = md[0] + (md[1] + (md[2] + (md[3] >> 1) * 256) * 256) * 256;
+
if(handle->common_name)
{
common_name = strdup(handle->common_name);
@@ -1300,7 +1301,7 @@ globus_l_gsi_proxy_sign_key(
}
}
else
- {
+ {
common_name = malloc(sizeof(long)*4 + 1);
if(!common_name)
@@ -1310,17 +1311,17 @@ globus_l_gsi_proxy_sign_key(
goto done;
}
- sprintf(common_name, "%ld", sub_hash);
+ sprintf(common_name, "%ld", sub_hash);
}
serial_number = ASN1_INTEGER_new();
ASN1_INTEGER_set(serial_number, sub_hash);
-
+
if(ext_method->i2d)
{
- pci_DER_length = ext_method->i2d(handle->proxy_cert_info,
+ pci_DER_length = ext_method->i2d(handle->proxy_cert_info,
NULL);
if(pci_DER_length < 0)
{
@@ -1331,7 +1332,7 @@ globus_l_gsi_proxy_sign_key(
" to DER encoded form")));
goto done;
}
-
+
pci_DER = malloc(pci_DER_length);
if(!pci_DER)
@@ -1339,7 +1340,7 @@ globus_l_gsi_proxy_sign_key(
GLOBUS_GSI_PROXY_MALLOC_ERROR(pci_DER_length);
goto done;
}
-
+
mod_pci_DER = pci_DER;
pci_DER_length = ext_method->i2d(handle->proxy_cert_info,
(unsigned char **) &mod_pci_DER);
@@ -1352,7 +1353,7 @@ globus_l_gsi_proxy_sign_key(
" to DER encoded form")));
goto done;
}
-
+
pci_DER_string = ASN1_OCTET_STRING_new();
if(pci_DER_string == NULL)
{
@@ -1363,13 +1364,12 @@ globus_l_gsi_proxy_sign_key(
" of a PROXYCERTINFO struct")));
goto done;
}
-
- pci_DER_string->data = pci_DER;
- pci_DER_string->length = pci_DER_length;
-
+
+ ASN1_OCTET_STRING_set(pci_DER_string, pci_DER, pci_DER_length);
+
pci_ext = X509_EXTENSION_create_by_NID(
- &pci_ext,
- pci_NID,
+ &pci_ext,
+ pci_NID,
1,
pci_DER_string);
@@ -1442,7 +1442,7 @@ globus_l_gsi_proxy_sign_key(
}
memcpy(
policy,
- ASN1_STRING_data(handle->proxy_cert_info->proxyPolicy->policy),
+ ASN1_STRING_get0_data(handle->proxy_cert_info->proxyPolicy->policy),
policy_len);
policy[policy_len] = '\0';
tmp = globus_common_create_string("%s,policy:text:%s",
@@ -1474,7 +1474,7 @@ globus_l_gsi_proxy_sign_key(
X509_EXTENSION_set_critical(pci_ext, 1);
}
}
-
+
if(!X509_add_ext(*signed_cert, pci_ext, 0))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1507,15 +1507,15 @@ globus_l_gsi_proxy_sign_key(
unsigned char * mod_ku_DER;
int ku_DER_length;
- if(!(extension = X509_get_ext(issuer_cert, position)))
+ if(!(extension_c = X509_get_ext(issuer_cert, position)))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_PROXY_ERROR_WITH_X509_EXTENSIONS,
(_PCSL("Couldn't get keyUsage extension from issuer cert")));
- goto done;
+ goto done;
}
-
+
if(!(usage = X509_get_ext_d2i(issuer_cert, NID_key_usage, NULL, NULL)))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1527,10 +1527,10 @@ globus_l_gsi_proxy_sign_key(
}
/* clear bits specified in draft */
-
+
ASN1_BIT_STRING_set_bit(usage, 1, 0); /* Non Repudiation */
ASN1_BIT_STRING_set_bit(usage, 5, 0); /* Certificate Sign */
-
+
ku_DER_length = i2d_ASN1_BIT_STRING(usage,
NULL);
if(ku_DER_length < 0)
@@ -1543,7 +1543,7 @@ globus_l_gsi_proxy_sign_key(
ASN1_BIT_STRING_free(usage);
goto done;
}
-
+
ku_DER = malloc(ku_DER_length);
if(!ku_DER)
@@ -1552,7 +1552,7 @@ globus_l_gsi_proxy_sign_key(
ASN1_BIT_STRING_free(usage);
goto done;
}
-
+
mod_ku_DER = ku_DER;
ku_DER_length = i2d_ASN1_BIT_STRING(usage,
@@ -1569,8 +1569,8 @@ globus_l_gsi_proxy_sign_key(
goto done;
}
- ASN1_BIT_STRING_free(usage);
-
+ ASN1_BIT_STRING_free(usage);
+
ku_DER_string = ASN1_OCTET_STRING_new();
if(ku_DER_string == NULL)
{
@@ -1582,9 +1582,9 @@ globus_l_gsi_proxy_sign_key(
free(ku_DER);
goto done;
}
-
- ku_DER_string->data = ku_DER;
- ku_DER_string->length = ku_DER_length;
+
+ ASN1_OCTET_STRING_set(ku_DER_string, ku_DER, ku_DER_length);
+ free(ku_DER);
extension = X509_EXTENSION_create_by_NID(
NULL,
@@ -1593,7 +1593,7 @@ globus_l_gsi_proxy_sign_key(
ku_DER_string);
ASN1_OCTET_STRING_free(ku_DER_string);
-
+
if(extension == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1602,7 +1602,7 @@ globus_l_gsi_proxy_sign_key(
(_PCSL("Couldn't create new keyUsage extension")));
goto done;
}
-
+
if(!X509_add_ext(*signed_cert, extension, 0))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1619,16 +1619,16 @@ globus_l_gsi_proxy_sign_key(
if((position =
X509_get_ext_by_NID(issuer_cert, NID_ext_key_usage, -1)) > -1)
{
- if(!(extension = X509_get_ext(issuer_cert, position)))
+ if(!(extension_c = X509_get_ext(issuer_cert, position)))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_PROXY_ERROR_WITH_X509_EXTENSIONS,
(_PCSL("Couldn't get extendedKeyUsage extension form issuer cert")));
- goto done;
+ goto done;
}
- extension = X509_EXTENSION_dup(extension);
+ extension = X509_EXTENSION_dup(extension_c);
if(extension == NULL)
{
@@ -1655,7 +1655,7 @@ globus_l_gsi_proxy_sign_key(
if (handle->extensions != NULL)
{
int index;
-
+
/*
* There doesn't seem to be a function to add a stack of extensions
* to a X509 structure, so we do it iteratively.
@@ -1667,7 +1667,7 @@ globus_l_gsi_proxy_sign_key(
X509_EXTENSION *ext;
ext = sk_X509_EXTENSION_value(handle->extensions, index);
-
+
if(!X509_add_ext(
*signed_cert,
ext,
@@ -1678,7 +1678,7 @@ globus_l_gsi_proxy_sign_key(
GLOBUS_GSI_PROXY_ERROR_WITH_X509_EXTENSIONS,
(_PCSL("Couldn't add X.509 extension to new proxy cert")));
goto done;
- }
+ }
}
}
@@ -1719,8 +1719,8 @@ globus_l_gsi_proxy_sign_key(
goto done;
}
- result = globus_i_gsi_proxy_set_pc_times(*signed_cert, issuer_cert,
- handle->attrs->clock_skew,
+ result = globus_i_gsi_proxy_set_pc_times(*signed_cert, issuer_cert,
+ handle->attrs->clock_skew,
handle->time_valid);
if(result != GLOBUS_SUCCESS)
{
@@ -1729,7 +1729,7 @@ globus_l_gsi_proxy_sign_key(
GLOBUS_GSI_PROXY_ERROR_WITH_X509);
goto done;
}
-
+
if(!X509_set_pubkey(*signed_cert, public_key))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1748,7 +1748,7 @@ globus_l_gsi_proxy_sign_key(
GLOBUS_GSI_PROXY_ERROR_WITH_CREDENTIAL);
goto done;
}
-
+
/* right now if MD5 isn't requested as the signing algorithm,
* we throw an error
*/
@@ -1763,7 +1763,7 @@ globus_l_gsi_proxy_sign_key(
" be used to sign a proxy.")));
goto done;
}
- if (handle->attrs->signing_algorithm != NULL &&
+ if (handle->attrs->signing_algorithm != NULL &&
EVP_MD_type(handle->attrs->signing_algorithm) !=
EVP_MD_type(issuer_digest))
{
@@ -1776,7 +1776,7 @@ globus_l_gsi_proxy_sign_key(
OBJ_nid2sn(EVP_MD_type(issuer_digest))));
goto done;
}
-
+
if(!X509_sign(*signed_cert, issuer_pkey, issuer_digest))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1806,44 +1806,27 @@ globus_l_gsi_proxy_sign_key(
if(result != GLOBUS_SUCCESS && *signed_cert)
{
- X509_free(*signed_cert);
+ X509_free(*signed_cert);
*signed_cert = NULL;
}
-
+
if(pci_NID != NID_undef)
{
if(pci_ext)
{
X509_EXTENSION_free(pci_ext);
}
-
- #ifdef WIN32
- /* In Win32 can't mix library and OpenSSL versions of free */
- /* so pci_DER can't be freed in ASN1_OCTET_STRING_free */
- if(pci_DER_string)
- {
- if(pci_DER)
- {
- free(pci_DER);
- pci_DER = NULL;
- }
- pci_DER_string->data = NULL;
- pci_DER_string->length = 0;
- ASN1_OCTET_STRING_free(pci_DER_string);
- pci_DER_string = NULL;
- }
- #else
-
+
if(pci_DER_string)
{
ASN1_OCTET_STRING_free(pci_DER_string);
}
- else if(pci_DER)
+
+ if(pci_DER)
{
free(pci_DER);
}
- #endif
-
+
if(serial_number)
{
ASN1_INTEGER_free(serial_number);
@@ -1865,9 +1848,9 @@ globus_l_gsi_proxy_sign_key(
* @param issuer
* The issuing credential, used for signing the proxy certificate
* @param proxy_credential
- * The new proxy credential, containing the signed cert,
+ * The new proxy credential, containing the signed cert,
* private key, etc.
- *
+ *
* @return
* GLOBUS_SUCCESS if no error occurred, an error object ID otherwise
*/
@@ -1929,7 +1912,7 @@ globus_gsi_proxy_create_signed(
(_PCSL("Can't create memory BIO for reading and writing")));
goto exit;
}
-
+
result = globus_gsi_proxy_create_req(handle, rw_mem_bio);
if(result != GLOBUS_SUCCESS)
{
@@ -2004,7 +1987,7 @@ globus_gsi_proxy_create_signed(
GLOBUS_GSI_PROXY_ERROR_WITH_HANDLE);
goto exit;
}
-
+
result = globus_gsi_proxy_handle_set_extensions(
inquire_handle,
handle->extensions);
@@ -2052,7 +2035,7 @@ globus_gsi_proxy_create_signed(
++chain_index)
{
X509 * chain_cert =
- sk_X509_value(issuer_cert_chain,
+ sk_X509_value(issuer_cert_chain,
chain_index);
if(!i2d_X509_bio(rw_mem_bio, chain_cert))
{
@@ -2070,8 +2053,8 @@ globus_gsi_proxy_create_signed(
result = globus_gsi_proxy_handle_destroy(inquire_handle);
inquire_handle = NULL;
- result = globus_gsi_proxy_assemble_cred(handle,
- proxy_credential,
+ result = globus_gsi_proxy_assemble_cred(handle,
+ proxy_credential,
rw_mem_bio);
if(result != GLOBUS_SUCCESS)
{
@@ -2170,17 +2153,17 @@ globus_gsi_proxy_assemble_cred(
"DER encoded to internal form")));
goto done;
}
-
+
result = globus_gsi_cred_handle_attrs_init(&cred_handle_attrs);
if(result != GLOBUS_SUCCESS)
{
GLOBUS_GSI_PROXY_ERROR_CHAIN_RESULT(
result,
- GLOBUS_GSI_PROXY_ERROR_WITH_CRED_HANDLE_ATTRS);
+ GLOBUS_GSI_PROXY_ERROR_WITH_CRED_HANDLE_ATTRS);
goto free_signed_cert;
}
- result = globus_gsi_cred_handle_init(proxy_credential,
+ result = globus_gsi_cred_handle_init(proxy_credential,
cred_handle_attrs);
if(result != GLOBUS_SUCCESS)
{
@@ -2231,7 +2214,7 @@ globus_gsi_proxy_assemble_cred(
(_PCSL("Can't read DER encoded X.509 cert from BIO")));
goto free_cred_handle;
}
-
+
sk_X509_push(cert_chain, tmp_cert);
}
@@ -2277,7 +2260,7 @@ globus_gsi_proxy_assemble_cred(
* this could be modified to return more status information
* if required.
*/
-void
+void
globus_i_gsi_proxy_create_private_key_cb(
int num1,
int num2,
@@ -2293,7 +2276,7 @@ globus_i_gsi_proxy_create_private_key_cb(
* Takes the new proxy cert and sets the valid start
* and end times of the cert
*/
-globus_result_t
+globus_result_t
globus_i_gsi_proxy_set_pc_times(
X509 * new_pc,
X509 * issuer_cert,
@@ -2314,9 +2297,9 @@ globus_i_gsi_proxy_set_pc_times(
result,
GLOBUS_GSI_PROXY_INVALID_PARAMETER,
(_PCSL("Overflow in time value")));
- goto exit;
+ goto exit;
}
-
+
/* adjust for the allowable skew */
if(X509_gmtime_adj(X509_get_notBefore(new_pc), (- skew_allowable)) == NULL)
{
@@ -2333,7 +2316,7 @@ globus_i_gsi_proxy_set_pc_times(
if(time_valid == 0 ||
X509_cmp_time(X509_get_notAfter(issuer_cert), & tmp_time) < 0)
{
- if((pc_notAfter =
+ if((pc_notAfter =
ASN1_dup_of(ASN1_UTCTIME, i2d_ASN1_UTCTIME, d2i_ASN1_UTCTIME, X509_get_notAfter(issuer_cert))) == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -2354,7 +2337,7 @@ globus_i_gsi_proxy_set_pc_times(
(_PCSL("Error creating new ASN1_UTCTIME for expiration date "
"of proxy cert")));
}
-
+
if(X509_gmtime_adj(pc_notAfter, ((long) 60 * time_valid)) == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -2364,7 +2347,7 @@ globus_i_gsi_proxy_set_pc_times(
goto free_pc_notafter;
}
}
-
+
if(!X509_set_notAfter(new_pc, pc_notAfter))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -2377,7 +2360,7 @@ globus_i_gsi_proxy_set_pc_times(
result = GLOBUS_SUCCESS;
free_pc_notafter:
-
+
if(pc_notAfter != NULL)
{
ASN1_UTCTIME_free(pc_notAfter);
@@ -2393,7 +2376,7 @@ globus_i_gsi_proxy_set_pc_times(
* Takes the new proxy cert and sets the subject
* based on the subject of the issuer cert
*/
-globus_result_t
+globus_result_t
globus_i_gsi_proxy_set_subject(
X509 * new_pc,
X509 * issuer_cert,
@@ -2414,14 +2397,14 @@ globus_i_gsi_proxy_set_subject(
(_PCSL("Error copying subject name of proxy cert")));
goto done;
}
-
- if((pc_name_entry =
+
+ if((pc_name_entry =
X509_NAME_ENTRY_create_by_NID(& pc_name_entry, NID_commonName,
V_ASN1_APP_CHOOSE,
(unsigned char *) common_name,
-1)) == NULL)
{
-
+
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
result,
GLOBUS_GSI_PROXY_ERROR_WITH_X509,
@@ -2439,7 +2422,7 @@ globus_i_gsi_proxy_set_subject(
(_PCSL("Error setting common name of subject in proxy cert")));
goto free_pc_name_entry;
}
-
+
result = GLOBUS_SUCCESS;
free_pc_name_entry:
@@ -2654,7 +2637,7 @@ globus_l_gsi_proxy_determine_type(
}
}
/* Verify that the selected proxy type is compatible with the issuer's
- * type. Impersonation or EEC can sign anything, otherwise, the type
+ * type. Impersonation or EEC can sign anything, otherwise, the type
* must be the same?
*/
if (((requested_cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) !=
diff --git a/gsi/proxy/proxy_core/source/library/globus_gsi_proxy_handle.c b/gsi/proxy/proxy_core/source/library/globus_gsi_proxy_handle.c
index 0e0ddf0187..0e7e751a20 100644
--- a/gsi/proxy/proxy_core/source/library/globus_gsi_proxy_handle.c
+++ b/gsi/proxy/proxy_core/source/library/globus_gsi_proxy_handle.c
@@ -60,7 +60,7 @@ sk_X509_EXTENSION_deep_copy(
return newe;
}
#endif
-
+
/**
* @brief Initialize a GSI Proxy handle
* @ingroup globus_gsi_proxy_handle
@@ -73,11 +73,11 @@ sk_X509_EXTENSION_deep_copy(
* A pointer to the handle to be initialized. If the
* handle is originally NULL, space is allocated for it.
* Otherwise, the current values of the handle are overwritten.
- *
+ *
* @param[in] handle_attrs
* Initial attributes to be used to create this handle.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_destroy()
@@ -111,7 +111,7 @@ globus_gsi_proxy_handle_init(
goto exit;
}
- handle_i = *handle;
+ handle_i = *handle;
/* initialize the X509 request structure */
if((handle_i->req = X509_REQ_new()) == NULL)
@@ -133,12 +133,12 @@ globus_gsi_proxy_handle_init(
goto free_handle;
}
- ASN1_OBJECT_free(handle_i->proxy_cert_info->proxyPolicy->policyLanguage);
+ ASN1_OBJECT_free(handle_i->proxy_cert_info->proxyPolicy->policyLanguage);
handle_i->proxy_cert_info->proxyPolicy->policyLanguage = NULL;
handle_i->proxy_cert_info->proxyPolicy->policyLanguage = OBJ_dup(
OBJ_nid2obj(NID_id_ppl_inheritAll));
-
+
/* initialize the handle attributes */
if(handle_attrs == NULL)
{
@@ -153,7 +153,7 @@ globus_gsi_proxy_handle_init(
}
else
{
- result = globus_gsi_proxy_handle_attrs_copy(handle_attrs,
+ result = globus_gsi_proxy_handle_attrs_copy(handle_attrs,
&handle_i->attrs);
if(result != GLOBUS_SUCCESS)
{
@@ -170,7 +170,7 @@ globus_gsi_proxy_handle_init(
handle_i->extensions = NULL;
-
+
goto exit;
free_handle:
@@ -196,7 +196,7 @@ globus_gsi_proxy_handle_init(
* @param[in] handle
* The handle to be destroyed.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_init()
@@ -214,13 +214,13 @@ globus_gsi_proxy_handle_destroy(
EVP_PKEY_free(handle->proxy_key);
globus_gsi_proxy_handle_attrs_destroy(handle->attrs);
PROXY_CERT_INFO_EXTENSION_free(handle->proxy_cert_info);
-
+
free(handle->common_name);
if (handle->extensions != NULL)
{
sk_X509_EXTENSION_free(handle->extensions);
}
-
+
/* free the handle struct memory */
free(handle);
handle = NULL;
@@ -245,7 +245,7 @@ globus_gsi_proxy_handle_destroy(
* Parameter used to return the request. It is the users responsibility
* to free the returned request.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_set_req()
@@ -304,7 +304,7 @@ globus_gsi_proxy_handle_get_req(
* @param[in] req
* Request to be copied to handle.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_get_req()
@@ -326,7 +326,7 @@ globus_gsi_proxy_handle_set_req(
(_PCSL("Invalid handle (NULL) passed to function")));
goto exit;
}
-
+
if(handle->req)
{
X509_REQ_free(handle->req);
@@ -345,7 +345,7 @@ globus_gsi_proxy_handle_set_req(
goto exit;
}
}
-
+
exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
@@ -366,7 +366,7 @@ globus_gsi_proxy_handle_set_req(
* Parameter used to return the key. It is the users responsibility to
* free the returned key by calling EVP_PKEY_free().
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_set_private_key()
@@ -391,7 +391,7 @@ globus_gsi_proxy_handle_get_private_key(
(_PCSL("Invalid handle (NULL) passed to function")));
goto exit;
}
-
+
if(!proxy_key)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -422,9 +422,9 @@ globus_gsi_proxy_handle_get_private_key(
(_PCSL("Couldn't convert private key from internal"
"to DER encoded form")));
goto exit;
-
+
}
-
+
der_encoded = malloc(length);
if(!der_encoded)
@@ -445,12 +445,12 @@ globus_gsi_proxy_handle_get_private_key(
(_PCSL("Couldn't convert private key from internal"
"to DER encoded form")));
goto exit;
-
+
}
tmp = der_encoded;
-
- if(!d2i_PrivateKey(EVP_PKEY_id(handle->proxy_key), proxy_key,
+
+ if(!d2i_PrivateKey(EVP_PKEY_id(handle->proxy_key), proxy_key,
(const unsigned char **) &tmp, length))
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -459,14 +459,14 @@ globus_gsi_proxy_handle_get_private_key(
(_PCSL("Error converting DER encoded private key to internal form")));
goto exit;
}
-
+
exit:
if(der_encoded)
{
free(der_encoded);
}
-
+
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
}
@@ -475,14 +475,14 @@ globus_gsi_proxy_handle_get_private_key(
/**
* @brief Set the private key in a GSI Proxy handle
* @details
- * Copies the private key pointed to by proxy_key to the
+ * Copies the private key pointed to by proxy_key to the
* handle.
* @param[in] handle
* The handle for which to set the private key
* @param[in] proxy_key
* Parameter used to pass the key
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_get_private_key()
@@ -510,13 +510,13 @@ globus_gsi_proxy_handle_set_private_key(
EVP_PKEY_free(handle->proxy_key);
handle->proxy_key = NULL;
}
-
+
if (proxy_key != NULL)
{
handle->proxy_key = ASN1_dup_of(
EVP_PKEY, i2d_PrivateKey, d2i_AutoPrivateKey, proxy_key);
-
+
if(handle->proxy_key == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -537,14 +537,14 @@ globus_gsi_proxy_handle_set_private_key(
* @brief Get Proxy Type
* @ingroup globus_gsi_proxy_handle
* @details
- * Determine the type of proxy that will be generated when using this handle.
+ * Determine the type of proxy that will be generated when using this handle.
*
* @param[in] handle
* The handle from which to get the type
* @param[out] type
* Parameter used to return the type.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_set_type()
@@ -596,7 +596,7 @@ globus_gsi_proxy_handle_get_type(
* @param type
* Parameter used to pass the type.
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*
* @see globus_gsi_proxy_handle_set_type()
@@ -687,7 +687,7 @@ globus_gsi_proxy_handle_set_policy(
globus_result_t result = GLOBUS_SUCCESS;
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(handle == NULL)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -696,7 +696,7 @@ globus_gsi_proxy_handle_set_policy(
(_PCSL("NULL handle passed to function: %s"), __func__));
goto exit;
}
-
+
if (handle->proxy_cert_info->proxyPolicy == NULL)
{
handle->proxy_cert_info->proxyPolicy = PROXY_POLICY_new();
@@ -749,7 +749,7 @@ globus_gsi_proxy_handle_set_policy(
* @details
* Get the policy from the GSI Proxy handle.
*
- * This function gets the policy that is being used in the
+ * This function gets the policy that is being used in the
* proxy cert info extension.
*
* @param handle
@@ -817,9 +817,9 @@ globus_gsi_proxy_handle_get_policy(
*policy_length = ASN1_STRING_length(
handle->proxy_cert_info->proxyPolicy->policy);
*policy_data = malloc(*policy_length + 1);
-
+
memcpy(*policy_data,
- ASN1_STRING_data(handle->proxy_cert_info->proxyPolicy->policy),
+ ASN1_STRING_get0_data(handle->proxy_cert_info->proxyPolicy->policy),
*policy_length);
(*policy_data)[*policy_length] = 0;
}
@@ -831,7 +831,7 @@ globus_gsi_proxy_handle_get_policy(
*policy_NID = OBJ_obj2nid(
handle->proxy_cert_info->proxyPolicy->policyLanguage);
-
+
exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
@@ -897,7 +897,7 @@ globus_gsi_proxy_handle_add_extension(
goto exit;
}
}
-
+
sk_X509_EXTENSION_push(handle->extensions,
X509_EXTENSION_dup(ext));
result = GLOBUS_SUCCESS;
@@ -951,7 +951,7 @@ globus_gsi_proxy_handle_set_extensions(
{
sk_X509_EXTENSION_free(handle->extensions);
}
-
+
if (exts == NULL)
{
handle->extensions = NULL;
@@ -962,7 +962,7 @@ globus_gsi_proxy_handle_set_extensions(
exts,
(X509_EXTENSION *(*)(const X509_EXTENSION *)) X509_EXTENSION_dup,
X509_EXTENSION_free);
-
+
if (handle->extensions == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1030,7 +1030,7 @@ globus_gsi_proxy_handle_get_extensions(
(_PCSL("NULL exts passed to function: %s"), __func__));
goto exit;
}
-
+
if (handle->extensions == NULL)
{
*exts = sk_X509_EXTENSION_new_null();
@@ -1039,7 +1039,7 @@ globus_gsi_proxy_handle_get_extensions(
{
*exts = sk_X509_EXTENSION_dup(handle->extensions);
}
-
+
if (*exts == NULL)
{
GLOBUS_GSI_PROXY_OPENSSL_ERROR_RESULT(
@@ -1125,7 +1125,7 @@ globus_gsi_proxy_handle_set_pathlen(
* @details
* Get the path length from the GSI Proxy handle.
*
- * This function gets the path length that is being used in the
+ * This function gets the path length that is being used in the
* proxy cert info extension.
*
* @param handle
@@ -1172,7 +1172,7 @@ globus_gsi_proxy_handle_get_pathlen(
*pathlen = ASN1_INTEGER_get(
handle->proxy_cert_info->pcPathLengthConstraint);
}
-
+
exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
@@ -1189,9 +1189,9 @@ globus_gsi_proxy_handle_get_pathlen(
* The proxy handle to get the expiration date of
* @param time_valid
* expiration date of the proxy handle
- *
+ *
* @result
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -1222,7 +1222,7 @@ globus_gsi_proxy_handle_get_time_valid(
*time_valid = handle->time_valid;
- exit:
+ exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
}
@@ -1238,9 +1238,9 @@ globus_gsi_proxy_handle_get_time_valid(
* The proxy handle to set the expiration date for
* @param time_valid
* desired expiration date of the proxy
- *
+ *
* @result
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
* GLOBUS_SUCCESS
*/
@@ -1250,7 +1250,7 @@ globus_gsi_proxy_handle_set_time_valid(
int time_valid)
{
globus_result_t result = GLOBUS_SUCCESS;
-
+
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
if(handle == NULL)
@@ -1312,7 +1312,7 @@ globus_gsi_proxy_handle_clear_cert_info(
(_PCSL("PROXYCERTINFO could not be initialized")));
goto exit;
}
- ASN1_OBJECT_free(handle->proxy_cert_info->proxyPolicy->policyLanguage);
+ ASN1_OBJECT_free(handle->proxy_cert_info->proxyPolicy->policyLanguage);
handle->proxy_cert_info->proxyPolicy->policyLanguage = NULL;
handle->proxy_cert_info->proxyPolicy->policyLanguage = OBJ_dup(
@@ -1361,7 +1361,7 @@ __asm__(".symver globus_gsi_proxy_handle_get_proxy_cert_info_openssl,"
* Get the proxy cert info extension stored in the GSI Proxy handle.
*
* This function retrieves the proxy cert info extension from the GSI Proxy
- * handle.
+ * handle.
*
* @param handle
* The handle from which to get the proxy cert info extension.
@@ -1386,7 +1386,7 @@ globus_gsi_proxy_handle_get_proxy_cert_info_openssl(
globus_result_t result = GLOBUS_SUCCESS;
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(!handle)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -1406,7 +1406,7 @@ globus_gsi_proxy_handle_get_proxy_cert_info_openssl(
}
if(handle->proxy_cert_info)
- {
+ {
*pci = ASN1_dup_of(PROXY_CERT_INFO_EXTENSION,
i2d_PROXY_CERT_INFO_EXTENSION,
d2i_PROXY_CERT_INFO_EXTENSION,
@@ -1455,7 +1455,7 @@ globus_gsi_proxy_handle_get_proxy_cert_info_proxy_ssl(
goto exit;
}
*pci = NULL;
-
+
if (!handle)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -1570,7 +1570,7 @@ globus_gsi_proxy_handle_set_proxy_cert_info_openssl(
PROXY_CERT_INFO_EXTENSION_free(handle->proxy_cert_info);
handle->proxy_cert_info = NULL;
}
-
+
if(pci)
{
handle->proxy_cert_info = ASN1_dup_of(PROXY_CERT_INFO_EXTENSION,
@@ -1597,7 +1597,7 @@ globus_gsi_proxy_handle_set_proxy_cert_info_openssl(
goto exit;
}
- ASN1_OBJECT_free(handle->proxy_cert_info->proxyPolicy->policyLanguage);
+ ASN1_OBJECT_free(handle->proxy_cert_info->proxyPolicy->policyLanguage);
handle->proxy_cert_info->proxyPolicy->policyLanguage = NULL;
handle->proxy_cert_info->proxyPolicy->policyLanguage = OBJ_dup(
@@ -1637,10 +1637,10 @@ globus_gsi_proxy_handle_set_proxy_cert_info_proxy_ssl(
PROXY_CERT_INFO_EXTENSION_free(handle->proxy_cert_info);
handle->proxy_cert_info = NULL;
}
-
+
if(pci)
{
- PROXY_POLICY pp =
+ PROXY_POLICY pp =
{
.policyLanguage = pci->policy ? pci->policy->policy_language : NULL,
.policy = pci->policy ? pci->policy->policy : NULL,
@@ -1681,9 +1681,9 @@ globus_gsi_proxy_handle_set_proxy_cert_info_proxy_ssl(
* The proxy handle containing the type of signing algorithm used
* @param signing_algorithm
* signing algorithm of the proxy handle
- *
+ *
* @retval
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -1692,7 +1692,7 @@ globus_gsi_proxy_handle_get_signing_algorithm(
const EVP_MD ** signing_algorithm)
{
globus_result_t result = GLOBUS_SUCCESS;
-
+
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
if(!handle)
@@ -1720,7 +1720,7 @@ globus_gsi_proxy_handle_get_signing_algorithm(
result,
GLOBUS_GSI_PROXY_ERROR_WITH_HANDLE_ATTRS);
}
-
+
exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
@@ -1736,9 +1736,9 @@ globus_gsi_proxy_handle_get_signing_algorithm(
* The proxy handle to get the key bits of
* @param key_bits
* key bits of the proxy handle
- *
+ *
* @result
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
* GLOBUS_SUCCESS
*/
@@ -1775,7 +1775,7 @@ globus_gsi_proxy_handle_get_keybits(
result,
GLOBUS_GSI_PROXY_ERROR_WITH_HANDLE_ATTRS);
}
-
+
exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
@@ -1783,7 +1783,7 @@ globus_gsi_proxy_handle_get_keybits(
/**
* @brief Get Init Prime
- * @ingroup globus_gsi_proxy_handle
+ * @ingroup globus_gsi_proxy_handle
* @details
* Get the init prime of the proxy handle
*
@@ -1839,7 +1839,7 @@ globus_gsi_proxy_handle_get_init_prime(
/**
* @brief Get Clock Skew
- * @ingroup globus_gsi_proxy_handle
+ * @ingroup globus_gsi_proxy_handle
* @details
* Get the clock skew of the proxy handle
*
@@ -1895,7 +1895,7 @@ globus_gsi_proxy_handle_get_clock_skew_allowable(
/**
* @brief Get Callback for Creating Keys
- * @ingroup globus_gsi_proxy_handle
+ * @ingroup globus_gsi_proxy_handle
* @details
* Get the callback for creating the public/private key pair
*
@@ -1945,7 +1945,7 @@ globus_gsi_proxy_handle_get_key_gen_callback(
exit:
GLOBUS_I_GSI_PROXY_DEBUG_EXIT;
return result;
-}
+}
/**
@@ -1975,7 +1975,7 @@ globus_gsi_proxy_handle_get_common_name(
globus_result_t result = GLOBUS_SUCCESS;
GLOBUS_I_GSI_PROXY_DEBUG_ENTER;
-
+
if(!handle)
{
GLOBUS_GSI_PROXY_ERROR_RESULT(
@@ -1995,7 +1995,7 @@ globus_gsi_proxy_handle_get_common_name(
}
if(handle->common_name)
- {
+ {
*common_name = strdup(handle->common_name);
if(!*common_name)
{
@@ -2053,7 +2053,7 @@ globus_gsi_proxy_handle_set_common_name(
free(handle->common_name);
handle->common_name = NULL;
}
-
+
if(common_name)
{
handle->common_name = strdup(common_name);
@@ -2063,7 +2063,7 @@ globus_gsi_proxy_handle_set_common_name(
strlen(common_name));
goto exit;
}
- }
+ }
exit:
@@ -2085,7 +2085,7 @@ globus_gsi_proxy_handle_set_common_name(
* boolean value to set on the proxy handle
*
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
@@ -2146,7 +2146,7 @@ globus_gsi_proxy_handle_set_is_limited(
result = globus_gsi_proxy_handle_set_type(
handle,
GLOBUS_GSI_CERT_UTILS_TYPE_GSI_2_PROXY);
- }
+ }
}
exit:
@@ -2157,15 +2157,15 @@ globus_gsi_proxy_handle_set_is_limited(
/**
- * Check to see the proxy is a limited proxy
+ * Check to see the proxy is a limited proxy
*
* @param handle
* the proxy handle to check
* @param is_limited
- * boolean value to set depending on the type of proxy
+ * boolean value to set depending on the type of proxy
*
* @return
- * GLOBUS_SUCCESS unless an error occurred, in which case,
+ * GLOBUS_SUCCESS unless an error occurred, in which case,
* a globus error object ID is returned
*/
globus_result_t
diff --git a/gsi/proxy/proxy_ssl/source/configure.ac b/gsi/proxy/proxy_ssl/source/configure.ac
index 5e46eac326..1195e92d29 100644
--- a/gsi/proxy/proxy_ssl/source/configure.ac
+++ b/gsi/proxy/proxy_ssl/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gsi_proxy_ssl], [6.6],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gsi_proxy_ssl], [6.7],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/proxy/proxy_ssl/source/library/proxypolicy.c b/gsi/proxy/proxy_ssl/source/library/proxypolicy.c
index 09c00a4aeb..1c9bd1dbbb 100644
--- a/gsi/proxy/proxy_ssl/source/library/proxypolicy.c
+++ b/gsi/proxy/proxy_ssl/source/library/proxypolicy.c
@@ -34,7 +34,7 @@ IMPLEMENT_ASN1_DUP_FUNCTION(PROXYPOLICY)
#if OPENSSL_VERSION_NUMBER < 0x10000000L
/**
* @ingroup proxypolicy
- *
+ *
* Creates an ASN1_METHOD structure, which contains
* pointers to routines that convert any PROXYPOLICY
* structure to its associated ASN.1 DER encoded form
@@ -70,7 +70,7 @@ int PROXYPOLICY_cmp(
const PROXYPOLICY * a,
const PROXYPOLICY * b)
{
-
+
if((OBJ_obj2nid(a->policy_language) != OBJ_obj2nid(b->policy_language)) ||
ASN1_STRING_cmp((ASN1_STRING *)a->policy, (ASN1_STRING *)b->policy))
{
@@ -99,9 +99,9 @@ int PROXYPOLICY_print(
values = i2v_PROXYPOLICY(PROXYPOLICY_x509v3_ext_meth(),
policy,
values);
-
+
X509V3_EXT_val_prn(bp, values, 0, 1);
-
+
sk_CONF_VALUE_pop_free(values, X509V3_conf_free);
return 1;
}
@@ -123,7 +123,7 @@ int PROXYPOLICY_print_fp(
{
int ret;
- BIO * bp = BIO_new(BIO_s_file());
+ BIO * bp = BIO_new(BIO_s_file());
BIO_set_fp(bp, fp, BIO_NOCLOSE);
ret = PROXYPOLICY_print(bp, policy);
BIO_free(bp);
@@ -146,7 +146,7 @@ int PROXYPOLICY_set_policy_language(
PROXYPOLICY * policy,
ASN1_OBJECT * policy_language)
{
- if(policy_language != NULL)
+ if(policy_language != NULL)
{
ASN1_OBJECT_free(policy->policy_language);
policy->policy_language = OBJ_dup(policy_language);
@@ -157,14 +157,14 @@ int PROXYPOLICY_set_policy_language(
/**
* @ingroup proxypolicy
- *
+ *
* Gets the policy language of the PROXYPOLICY
*
* @param policy the proxy policy to get the policy language
* of
- *
+ *
* @return the policy language as an ASN1_OBJECT
- */
+ */
ASN1_OBJECT * PROXYPOLICY_get_policy_language(
PROXYPOLICY * policy)
{
@@ -196,7 +196,7 @@ int PROXYPOLICY_set_policy(
{
proxypolicy->policy = ASN1_OCTET_STRING_new();
}
-
+
ASN1_OCTET_STRING_set(proxypolicy->policy, copy, length);
}
@@ -228,16 +228,16 @@ unsigned char * PROXYPOLICY_get_policy(
int * length)
{
if(policy->policy)
- {
- (*length) = policy->policy->length;
- if(*length > 0 && policy->policy->data)
+ {
+ (*length) = ASN1_STRING_length(policy->policy);
+ if(*length > 0 && ASN1_STRING_get0_data(policy->policy))
{
unsigned char * copy = malloc(*length);
- memcpy(copy, policy->policy->data, *length);
+ memcpy(copy, ASN1_STRING_get0_data(policy->policy), *length);
return copy;
}
}
-
+
return NULL;
}
@@ -289,13 +289,13 @@ STACK_OF(CONF_VALUE) * i2v_PROXYPOLICY(
127,
PROXYPOLICY_get_policy_language(ext));
}
-
- X509V3_add_value(" Policy Language",
+
+ X509V3_add_value(" Policy Language",
policy_lang,
&extlist);
-
+
policy = PROXYPOLICY_get_policy(ext, &policy_length);
-
+
if(!policy)
{
X509V3_add_value(" Policy", " EMPTY", &extlist);
@@ -332,16 +332,16 @@ STACK_OF(CONF_VALUE) * i2v_PROXYPOLICY(
{
*(index++) = '\0';
policy_line_length = index - tmp_string;
-
+
X509V3_add_value(NULL, (char *) tmp_string, &extlist);
-
+
tmp_string = index;
}
policy_length -= policy_line_length;
}
-
+
free(policy);
}
-
+
return extlist;
}
diff --git a/gsi/proxy/proxy_utils/source/configure.ac b/gsi/proxy/proxy_utils/source/configure.ac
index dd335c16f2..f99e033574 100644
--- a/gsi/proxy/proxy_utils/source/configure.ac
+++ b/gsi/proxy/proxy_utils/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_proxy_utils],[7.4],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_proxy_utils],[7.5],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/proxy/proxy_utils/source/programs/grid-cert-diagnostics.c b/gsi/proxy/proxy_utils/source/programs/grid-cert-diagnostics.c
index ec72a0e788..daa8a515e9 100644
--- a/gsi/proxy/proxy_utils/source/programs/grid-cert-diagnostics.c
+++ b/gsi/proxy/proxy_utils/source/programs/grid-cert-diagnostics.c
@@ -176,7 +176,7 @@ main(int argc, char * argv[])
(strcmp(optarg, "HYBRID") == 0))
{
globus_libc_setenv(
- "GLOBUS_GSSAPI_NAME_COMPATIBILITY",
+ "GLOBUS_GSSAPI_NAME_COMPATIBILITY",
optarg,
1);
}
@@ -481,7 +481,7 @@ time_check(void)
goto sendto_fail;
}
now = time(NULL);
- rc = recv(sfd, buf, 4, 0);
+ rc = recv(sfd, buf, 4, 0);
if (rc < 4)
{
printf("WARNING: Unparsable response from time.nist.gov\n");
@@ -528,7 +528,7 @@ time_check(void)
+ (((uint32_t) buf[3]))) - INTMAX_C(2208988800);
local_seconds_since_unix_epoch = (intmax_t)
- difftime(now, unix_epoch_time) - tz_off;
+ difftime(now, unix_epoch_time) - tz_off;
delta = imaxabs(local_seconds_since_unix_epoch - seconds_since_unix_epoch);
@@ -1103,7 +1103,7 @@ check_trusted_certs(void)
char hash_string[16];
printf("Checking CA file %s... ", ca_cert_file);
-
+
result = globus_gsi_cred_read_cert(handle, ca_cert_file);
if (result != GLOBUS_SUCCESS)
{
@@ -1128,7 +1128,7 @@ check_trusted_certs(void)
if (strstr(ca_cert_file, hash_string) == 0)
{
- printf("failed\n CA hash '%s' does not match CA filename\n", hash_string);
+ printf("failed\n CA hash '%s' does not match CA filename\n", hash_string);
continue;
}
printf("ok\nChecking CA certificate name for %s...", hash_string);
@@ -1532,7 +1532,7 @@ check_service_cert_chain(
globus_result_t result;
globus_gsi_cred_handle_t handle = NULL;
globus_gsi_callback_data_t callback_data = NULL;
- X509_NAME *n = NULL;
+ const X509_NAME *n = NULL;
size_t host_len;
const char *no_extensions = " no";
OM_uint32 major_status, minor_status;
@@ -1666,7 +1666,11 @@ check_service_cert_chain(
idx != -1;
idx = X509_get_ext_by_NID(cert, NID_subject_alt_name, idx))
{
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_EXTENSION *ext_value;
+#else
+ const X509_EXTENSION *ext_value;
+#endif
GENERAL_NAMES *subject_alt_names;
no_extensions = "";
@@ -1688,15 +1692,14 @@ check_service_cert_chain(
if (subject_alt_name->type == GEN_DNS)
{
printf(" dns:%.*s",
- (int) subject_alt_name->d.dNSName->length,
- subject_alt_name->d.dNSName->data);
-
+ (int) ASN1_STRING_length(subject_alt_name->d.dNSName),
+ ASN1_STRING_get0_data(subject_alt_name->d.dNSName));
}
else if (subject_alt_name->type == GEN_IPADD)
{
printf(" ip:%.*s",
- (int) subject_alt_name->d.iPAddress->length,
- subject_alt_name->d.iPAddress->data);
+ (int) ASN1_STRING_length(subject_alt_name->d.iPAddress),
+ ASN1_STRING_get0_data(subject_alt_name->d.iPAddress));
}
else
{
@@ -1828,8 +1831,8 @@ static
char *
indent_string(const char * str)
{
- char * new_line;
- char * old_line;
+ const char * new_line;
+ const char * old_line;
char * output;
int i=1;
@@ -1838,7 +1841,7 @@ indent_string(const char * str)
return NULL;
}
- for (new_line = (char *) str; new_line != NULL; new_line = strchr(new_line+1, '\n'))
+ for (new_line = str; new_line != NULL; new_line = strchr(new_line+1, '\n'))
{
i++;
}
@@ -1846,7 +1849,7 @@ indent_string(const char * str)
output = malloc(strlen(str) + (i*4) + 1);
i = 0;
- for (new_line = strchr(str, '\n'), old_line = (char *) str;
+ for (new_line = strchr(str, '\n'), old_line = str;
new_line != NULL;
old_line = new_line+1, new_line = strchr(new_line+1, '\n'))
{
diff --git a/gsi/proxy/proxy_utils/source/programs/grid_proxy_init.c b/gsi/proxy/proxy_utils/source/programs/grid_proxy_init.c
index dc2d99995a..0fc3f305e7 100644
--- a/gsi/proxy/proxy_utils/source/programs/grid_proxy_init.c
+++ b/gsi/proxy/proxy_utils/source/programs/grid_proxy_init.c
@@ -124,23 +124,30 @@ globus_i_gsi_proxy_utils_print_error(
static int
globus_i_gsi_proxy_utils_pwstdin_callback(
- char * buf,
- int num,
+ char * buf,
+ int num,
int w,
void * u);
static void
globus_i_gsi_proxy_utils_key_gen_callback(
- int p,
+ int p,
int n,
void * dummy);
-static int
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
+static int
globus_l_gsi_proxy_utils_extension_callback(
globus_gsi_callback_data_t callback_data,
X509_EXTENSION * extension);
+#else
+static int
+globus_l_gsi_proxy_utils_extension_callback(
+ globus_gsi_callback_data_t callback_data,
+ const X509_EXTENSION * extension);
+#endif
-int
+int
main(
int argc,
char ** argv)
@@ -177,7 +184,7 @@ main(
long path_length = -1;
pem_password_cb * pw_cb = NULL;
int return_value = 0;
-
+
if(globus_module_activate(GLOBUS_GSI_PROXY_MODULE) != (int)GLOBUS_SUCCESS)
{
globus_libc_fprintf(
@@ -276,7 +283,7 @@ main(
{
int hours;
int minutes;
- args_verify_next(arg_index, argp,
+ args_verify_next(arg_index, argp,
"valid time argument H:M missing");
if(sscanf(argv[++arg_index], "%d:%d", &hours, &minutes) < 2)
{
@@ -292,12 +299,12 @@ main(
"be in the range 0-60");
}
/* error on overflow */
-
+
if(hours > (((time_t)(~0U>>1))/3600-1))
{
hours = (((time_t)(~0U>>1))/3600-1);
}
-
+
valid = (hours * 60) + minutes;
}
@@ -318,7 +325,7 @@ main(
{
args_verify_next(arg_index, argp, "integer argument missing");
key_bits = atoi(argv[arg_index + 1]);
- if((key_bits != 512) && (key_bits != 1024) &&
+ if((key_bits != 512) && (key_bits != 1024) &&
(key_bits != 2048) && (key_bits != 4096))
{
args_error(argp, "value must be one of 512,1024,2048,4096");
@@ -333,7 +340,7 @@ main(
{
if (cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK)
{
- args_error(argp,
+ args_error(argp,
"-independent, -limited and -policy/-policy-language are mutually exclusive");
}
else
@@ -345,7 +352,7 @@ main(
{
if (cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK)
{
- args_error(argp,
+ args_error(argp,
"-independent, -limited and -policy/-policy-language are mutually exclusive");
}
else
@@ -357,7 +364,7 @@ main(
{
if ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_FORMAT_MASK) != 0)
{
- args_error(argp,
+ args_error(argp,
"-old, -rfc, and -draft are mutually exclusive");
}
else
@@ -407,7 +414,7 @@ main(
args_error(argp,
"-independent, -limited and -policy/-policy-language are mutually exclusive");
}
- args_verify_next(arg_index, argp,
+ args_verify_next(arg_index, argp,
"policy file name missing");
policy_filename = argv[++arg_index];
cert_type |= GLOBUS_GSI_CERT_UTILS_TYPE_RESTRICTED_PROXY;
@@ -418,7 +425,7 @@ main(
if ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0 &&
(cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != GLOBUS_GSI_CERT_UTILS_TYPE_RESTRICTED_PROXY)
{
- args_error(argp,
+ args_error(argp,
"-independent, -limited and -policy/-policy-language are mutually exclusive");
}
args_verify_next(arg_index, argp, "policy language missing");
@@ -447,14 +454,14 @@ main(
/* A few sanity checks */
if(policy_filename && !policy_language)
{
- globus_libc_fprintf(stderr,
+ globus_libc_fprintf(stderr,
"\nERROR: If you specify a policy file "
"you also need to specify a policy language.\n");
exit(1);
}
result = globus_gsi_proxy_handle_attrs_init(&proxy_handle_attrs);
-
+
if(result != GLOBUS_SUCCESS)
{
globus_i_gsi_proxy_utils_print_error(result, debug, __FILE__, __LINE__,
@@ -474,9 +481,9 @@ main(
"Couldn't set the key bits for "
"the private key of the proxy certificate.");
}
-
+
result = globus_gsi_proxy_handle_attrs_set_key_gen_callback(
- proxy_handle_attrs,
+ proxy_handle_attrs,
globus_i_gsi_proxy_utils_key_gen_callback);
if(result != GLOBUS_SUCCESS)
{
@@ -500,9 +507,9 @@ main(
result, debug, __FILE__, __LINE__,
"Couldn't destroy proxy handle attributes.");
}
-
+
/* set the time valid in the proxy handle
- * used to be hours - now the time valid needs to be set in minutes
+ * used to be hours - now the time valid needs to be set in minutes
*/
result = globus_gsi_proxy_handle_set_time_valid(proxy_handle, valid);
@@ -524,7 +531,7 @@ main(
result, debug, __FILE__, __LINE__,
"Couldn't set the type of the proxy cert.");
}
-
+
if(!user_cert_filename || !user_key_filename)
{
result = GLOBUS_GSI_SYSCONFIG_GET_USER_CERT_FILENAME(
@@ -555,7 +562,7 @@ main(
{
user_key_filename = tmp_user_key_filename;
}
-
+
if(debug)
{
globus_libc_fprintf(stderr,
@@ -587,8 +594,8 @@ main(
if(debug)
{
- globus_libc_fprintf(stderr,
- "\nTrusted CA Cert Dir: %s\n",
+ globus_libc_fprintf(stderr,
+ "\nTrusted CA Cert Dir: %s\n",
ca_cert_dir ? ca_cert_dir : "(null)");
}
@@ -631,7 +638,7 @@ main(
{
free(proxy_out_filename);
}
-
+
proxy_out_filename = proxy_absolute_path;
/* then split */
@@ -644,7 +651,7 @@ main(
globus_i_gsi_proxy_utils_print_error(
result, debug, __FILE__, __LINE__,
"Can't split the full path into "
- "directory and filename. The full path is: %s",
+ "directory and filename. The full path is: %s",
proxy_absolute_path);
if(proxy_absolute_path)
{
@@ -652,7 +659,7 @@ main(
proxy_absolute_path = NULL;
}
}
-
+
result = GLOBUS_GSI_SYSCONFIG_DIR_EXISTS(temp_dir);
if(result != GLOBUS_SUCCESS)
{
@@ -666,7 +673,7 @@ main(
}
else
{
- globus_module_deactivate_all();
+ globus_module_deactivate_all();
exit(1);
}
}
@@ -676,7 +683,7 @@ main(
free(temp_dir);
temp_dir = NULL;
}
-
+
if(temp_filename)
{
free(temp_filename);
@@ -731,7 +738,7 @@ main(
"user certificate could "
"not be retrieved.");
}
-
+
printf("Your identity: %s\n", subject);
if(subject)
{
@@ -750,7 +757,7 @@ main(
globus_i_gsi_proxy_utils_print_error(
result, debug, __FILE__, __LINE__,
"Couldn't read user certificate\n"
- "cert file location: %s.",
+ "cert file location: %s.",
user_cert_filename);
}
@@ -766,7 +773,7 @@ main(
"user certificate could "
"not be retrieved.");
}
-
+
printf("Your identity: %s\n", subject);
if(subject)
{
@@ -778,7 +785,7 @@ main(
subject = NULL;
}
}
-
+
result = globus_gsi_cred_read_key(
cred_handle,
user_key_filename,
@@ -794,7 +801,7 @@ main(
PEM_F_PEM_DO_HEADER,
PEM_R_BAD_DECRYPT)
== GLOBUS_TRUE)
- {
+ {
globus_i_gsi_proxy_utils_print_error(
result, debug, __FILE__, __LINE__,
"Couldn't read user key: Bad passphrase for key in %s",
@@ -823,41 +830,41 @@ main(
"Can't set the path length in the proxy handle.");
}
}
-
+
/* add policies now */
if(policy_filename)
{
int policy_buf_size = 0;
FILE * policy_fp = NULL;
-
+
policy_fp = fopen(policy_filename, "r");
if(!policy_fp)
{
- fprintf(stderr,
+ fprintf(stderr,
"\nERROR: Unable to open policies "
" file: %s\n\n", policy_filename);
exit(1);
}
- do
+ do
{
policy_buf_size += 512;
-
+
/* First time through this is a essentially a malloc() */
policy_buf = realloc(policy_buf,
policy_buf_size);
if (policy_buf == NULL)
{
- fprintf(stderr,
+ fprintf(stderr,
"\nAllocation of space for "
"policy buffer failed\n\n");
exit(1);
}
- policy_buf_len +=
- fread(&policy_buf[policy_buf_len], 1,
+ policy_buf_len +=
+ fread(&policy_buf[policy_buf_len], 1,
512, policy_fp);
/*
@@ -869,13 +876,13 @@ main(
*/
}
while (policy_buf_len == policy_buf_size);
-
+
if (policy_buf_len > 0)
{
- policy_NID =
- OBJ_create(policy_language,
- policy_language,
- policy_language);
+ policy_NID =
+ OBJ_create(policy_language,
+ policy_language,
+ policy_language);
result = globus_gsi_proxy_handle_set_policy(
proxy_handle,
@@ -888,11 +895,11 @@ main(
result, debug, __FILE__, __LINE__,
"Can't set the policy in the proxy handle.");
}
- }
+ }
fclose(policy_fp);
}
-
+
if (!quiet)
{
printf("Creating proxy ");
@@ -937,7 +944,7 @@ main(
"Couldn't set the X.509 extension callback in the callback "
"data.");
}
-
+
result = globus_gsi_callback_set_cert_dir(
callback_data,
ca_cert_dir);
@@ -967,7 +974,7 @@ main(
else
{
result = globus_gsi_cred_verify(proxy_cred_handle);
-
+
if(result != GLOBUS_SUCCESS)
{
globus_i_gsi_proxy_utils_print_error(
@@ -1025,7 +1032,7 @@ main(
{
globus_libc_fprintf(
stderr,
- "\nERROR: Your certificate has expired: %s\n\n",
+ "\nERROR: Your certificate has expired: %s\n\n",
asctime(localtime(&goodtill)));
globus_module_deactivate_all();
exit(2);
@@ -1033,7 +1040,7 @@ main(
else if(lifetime < (valid * 60))
{
globus_libc_fprintf(
- stderr,
+ stderr,
"\nWarning: your certificate and proxy will expire %s "
"which is within the requested lifetime of the proxy\n",
asctime(localtime(&goodtill)));
@@ -1042,7 +1049,7 @@ main(
{
globus_libc_fprintf(
stdout,
- "Your proxy is valid until: %s",
+ "Your proxy is valid until: %s",
asctime(localtime(&goodtill)));
}
@@ -1069,8 +1076,8 @@ main(
static int
globus_i_gsi_proxy_utils_pwstdin_callback(
- char * buf,
- int num,
+ char * buf,
+ int num,
int w,
void * u)
{
@@ -1086,7 +1093,7 @@ globus_i_gsi_proxy_utils_pwstdin_callback(
buf[i-1] = '\0';
i--;
}
- return i;
+ return i;
}
@@ -1139,7 +1146,7 @@ globus_i_gsi_proxy_utils_print_error(
{
globus_libc_fprintf(stderr, " %s:%d: %s", filename, line, error_string);
}
- else
+ else
{
globus_libc_fprintf(stderr, "Use -debug for further information.\n");
}
@@ -1152,13 +1159,19 @@ globus_i_gsi_proxy_utils_print_error(
exit(1);
}
-static
-int
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
+static int
globus_l_gsi_proxy_utils_extension_callback(
globus_gsi_callback_data_t callback_data,
X509_EXTENSION * extension)
+#else
+static int
+globus_l_gsi_proxy_utils_extension_callback(
+ globus_gsi_callback_data_t callback_data,
+ const X509_EXTENSION * extension)
+#endif
{
- ASN1_OBJECT * extension_object = NULL;
+ const ASN1_OBJECT * extension_object = NULL;
int nid = NID_undef;
int pci_old_NID = NID_undef;
diff --git a/gsi/sysconfig/source/configure.ac b/gsi/sysconfig/source/configure.ac
index 4b1f83861b..da4cbdfaf5 100644
--- a/gsi/sysconfig/source/configure.ac
+++ b/gsi/sysconfig/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_gsi_sysconfig], [9.6],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_gsi_sysconfig], [9.7],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/gsi/sysconfig/source/library/globus_gsi_system_config.c b/gsi/sysconfig/source/library/globus_gsi_system_config.c
index fa97964bfa..e428d6cc19 100644
--- a/gsi/sysconfig/source/library/globus_gsi_system_config.c
+++ b/gsi/sysconfig/source/library/globus_gsi_system_config.c
@@ -258,7 +258,7 @@ globus_l_gsi_sysconfig_activate(void)
GLOBUS_I_GSI_SYSCONFIG_DEBUG_ENTER;
#ifdef TARGET_ARCH_CYGWIN
- /* windows permissions are a pain, and cygwin won't give reliable
+ /* windows permissions are a pain, and cygwin won't give reliable
permissions when a non-posix path is used anyways */
if(getenv("GLOBUS_IGNORE_CRED_PERMS"))
{
@@ -301,10 +301,10 @@ globus_l_gsi_sysconfig_activate(void)
*/
GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(DEFAULT_RANDOM_FILE);
- /* ToDo: look at return code? */
+ /* ToDo: look at return code? */
/* probably overestimating the entropy in the below */
-#ifndef WIN32 /* ToDo: Do this for Win32? */
+#ifndef WIN32 /* ToDo: Do this for Win32? */
uptime = times(&proc_times);
RAND_add((void *) &uptime, sizeof(clock_t), 2);
@@ -520,7 +520,7 @@ globus_gsi_sysconfig_set_key_permissions_win32(
char * filename)
{
globus_result_t result = GLOBUS_SUCCESS;
- int fd = -1;
+ int fd = -1;
struct _stat stx;
GLOBUS_I_GSI_SYSCONFIG_DEBUG_ENTER;
@@ -554,8 +554,8 @@ globus_gsi_sysconfig_set_key_permissions_win32(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx, sizeof(stx), 2);
@@ -594,7 +594,7 @@ globus_gsi_sysconfig_set_key_permissions_win32(
__FILE__,
__func__,
__LINE__,
- "Error setting permissions to user read only of file: %s\n",
+ "Error setting permissions to user read only of file: %s\n",
filename));
goto exit;
}
@@ -602,7 +602,7 @@ globus_gsi_sysconfig_set_key_permissions_win32(
exit:
if (fd >= 0)
{
- close(fd);
+ close(fd);
}
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
@@ -616,7 +616,7 @@ globus_gsi_sysconfig_set_key_permissions_win32(
* @ingroup globus_i_gsi_sysconfig_win32
* @details
* Get the HOME directory, currently c:\windows
- *
+ *
* @param home_dir
* The home directory of the current user
* @return
@@ -641,7 +641,7 @@ globus_gsi_sysconfig_get_home_dir_win32(
if(home_drive == NULL)
{
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
- result,
+ result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_HOME_DIR,
(_GSSL("Could not get a home directory for this machine")));
@@ -652,7 +652,7 @@ globus_gsi_sysconfig_get_home_dir_win32(
if(home_path == NULL)
{
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
- result,
+ result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_HOME_DIR,
(_GSSL("Could not get a home directory for this machine")));
@@ -706,7 +706,7 @@ globus_gsi_sysconfig_get_home_dir_win32(
*
* @param filename the file to check
*
- * @return
+ * @return
* GLOBUS_SUCCESS (even if the file doesn't exist) - in some
* abortive cases an error object identifier is returned
*/
@@ -729,7 +729,7 @@ globus_gsi_sysconfig_file_exists_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_DOES_NOT_EXIST,
- (_GSSL("%s is not a valid file"), filename));
+ (_GSSL("%s is not a valid file"), filename));
goto exit;
case EACCES:
@@ -737,7 +737,7 @@ globus_gsi_sysconfig_file_exists_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS,
- (_GSSL("Could not read %s"), filename));
+ (_GSSL("Could not read %s"), filename));
goto exit;
default:
@@ -757,8 +757,8 @@ globus_gsi_sysconfig_file_exists_win32(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
@@ -767,16 +767,16 @@ globus_gsi_sysconfig_file_exists_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
goto exit;
}
if(stx.st_mode & S_IFDIR)
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_IS_DIR,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
}
else if((stx.st_mode & S_IFMT) &
~ (S_IFREG | S_IFDIR))
@@ -791,7 +791,7 @@ globus_gsi_sysconfig_file_exists_win32(
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
return result;
-}
+}
/**
* @brief Win32 - Directory Exists
@@ -801,7 +801,7 @@ globus_gsi_sysconfig_file_exists_win32(
*
* @param filename the file to check
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the directory exists, otherwise an error
* object identifier.
*/
@@ -824,7 +824,7 @@ globus_gsi_sysconfig_dir_exists_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_DOES_NOT_EXIST,
- (_GSSL("%s is not a valid directory"), filename));
+ (_GSSL("%s is not a valid directory"), filename));
goto exit;
case EACCES:
@@ -832,7 +832,7 @@ globus_gsi_sysconfig_dir_exists_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS,
- (_GSSL("Could not read %s"), filename));
+ (_GSSL("Could not read %s"), filename));
goto exit;
default:
@@ -852,40 +852,40 @@ globus_gsi_sysconfig_dir_exists_win32(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
/* != 0 size test will always fail in windows so it was removed */
if(!(stx.st_mode & S_IFDIR))
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_NOT_DIR,
- (_GSSL("%s is not a directory"), filename));
+ (_GSSL("%s is not a directory"), filename));
}
exit:
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
return result;
-}
+}
/**
* @brief Win32 - Check File Status for Key
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* private key file. The desired status is only the current user has
* ownership and read permissions, everyone else should not be able
* to access it.
- *
+ *
* @param filename
* The name of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -902,15 +902,15 @@ globus_gsi_sysconfig_check_keyfile_win32(
* @brief Win32 - Check File Status for Key
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* private key file. The desired status is only the current user has
* ownership and read permissions, everyone else should not be able
* to access it.
- *
+ *
* @param filename
* The name of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -944,7 +944,7 @@ globus_gsi_sysconfig_check_keyfile_uid_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS,
- (_GSSL("Could not read %s"), filename));
+ (_GSSL("Could not read %s"), filename));
goto exit;
default:
@@ -963,8 +963,8 @@ globus_gsi_sysconfig_check_keyfile_uid_win32(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
@@ -982,7 +982,7 @@ globus_gsi_sysconfig_check_keyfile_uid_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
goto exit;
}
@@ -992,7 +992,7 @@ globus_gsi_sysconfig_check_keyfile_uid_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_IS_DIR,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
}
else if((stx.st_mode & S_IFMT)
& ~(S_IFREG | S_IFDIR))
@@ -1016,15 +1016,15 @@ globus_gsi_sysconfig_check_keyfile_uid_win32(
* @brief Win32 - Check File Status for Cert
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* certificate file. The desired status is the current user has
* ownership and read/write permissions, while group and others only
* have read permissions.
- *
+ *
* @param filename
* The name of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -1041,15 +1041,15 @@ globus_gsi_sysconfig_check_certfile_win32(
* @brief Win32 - Check File Status for Cert
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* certificate file. The desired status is the current user has
* ownership and read/write permissions, while group and others only
* have read permissions.
- *
+ *
* @param filename
* The name of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -1101,14 +1101,14 @@ globus_gsi_sysconfig_check_certfile_uid_win32(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
/*
* Note that unix-like ownership and permissions are not suppored by Windows so
- * geteuid() and rwx mode tests are not done. Maybe later Win32 file security
+ * geteuid() and rwx mode tests are not done. Maybe later Win32 file security
* using Access Control Lists can be incorporated, but this is an architectural
* and would need to be considered and implemented in a comprehensive way.
*/
@@ -1119,7 +1119,7 @@ globus_gsi_sysconfig_check_certfile_uid_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
goto exit;
}
@@ -1193,7 +1193,7 @@ globus_gsi_sysconfig_get_current_working_dir_win32(
}
else if(!result_buffer)
{
- result =
+ result =
globus_error_put(globus_error_wrap_errno_error(
GLOBUS_GSI_SYSCONFIG_MODULE,
errno,
@@ -1225,7 +1225,7 @@ globus_gsi_sysconfig_get_current_working_dir_win32(
* on the current working directory.
*
* @param filename
- * the filename to get the absolute path of.
+ * the filename to get the absolute path of.
* @param absolute_path
* The resulting absolute path
* @return
@@ -1330,8 +1330,8 @@ globus_gsi_sysconfig_split_dir_and_filename_win32(
goto exit;
}
- globus_libc_snprintf(*filename_string, filename_string_length,
- "%s", full_filename);
+ globus_libc_snprintf(*filename_string, filename_string_length,
+ "%s", full_filename);
}
else
{
@@ -1377,7 +1377,7 @@ globus_gsi_sysconfig_split_dir_and_filename_win32(
* @brief Win32 - Get User ID
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * Get a unique string representing the current user.
+ * Get a unique string representing the current user.
*/
globus_result_t
globus_gsi_sysconfig_get_user_id_string_win32(
@@ -1399,7 +1399,7 @@ globus_gsi_sysconfig_get_user_id_string_win32(
* @brief Win32 - Get Username
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * Get the username of the current user.
+ * Get the username of the current user.
*/
globus_result_t
globus_gsi_sysconfig_get_username_win32(
@@ -1411,26 +1411,26 @@ globus_gsi_sysconfig_get_username_win32(
GLOBUS_I_GSI_SYSCONFIG_DEBUG_ENTER;
- if(name = getenv("USERNAME"))
+ if(name = getenv("USERNAME"))
{
size = strlen(name) + 1;
*username = malloc(size);
- if(*username)
+ if(*username)
{
strncpy(*username,name,size);
}
- else
+ else
{
result = GLOBUS_GSI_SYSTEM_CONFIG_MALLOC_ERROR;
}
}
/* getenv failed */
- else
+ else
{
*username = NULL;
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
- result,
+ result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_HOME_DIR,
(_GSSL("Could not find username for this use")));
}
@@ -1444,7 +1444,7 @@ globus_gsi_sysconfig_get_username_win32(
* @brief Win32 - Get Process ID
* @ingroup globus_i_gsi_sysconfig_win32
* @details
- * Get a unique string representing the current process.
+ * Get a unique string representing the current process.
*/
globus_result_t
globus_gsi_sysconfig_get_proc_id_string_win32(
@@ -1498,19 +1498,19 @@ globus_gsi_sysconfig_get_proc_id_string_win32(
* software\\Globus\\GSI
*
\\<user home directory>\\.globus\\certificates - If this
* directory exists, and the previous methods of determining the trusted
- * certs directory failed, this directory will be used.
+ * certs directory failed, this directory will be used.
*
Host Trusted Cert Dir - This location is intended
- * to be independent of the globus installation ($GLOBUS_LOCATION), and
- * is generally only writeable by the host system administrator.
+ * to be independent of the globus installation ($GLOBUS_LOCATION), and
+ * is generally only writeable by the host system administrator.
*
Globus Install Trusted Cert Dir - this
- * is $GLOBUS_LOCATION\\share\\certificates.
+ * is $GLOBUS_LOCATION\\share\\certificates.
*
*
* @param cert_dir
* The trusted certificates directory
* @return
* GLOBUS_SUCCESS if no error occurred, and a sufficient trusted
- * certificates directory was found. Otherwise, an error object
+ * certificates directory was found. Otherwise, an error object
* identifier returned.
*/
globus_result_t
@@ -1533,7 +1533,7 @@ globus_gsi_sysconfig_get_cert_dir_win32(
if(getenv(X509_CERT_DIR))
{
result = globus_i_gsi_sysconfig_create_cert_dir_string(
- cert_dir,
+ cert_dir,
&env_cert_dir,
"%s",
getenv(X509_CERT_DIR));
@@ -1552,9 +1552,9 @@ globus_gsi_sysconfig_get_cert_dir_win32(
result = GLOBUS_GSI_SYSCONFIG_GET_HOME_DIR(&home);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_cert_dir_string(
- cert_dir,
+ cert_dir,
&local_cert_dir,
"%s%s%s",
home,
@@ -1580,7 +1580,7 @@ globus_gsi_sysconfig_get_cert_dir_win32(
else if(!GLOBUS_GSI_SYSCONFIG_FILE_DOES_NOT_EXIST(result) &&
!GLOBUS_GSI_SYSCONFIG_FILE_HAS_BAD_PERMISSIONS(result))
{
- home = NULL;
+ home = NULL;
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_DIR);
@@ -1671,7 +1671,7 @@ globus_gsi_sysconfig_get_cert_dir_win32(
}
GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF(
- 2, (stderr, "Using cert_dir = %s\n",
+ 2, (stderr, "Using cert_dir = %s\n",
(*cert_dir ? *cert_dir : "null")));
result = GLOBUS_SUCCESS;
@@ -1685,7 +1685,7 @@ globus_gsi_sysconfig_get_cert_dir_win32(
if(home != NULL)
{
- free(home);
+ free(home);
}
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
@@ -1700,11 +1700,11 @@ globus_gsi_sysconfig_get_cert_dir_win32(
* Get the User Certificate Filename based on the current user's
* environment. The following locations are searched for cert and key
* files in order:
- *
+ *
*
*
environment variables X509_USER_CERT and X509_USER_KEY
*
registry keys x509_user_cert and x509_user_key in software\\Globus\\GSI
- *
<users home directory>\\.globus\\usercert.pem and
+ *
<users home directory>\\.globus\\usercert.pem and
* <users home directory>\\.globus\\userkey.pem
*
<users home directory>\\.globus\\usercred.p12 - this is a PKCS12 credential
*
@@ -1752,7 +1752,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
goto done;
- }
+ }
}
if(!(*user_cert))
@@ -1789,7 +1789,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
}
if(user_key)
- {
+ {
*user_key = NULL;
result = GLOBUS_SUCCESS;
@@ -1853,7 +1853,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
{
result = GLOBUS_SUCCESS;
if(!home)
- {
+ {
result = GLOBUS_GSI_SYSCONFIG_GET_HOME_DIR(&home);
}
@@ -1882,7 +1882,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_KEY_STRING);
- goto done;
+ goto done;
}
}
@@ -1937,7 +1937,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
* @ingroup globus_gsi_sysconfig_win32
* @details
* Get the Host Certificate and Key Filenames based on the current user's
- * environment. The host cert and key are searched for in the following
+ * environment. The host cert and key are searched for in the following
* locations (in order):
*
*
@@ -1946,7 +1946,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
*
<GLOBUS_LOCATION>\\etc\\host[cert|key].pem
*
<users home directory>\\.globus\\host[cert|key].pem
*
- *
+ *
* @param host_cert
* pointer to the host certificate filename
* @param host_key
@@ -1954,7 +1954,7 @@ globus_gsi_sysconfig_get_user_cert_filename_win32(
*
* @return
* GLOBUS_SUCCESS if the host cert and key were found, otherwise
- * an error object identifier is returned
+ * an error object identifier is returned
*/
globus_result_t
globus_gsi_sysconfig_get_host_cert_filename_win32(
@@ -2022,7 +2022,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
host_key,
& default_host_key,
@@ -2050,7 +2050,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
}
/* now check installed location for host cert */
- if(!(*host_cert) && !(*host_key))
+ if(!(*host_cert) && !(*host_key))
{
result = globus_location(&location);
@@ -2068,7 +2068,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
host_key,
&installed_host_key,
@@ -2098,7 +2098,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
}
}
- if(!(*host_cert) && !(*host_key))
+ if(!(*host_cert) && !(*host_key))
{
result = GLOBUS_GSI_SYSCONFIG_GET_HOME_DIR(&home);
@@ -2116,7 +2116,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
host_key,
& local_host_key,
@@ -2199,7 +2199,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
* @ingroup globus_gsi_sysconfig_win32
* @details
* Get the Service Certificate Filename based on the current user's
- * environment. The host cert and key are searched for in the following
+ * environment. The host cert and key are searched for in the following
* locations (in order):
*
*
@@ -2207,11 +2207,11 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
*
registry keys x509_user_cert and x509_user_key in software\\Globus\\GSI
*
GLOBUS_LOCATION\\etc\\{service_name}\\{service_name}[cert|key].pem
* So for example, if my service was named: myservice, the location
- * of the certificate would be:
+ * of the certificate would be:
* <GLOBUS_LOCATION>\\etc\\myservice\\myservicecert.pem
*
- *
+ *
* @param service_name
* The name of the service which allows us to determine the
* locations of cert and key files to look for
@@ -2222,7 +2222,7 @@ globus_gsi_sysconfig_get_host_cert_filename_win32(
*
* @return
* GLOBUS_SUCCESS if the service cert and key were found, otherwise
- * an error object identifier
+ * an error object identifier
*/
globus_result_t
globus_gsi_sysconfig_get_service_cert_filename_win32(
@@ -2267,7 +2267,7 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
getenv(X509_USER_CERT));
if(result != GLOBUS_SUCCESS)
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
@@ -2308,7 +2308,7 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
service_key,
& default_service_key,
@@ -2334,7 +2334,7 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
- goto done;
+ goto done;
}
}
else if(!GLOBUS_GSI_SYSCONFIG_FILE_DOES_NOT_EXIST(result))
@@ -2368,7 +2368,7 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
service_key,
&installed_service_key,
@@ -2424,7 +2424,7 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
service_key,
&local_service_key,
@@ -2460,7 +2460,7 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
home = NULL;
- goto done;
+ goto done;
}
}
@@ -2516,29 +2516,29 @@ globus_gsi_sysconfig_get_service_cert_filename_win32(
* @details
* Get the proxy cert filename based on the following
* search order:
- *
+ *
*
*
X509_USER_PROXY environment variable - This environment variable
* is set by the at run time for the specific application. If
* the proxy_file_type variable is set to GLOBUS_PROXY_OUTPUT
- * (a proxy filename for writing is requested),
- * and the X509_USER_PROXY is set, this will be the
+ * (a proxy filename for writing is requested),
+ * and the X509_USER_PROXY is set, this will be the
* resulting value of the user_proxy filename string passed in. If the
- * proxy_file_type is set to GLOBUS_PROXY_INPUT and X509_USER_PROXY is
- * set, but the file it points to does not exist,
- * or has some other readability issues, the
+ * proxy_file_type is set to GLOBUS_PROXY_INPUT and X509_USER_PROXY is
+ * set, but the file it points to does not exist,
+ * or has some other readability issues, the
* function will continue checking using the other methods available.
- *
+ *
*
check the registry key: x509_user_proxy. Just as with
* the environment variable, if the registry key is set, and proxy_file_type
- * is GLOBUS_PROXY_OUTPUT, the string set to be the proxy
+ * is GLOBUS_PROXY_OUTPUT, the string set to be the proxy
* filename will be this registry
- * key's value. If proxy_file_type is GLOBUS_PROXY_INPUT, and the
- * file doesn't exist, the function will check the next method
+ * key's value. If proxy_file_type is GLOBUS_PROXY_INPUT, and the
+ * file doesn't exist, the function will check the next method
* for the proxy's filename.
- *
+ *
*
Check the default location for the proxy file. The default
- * location should be
+ * location should be
* set to reside in the temp directory on that host, with the filename
* taking the format: x509_u<user id>
* where <user id> is some unique string for that user on the host
@@ -2580,7 +2580,7 @@ globus_gsi_sysconfig_get_proxy_filename_win32(
}
}
else
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
user_proxy,
&env_user_proxy,
@@ -2644,7 +2644,7 @@ globus_gsi_sysconfig_get_proxy_filename_win32(
if(!(*user_proxy))
{
- GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
+ GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_PROXY_FILENAME,
(_GSSL("A file location for%s the proxy cert could not be found in: \n"
@@ -2677,14 +2677,14 @@ globus_gsi_sysconfig_get_proxy_filename_win32(
* @brief Win32 - Get CA Cert Filenames
* @ingroup globus_gsi_sysconfig_win32
* @details
- * Gets a list of trusted CA certificate filenames in
- * a trusted CA certificate directory.
+ * Gets a list of trusted CA certificate filenames in
+ * a trusted CA certificate directory.
*
* @param ca_cert_dir
* The trusted CA certificate directory to get the filenames from
* @param ca_cert_list
* The resulting list of CA certificate filenames. This is
- * a globus list structure.
+ * a globus list structure.
* @see globus_fifo_t
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
@@ -2724,7 +2724,7 @@ globus_gsi_sysconfig_get_ca_cert_files_win32(
goto exit;
}
- /* build a wild card search string */
+ /* build a wild card search string */
sprintf(file_search_string,"%s\\*.*",ca_cert_dir);
/* search the directory for the first file */
@@ -2748,14 +2748,14 @@ globus_gsi_sysconfig_get_ca_cert_files_win32(
{
file_length = strlen(file_data.cFileName);
/* check the following:
- *
+ *
* - file length is greater than or equal to 10
* - first 8 characters are alpha-numeric
* - 9th character is '.'
* - characters after the '.' are numeric
*/
- full_filename_path =
+ full_filename_path =
globus_common_create_string(
"%s%s%s", ca_cert_dir, FILE_SEPARATOR, file_data.cFileName);
@@ -2779,9 +2779,9 @@ globus_gsi_sysconfig_get_ca_cert_files_win32(
if(file_length >= (X509_HASH_LENGTH + 2) &&
(*(file_data.cFileName + X509_HASH_LENGTH) == '.') &&
- (strspn(file_data.cFileName, "0123456789abcdefABCDEF")
+ (strspn(file_data.cFileName, "0123456789abcdefABCDEF")
== X509_HASH_LENGTH) &&
- (strspn((file_data.cFileName + (X509_HASH_LENGTH + 1)),
+ (strspn((file_data.cFileName + (X509_HASH_LENGTH + 1)),
"0123456789") == (file_length - 9)))
{
globus_fifo_enqueue(ca_cert_list, (void *)full_filename_path);
@@ -2842,7 +2842,7 @@ globus_gsi_sysconfig_remove_all_owned_files_win32(
GLOBUS_I_GSI_SYSCONFIG_DEBUG_ENTER;
- /* build a wild card search string */
+ /* build a wild card search string */
sprintf(search_string,"%s\\*.*",DEFAULT_SECURE_TMP_DIR);
/* search the directory for the first file */
@@ -2864,7 +2864,7 @@ globus_gsi_sysconfig_remove_all_owned_files_win32(
/* go through all the files in the directory (first one's already there) */
do
{
- if((default_filename &&
+ if((default_filename &&
!strcmp(file_data.cFileName, default_filename)) ||
!strncmp(file_data.cFileName,
X509_UNIQUE_PROXY_FILE,
@@ -2884,11 +2884,11 @@ globus_gsi_sysconfig_remove_all_owned_files_win32(
RAND_add((void *) &stx, sizeof(stx), 2);
f = _open(full_filename, O_RDWR);
- if (f)
+ if (f)
{
size = lseek(f, 0L, SEEK_END);
lseek(f, 0L, SEEK_SET);
- if (size > 0)
+ if (size > 0)
{
rec = size / 64;
left = size - rec * 64;
@@ -2898,7 +2898,7 @@ globus_gsi_sysconfig_remove_all_owned_files_win32(
rec--;
}
if (left)
- {
+ {
write(f, msg, left);
}
}
@@ -3000,7 +3000,7 @@ globus_gsi_sysconfig_get_gridmap_filename_win32(
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_GRIDMAP_FILENAME);
- goto exit;
+ goto exit;
}
}
}
@@ -3032,7 +3032,7 @@ globus_gsi_sysconfig_get_gridmap_filename_win32(
* @ingroup globus_gsi_sysconfig_win32
* @details
* Get the path and file name of the authorization callback
- * configuration file
+ * configuration file
*
* @param filename
* Contains the location of the authorization callback configuration
@@ -3076,7 +3076,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_win32(
}
}
else
- {
+ {
authz_filename = globus_common_create_string(
"%s",
DEFAULT_AUTHZ_FILE);
@@ -3097,7 +3097,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_win32(
authz_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_FILENAME);
@@ -3133,7 +3133,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_win32(
authz_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_FILENAME);
@@ -3208,7 +3208,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_win32(
* @ingroup globus_gsi_sysconfig_win32
* @details
* Get the path and file name of the authorization callback library
- * configuration file
+ * configuration file
*
* @param filename
* Contains the location of the authorization callback library
@@ -3240,7 +3240,7 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
authz_lib_filename);
if(result != GLOBUS_SUCCESS)
@@ -3252,12 +3252,12 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
}
}
else
- {
+ {
authz_lib_filename = globus_common_create_string(
"%s%s_%s%s",
- DEFAULT_AUTHZ_LIB_FILE_DIR,
- DEFAULT_AUTHZ_LIB_FILE_BASE,
- flavor,
+ DEFAULT_AUTHZ_LIB_FILE_DIR,
+ DEFAULT_AUTHZ_LIB_FILE_BASE,
+ flavor,
DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
if(!authz_lib_filename)
{
@@ -3265,7 +3265,7 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
authz_lib_filename);
if(result != GLOBUS_SUCCESS)
@@ -3276,7 +3276,7 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
authz_lib_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_LIB_FILENAME);
@@ -3294,17 +3294,17 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
"%s%s%s%s_%s%s",
location,
FILE_SEPARATOR,
- INSTALLED_AUTHZ_LIB_DIR,
- DEFAULT_AUTHZ_LIB_FILE_BASE,
- flavor,
- DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
+ INSTALLED_AUTHZ_LIB_DIR,
+ DEFAULT_AUTHZ_LIB_FILE_BASE,
+ flavor,
+ DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
if(!authz_lib_filename)
{
GLOBUS_GSI_SYSTEM_CONFIG_MALLOC_ERROR;
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
authz_lib_filename);
if(result != GLOBUS_SUCCESS)
@@ -3315,7 +3315,7 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
authz_lib_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_LIB_FILENAME);
@@ -3336,8 +3336,8 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_win32(
home_dir,
FILE_SEPARATOR,
HOME_AUTHZ_LIB_FILE_BASE,
- flavor,
- DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
+ flavor,
+ DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
if(!authz_lib_filename)
{
GLOBUS_GSI_SYSTEM_CONFIG_MALLOC_ERROR;
@@ -3436,7 +3436,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_win32(
}
}
else
- {
+ {
gaa_filename = globus_common_create_string(
"%s",
DEFAULT_GAA_FILE);
@@ -3457,7 +3457,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_win32(
gaa_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_GAA_FILENAME);
@@ -3493,7 +3493,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_win32(
gaa_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_GAA_FILENAME);
@@ -3576,7 +3576,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_win32(
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_is_superuser_win32(
int * is_superuser)
@@ -3609,12 +3609,16 @@ globus_gsi_sysconfig_is_superuser_win32(
*
* @param signing_policy_filename
* The resulting singing_policy filename
- * @return
+ * @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
*/
globus_result_t
globus_gsi_sysconfig_get_signing_policy_filename_win32(
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_NAME * ca_name,
+#else
+ const X509_NAME * ca_name,
+#endif
char * cert_dir,
char ** signing_policy_filename)
{
@@ -3655,7 +3659,7 @@ globus_gsi_sysconfig_get_signing_policy_filename_win32(
hash = X509_NAME_hash(ca_name);
signing_policy = globus_common_create_string(
- "%s%s%08lx%s",
+ "%s%s%08lx%s",
ca_cert_dir, FILE_SEPARATOR, hash, SIGNING_POLICY_FILE_EXTENSION);
if(signing_policy == NULL)
@@ -3718,7 +3722,7 @@ globus_gsi_sysconfig_set_key_permissions_unix(
char * filename)
{
globus_result_t result = GLOBUS_SUCCESS;
- int fd = -1;
+ int fd = -1;
mode_t oldmask;
struct stat stx, stx2;
@@ -3726,7 +3730,7 @@ globus_gsi_sysconfig_set_key_permissions_unix(
oldmask = globus_libc_umask(0077);
if((fd = globus_libc_open(
- filename, O_RDONLY|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR)) < 0)
+ filename, O_RDONLY|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR)) < 0)
{
result = globus_error_put(
globus_error_wrap_errno_error(
@@ -3755,8 +3759,8 @@ globus_gsi_sysconfig_set_key_permissions_unix(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx, sizeof(stx), 2);
@@ -3803,7 +3807,7 @@ globus_gsi_sysconfig_set_key_permissions_unix(
__FILE__,
__func__,
__LINE__,
- "Error setting permissions to user read only of file: %s\n",
+ "Error setting permissions to user read only of file: %s\n",
filename));
goto exit;
}
@@ -3811,7 +3815,7 @@ globus_gsi_sysconfig_set_key_permissions_unix(
exit:
if (fd >= 0)
{
- close(fd);
+ close(fd);
}
globus_libc_umask(oldmask);
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
@@ -3823,7 +3827,7 @@ globus_gsi_sysconfig_set_key_permissions_unix(
* @ingroup globus_gsi_sysconfig_unix
* @details
* Get a unique string representing the current user. This is just
- * the uid converted to a string.
+ * the uid converted to a string.
*
* @param user_id_string
* A unique string representing the user
@@ -3950,7 +3954,7 @@ globus_gsi_sysconfig_get_username_unix(
goto exit;
}
- strncpy(*username, pwd_result->pw_name,
+ strncpy(*username, pwd_result->pw_name,
strlen(pwd_result->pw_name) + 1);
exit:
@@ -3969,7 +3973,7 @@ globus_gsi_sysconfig_get_username_unix(
* @ingroup globus_gsi_sysconfig_unix
* @details
* Get a unique string representing the current process. This is just
- * the pid converted to a string.
+ * the pid converted to a string.
*
* @param proc_id_string
* A unique string representing the process
@@ -4017,9 +4021,9 @@ globus_gsi_sysconfig_get_proc_id_string_unix(
* on the current working directory.
*
* @param filename
- * the filename to get the absolute path of.
+ * the filename to get the absolute path of.
* @param absolute_path
- * The resulting absolute path. This needs to
+ * The resulting absolute path. This needs to
* be freed when no longer needed.
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise
@@ -4093,13 +4097,13 @@ globus_gsi_sysconfig_make_absolute_path_for_filename_unix(
* The filename to split. Splits on the last occurrence of '/'
* where the directory is everything before the last '/', and
* the filename is everything after.
- * @param dir_string
+ * @param dir_string
* The directory portion of the filename string. If no '/' is found
* throughout the string, this variable points to NULL.
* This needs to be freed when no longer needed.
* @param filename_string
* The filename portion of the filename string. If no '/' is found
- * throughout, this variable is a duplicate of the full_filename
+ * throughout, this variable is a duplicate of the full_filename
* parameter. This needs to be freed when no longer needed.
*
* @return
@@ -4134,8 +4138,8 @@ globus_gsi_sysconfig_split_dir_and_filename_unix(
goto exit;
}
- globus_libc_snprintf(*filename_string, filename_string_length,
- "%s", full_filename);
+ globus_libc_snprintf(*filename_string, filename_string_length,
+ "%s", full_filename);
}
else
{
@@ -4181,7 +4185,7 @@ globus_gsi_sysconfig_split_dir_and_filename_unix(
* @brief UNIX - Get Current Working Directory
* @ingroup globus_gsi_sysconfig_unix
* @details
- * Get the current working directory on the system.
+ * Get the current working directory on the system.
*
* @param working_dir
* The current working directory
@@ -4223,7 +4227,7 @@ globus_gsi_sysconfig_get_current_working_dir_unix(
}
else if(!result_buffer)
{
- result =
+ result =
globus_error_put(globus_error_wrap_errno_error(
GLOBUS_GSI_SYSCONFIG_MODULE,
errno,
@@ -4319,7 +4323,7 @@ globus_gsi_sysconfig_get_home_dir_unix(
temp_home_dir = malloc(strlen(pwd_result->pw_dir) + 1);
if(temp_home_dir)
{
- strncpy(temp_home_dir, pwd_result->pw_dir,
+ strncpy(temp_home_dir, pwd_result->pw_dir,
strlen(pwd_result->pw_dir) + 1);
result = GLOBUS_GSI_SYSCONFIG_DIR_EXISTS(temp_home_dir);
@@ -4389,7 +4393,7 @@ globus_gsi_sysconfig_file_exists_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_DOES_NOT_EXIST,
- (_GSSL("%s is not a valid file"), filename));
+ (_GSSL("%s is not a valid file"), filename));
goto exit;
case EACCES:
@@ -4397,7 +4401,7 @@ globus_gsi_sysconfig_file_exists_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS,
- (_GSSL("Could not read %s"), filename));
+ (_GSSL("Could not read %s"), filename));
goto exit;
default:
@@ -4417,8 +4421,8 @@ globus_gsi_sysconfig_file_exists_unix(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
@@ -4427,16 +4431,16 @@ globus_gsi_sysconfig_file_exists_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
goto exit;
}
if(stx.st_mode & S_IFDIR)
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_IS_DIR,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
}
else if((stx.st_mode & S_IFMT) &
~ (S_IFREG | S_IFLNK | S_IFDIR))
@@ -4451,7 +4455,7 @@ globus_gsi_sysconfig_file_exists_unix(
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
return result;
-}
+}
/**
* @brief UNIX - Directory Exists
@@ -4485,7 +4489,7 @@ globus_gsi_sysconfig_dir_exists_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_DOES_NOT_EXIST,
- (_GSSL("%s is not a valid directory"), filename));
+ (_GSSL("%s is not a valid directory"), filename));
goto exit;
case EACCES:
@@ -4493,7 +4497,7 @@ globus_gsi_sysconfig_dir_exists_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS,
- (_GSSL("Could not read %s"), filename));
+ (_GSSL("Could not read %s"), filename));
goto exit;
default:
@@ -4513,39 +4517,39 @@ globus_gsi_sysconfig_dir_exists_unix(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
if(!(stx.st_mode & S_IFDIR))
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_NOT_DIR,
- (_GSSL("%s is not a directory"), filename));
+ (_GSSL("%s is not a directory"), filename));
}
exit:
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
return result;
-}
+}
/**
* @brief UNIX - Check File Status for Key
* @ingroup globus_gsi_sysconfig_unix
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* private key file. The desired status is only the current user has
* ownership and read permissions, everyone else should not be able
* to access it.
- *
+ *
* @param filename
* The name of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -4562,17 +4566,17 @@ globus_gsi_sysconfig_check_keyfile_unix(
* @brief UNIX - Check File Status for Key
* @ingroup globus_gsi_sysconfig_unix
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* private key file. The desired status is only the specified user has
* ownership and read permissions, everyone else should not be able
* to access it.
- *
+ *
* @param filename
* The name of the file to check the status of
* @param uid
* The owner of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -4613,7 +4617,7 @@ globus_gsi_sysconfig_check_keyfile_uid_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_BAD_PERMISSIONS,
- (_GSSL("Could not read %s"), filename));
+ (_GSSL("Could not read %s"), filename));
goto exit;
default:
@@ -4632,8 +4636,8 @@ globus_gsi_sysconfig_check_keyfile_uid_unix(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
@@ -4642,17 +4646,17 @@ globus_gsi_sysconfig_check_keyfile_uid_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_NOT_OWNED,
- (_GSSL("%s is not owned by current user"), filename));
+ (_GSSL("%s is not owned by current user"), filename));
goto exit;
}
/* check that the key file is not x by user, or rwx by group or others */
- if (stx.st_mode & (S_IXUSR |
+ if (stx.st_mode & (S_IXUSR |
S_IRGRP | S_IWGRP | S_IXGRP |
S_IROTH | S_IWOTH | S_IXOTH))
{
GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF(
- 2, (stderr, "checkstat:%s:mode:%o\n", filename, stx.st_mode));
+ 2, (stderr, "checkstat:%s:mode:%o\n", filename, stx.st_mode));
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
@@ -4666,7 +4670,7 @@ globus_gsi_sysconfig_check_keyfile_uid_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
goto exit;
}
@@ -4675,7 +4679,7 @@ globus_gsi_sysconfig_check_keyfile_uid_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_IS_DIR,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
}
else if((stx.st_mode & S_IFMT)
& ~(S_IFLNK | S_IFREG | S_IFDIR))
@@ -4698,15 +4702,15 @@ globus_gsi_sysconfig_check_keyfile_uid_unix(
* @brief UNIX - Check File Status for Cert
* @ingroup globus_gsi_sysconfig_unix
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* certificate file. The desired status is the current user has
* ownership and read/write permissions, while group and others only
* have read permissions.
- *
+ *
* @param filename
* The name of the file to check the status of
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -4724,17 +4728,17 @@ globus_gsi_sysconfig_check_certfile_unix(
* @brief UNIX - Check File Status for Cert
* @ingroup globus_gsi_sysconfig_unix
* @details
- * This is a convenience function used to check the status of a
+ * This is a convenience function used to check the status of a
* certificate file. The desired status is the current user has
* ownership and read/write permissions, while group and others only
* have read permissions.
- *
+ *
* @param filename
* The name of the file to check the status of
* @param uid
* The user id that may be the owner of the file
*
- * @return
+ * @return
* GLOBUS_SUCCESS if the status of the file was able
* to be determined. Otherwise, an error object
* identifier
@@ -4793,8 +4797,8 @@ globus_gsi_sysconfig_check_certfile_uid_unix(
}
/*
- * use any stat output as random data, as it will
- * have file sizes, and last use times in it.
+ * use any stat output as random data, as it will
+ * have file sizes, and last use times in it.
*/
RAND_add((void*)&stx,sizeof(stx),2);
@@ -4803,7 +4807,7 @@ globus_gsi_sysconfig_check_certfile_uid_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_NOT_OWNED,
- (_GSSL("%s is not owned by current user"), filename));
+ (_GSSL("%s is not owned by current user"), filename));
goto exit;
}
@@ -4827,7 +4831,7 @@ globus_gsi_sysconfig_check_certfile_uid_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_FILE_ZERO_LENGTH,
- (_GSSL("File: %s"), filename));
+ (_GSSL("File: %s"), filename));
goto exit;
}
@@ -4869,10 +4873,10 @@ globus_gsi_sysconfig_check_certfile_uid_unix(
* certificates.
*
$HOME/.globus/certificates - If this
* directory exists, and the previous methods of determining the trusted
- * certs directory failed, this directory will be used.
+ * certs directory failed, this directory will be used.
*
/etc/grid-security/certificates - This location is intended
- * to be independent of the globus installation ($GLOBUS_LOCATION), and
- * is generally only writeable by the host system administrator.
+ * to be independent of the globus installation ($GLOBUS_LOCATION), and
+ * is generally only writeable by the host system administrator.
*
$GLOBUS_LOCATION/share/certificates
*
*
@@ -4880,7 +4884,7 @@ globus_gsi_sysconfig_check_certfile_uid_unix(
* The trusted certificates directory
* @return
* GLOBUS_SUCCESS if no error occurred, and a sufficient trusted
- * certificates directory was found. Otherwise, an error object
+ * certificates directory was found. Otherwise, an error object
* identifier returned.
*/
globus_result_t
@@ -4903,7 +4907,7 @@ globus_gsi_sysconfig_get_cert_dir_unix(
if(getenv(X509_CERT_DIR))
{
result = globus_i_gsi_sysconfig_create_cert_dir_string(
- cert_dir,
+ cert_dir,
& env_cert_dir,
"%s",
getenv(X509_CERT_DIR));
@@ -4922,9 +4926,9 @@ globus_gsi_sysconfig_get_cert_dir_unix(
result = GLOBUS_GSI_SYSCONFIG_GET_HOME_DIR(&home);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_cert_dir_string(
- cert_dir,
+ cert_dir,
&local_cert_dir,
"%s%s%s",
home,
@@ -4951,7 +4955,7 @@ globus_gsi_sysconfig_get_cert_dir_unix(
else if(!GLOBUS_GSI_SYSCONFIG_FILE_DOES_NOT_EXIST(result) &&
!GLOBUS_GSI_SYSCONFIG_FILE_HAS_BAD_PERMISSIONS(result))
{
- home = NULL;
+ home = NULL;
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_DIR);
@@ -5044,7 +5048,7 @@ globus_gsi_sysconfig_get_cert_dir_unix(
}
GLOBUS_I_GSI_SYSCONFIG_DEBUG_FPRINTF(
- 2, (stderr, "Using cert_dir = %s\n",
+ 2, (stderr, "Using cert_dir = %s\n",
(*cert_dir ? *cert_dir : "null")));
result = GLOBUS_SUCCESS;
@@ -5058,7 +5062,7 @@ globus_gsi_sysconfig_get_cert_dir_unix(
if(home != NULL)
{
- free(home);
+ free(home);
}
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
@@ -5073,10 +5077,10 @@ globus_gsi_sysconfig_get_cert_dir_unix(
* Get the User Certificate Filename based on the current user's
* environment. The following locations are searched for cert and key
* files in order:
- *
+ *
*
*
environment variables X509_USER_CERT and X509_USER_KEY
- *
$HOME/.globus/usercert.pem and
+ *
$HOME/.globus/usercert.pem and
* $HOME/.globus/userkey.pem
*
$HOME/.globus/usercred.p12 - this is a PKCS12 credential
*
@@ -5124,7 +5128,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
goto done;
- }
+ }
}
if(!(*user_cert))
@@ -5161,7 +5165,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
}
if(user_key)
- {
+ {
*user_key = NULL;
result = GLOBUS_SUCCESS;
@@ -5225,7 +5229,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
{
result = GLOBUS_SUCCESS;
if(!home)
- {
+ {
result = GLOBUS_GSI_SYSCONFIG_GET_HOME_DIR(&home);
}
@@ -5254,7 +5258,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_KEY_STRING);
- goto done;
+ goto done;
}
}
@@ -5309,7 +5313,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
* @ingroup globus_gsi_sysconfig_unix
* @details
* Get the Host Certificate and Key Filenames based on the current user's
- * environment. The host cert and key are searched for in the following
+ * environment. The host cert and key are searched for in the following
* locations (in order):
*
*
@@ -5317,7 +5321,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
*
$GLOBUS_LOCATION/etc/host[cert|key].pem
*
$HOME/.globus/host[cert|key].pem
*
- *
+ *
* @param host_cert
* pointer to the host certificate filename
* @param host_key
@@ -5325,7 +5329,7 @@ globus_gsi_sysconfig_get_user_cert_filename_unix(
*
* @return
* GLOBUS_SUCCESS if the host cert and key were found, otherwise
- * an error object identifier is returned
+ * an error object identifier is returned
*/
globus_result_t
globus_gsi_sysconfig_get_host_cert_filename_unix(
@@ -5393,7 +5397,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
host_key,
& default_host_key,
@@ -5421,7 +5425,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
}
/* now check installed location for host cert */
- if(!(*host_cert) && !(*host_key))
+ if(!(*host_cert) && !(*host_key))
{
globus_location(&location);
@@ -5439,7 +5443,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
host_key,
&installed_host_key,
@@ -5469,7 +5473,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
}
}
- if(!(*host_cert) && !(*host_key))
+ if(!(*host_cert) && !(*host_key))
{
result = GLOBUS_GSI_SYSCONFIG_GET_HOME_DIR(&home);
@@ -5487,7 +5491,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
host_key,
& local_host_key,
@@ -5570,7 +5574,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
* @ingroup globus_gsi_sysconfig_unix
* @details
* Get the Service Certificate Filename based on the current user's
- * environment. The host cert and key are searched for in the following
+ * environment. The host cert and key are searched for in the following
* locations (in order):
*
*
@@ -5578,11 +5582,11 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
*
GLOBUS_LOCATION\/etc\/{service_name}\/{service_name}[cert|key].pem
* So for example, if my service was named: myservice, the location
- * of the certificate would be:
+ * of the certificate would be:
* GLOBUS_LOCATION\/etc\/myservice\/myservicecert.pem
*
- *
+ *
* @param service_name
* The name of the service which allows us to determine the
* locations of cert and key files to look for
@@ -5593,7 +5597,7 @@ globus_gsi_sysconfig_get_host_cert_filename_unix(
*
* @return
* GLOBUS_SUCCESS if the service cert and key were found, otherwise
- * an error object identifier
+ * an error object identifier
*/
globus_result_t
globus_gsi_sysconfig_get_service_cert_filename_unix(
@@ -5638,7 +5642,7 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
getenv(X509_USER_CERT));
if(result != GLOBUS_SUCCESS)
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
@@ -5679,7 +5683,7 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
service_key,
& default_service_key,
@@ -5705,7 +5709,7 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
- goto done;
+ goto done;
}
}
else if(!GLOBUS_GSI_SYSCONFIG_FILE_DOES_NOT_EXIST(result))
@@ -5739,7 +5743,7 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
service_key,
&installed_service_key,
@@ -5795,7 +5799,7 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
X509_CERT_SUFFIX);
if(result == GLOBUS_SUCCESS)
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
service_key,
&local_service_key,
@@ -5831,7 +5835,7 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_CERT_STRING);
home = NULL;
- goto done;
+ goto done;
}
}
@@ -5887,22 +5891,22 @@ globus_gsi_sysconfig_get_service_cert_filename_unix(
* @details
* Get the proxy cert filename based on the following
* search order:
- *
+ *
*
*
X509_USER_PROXY environment variable - This environment variable
* is set by the at run time for the specific application. If
* the proxy_file_type variable is set to GLOBUS_PROXY_OUTPUT
- * (a proxy filename for writing is requested),
- * and the X509_USER_PROXY is set, this will be the
+ * (a proxy filename for writing is requested),
+ * and the X509_USER_PROXY is set, this will be the
* resulting value of the user_proxy filename string passed in. If the
- * proxy_file_type is set to GLOBUS_PROXY_INPUT and X509_USER_PROXY is
- * set, but the file it points to does not exist,
- * or has some other readability issues, the
+ * proxy_file_type is set to GLOBUS_PROXY_INPUT and X509_USER_PROXY is
+ * set, but the file it points to does not exist,
+ * or has some other readability issues, the
* function will continue checking using the other methods available.
- *
+ *
*
Check the default location for the proxy file of
* \/tmp\/x509_u\\ where \\ is some unique string for
- * that user on the host
+ * that user on the host
*
*
* @param user_proxy
@@ -5941,7 +5945,7 @@ globus_gsi_sysconfig_get_proxy_filename_unix(
}
}
else
- {
+ {
result = globus_i_gsi_sysconfig_create_key_string(
user_proxy,
&env_user_proxy,
@@ -6005,7 +6009,7 @@ globus_gsi_sysconfig_get_proxy_filename_unix(
if(!(*user_proxy))
{
- GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
+ GLOBUS_GSI_SYSCONFIG_ERROR_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_PROXY_FILENAME,
(_GSSL("A file location for%s the proxy cert could not be found in: \n"
@@ -6052,12 +6056,16 @@ globus_gsi_sysconfig_get_proxy_filename_unix(
*
* @param signing_policy_filename
* The resulting singing_policy filename
- * @return
+ * @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
*/
globus_result_t
globus_gsi_sysconfig_get_signing_policy_filename_unix(
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_NAME * ca_name,
+#else
+ const X509_NAME * ca_name,
+#endif
char * cert_dir,
char ** signing_policy_filename)
{
@@ -6098,7 +6106,7 @@ globus_gsi_sysconfig_get_signing_policy_filename_unix(
hash = X509_NAME_hash(ca_name);
signing_policy = globus_common_create_string(
- "%s%s%08lx%s",
+ "%s%s%08lx%s",
ca_cert_dir, FILE_SEPARATOR, hash, SIGNING_POLICY_FILE_EXTENSION);
if(signing_policy == NULL)
@@ -6141,19 +6149,19 @@ globus_gsi_sysconfig_get_signing_policy_filename_unix(
* @brief UNIX - Get CA Cert Filenames
* @ingroup globus_gsi_sysconfig_unix
* @details
- * Gets a list of trusted CA certificate filenames in
- * a trusted CA certificate directory.
+ * Gets a list of trusted CA certificate filenames in
+ * a trusted CA certificate directory.
*
* @param ca_cert_dir
* The trusted CA certificate directory to get the filenames from
* @param ca_cert_list
* The resulting list of CA certificate filenames. This is a
- * a globus list structure.
+ * a globus list structure.
* @see globus_fifo_t
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_get_ca_cert_files_unix(
char * ca_cert_dir,
@@ -6207,14 +6215,14 @@ globus_gsi_sysconfig_get_ca_cert_files_unix(
{
file_length = strlen(tmp_entry->d_name);
/* check the following:
- *
+ *
* - file length is greater than or equal to 10
* - first 8 characters are alpha-numeric
* - 9th character is '.'
* - characters after the '.' are numeric
*/
- full_filename_path =
+ full_filename_path =
globus_common_create_string(
"%s%s%s", ca_cert_dir, FILE_SEPARATOR, tmp_entry->d_name);
@@ -6238,9 +6246,9 @@ globus_gsi_sysconfig_get_ca_cert_files_unix(
if(file_length >= (X509_HASH_LENGTH + 2) &&
(*(tmp_entry->d_name + X509_HASH_LENGTH) == '.') &&
- (strspn(tmp_entry->d_name, "0123456789abcdefABCDEF")
+ (strspn(tmp_entry->d_name, "0123456789abcdefABCDEF")
== X509_HASH_LENGTH) &&
- (strspn((tmp_entry->d_name + (X509_HASH_LENGTH + 1)),
+ (strspn((tmp_entry->d_name + (X509_HASH_LENGTH + 1)),
"0123456789") == (file_length - 9)))
{
globus_fifo_enqueue(ca_cert_list, (void *)full_filename_path);
@@ -6269,7 +6277,7 @@ globus_gsi_sysconfig_get_ca_cert_files_unix(
if(tmp_entry != NULL)
{
- globus_libc_free(tmp_entry);
+ globus_libc_free(tmp_entry);
}
GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT;
@@ -6290,7 +6298,7 @@ globus_gsi_sysconfig_get_ca_cert_files_unix(
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_remove_all_owned_files_unix(
char * default_filename)
@@ -6322,7 +6330,7 @@ globus_gsi_sysconfig_remove_all_owned_files_unix(
while(globus_libc_readdir_r(secure_tmp_dir, &dir_entry) == 0 &&
dir_entry != NULL)
{
- if((default_filename &&
+ if((default_filename &&
!strcmp(dir_entry->d_name, default_filename)) ||
!strncmp(dir_entry->d_name,
X509_UNIQUE_PROXY_FILE,
@@ -6350,11 +6358,11 @@ globus_gsi_sysconfig_remove_all_owned_files_unix(
= "DESTROYED BY GLOBUS\r\n";
int f = open(full_filename, O_RDWR);
int size, rec, left;
- if (f)
+ if (f)
{
size = lseek(f, 0L, SEEK_END);
lseek(f, 0L, SEEK_SET);
- if (size > 0)
+ if (size > 0)
{
rec = size / 64;
left = size - rec * 64;
@@ -6364,7 +6372,7 @@ globus_gsi_sysconfig_remove_all_owned_files_unix(
rec--;
}
if (left)
- {
+ {
write(f, msg, left);
}
}
@@ -6401,7 +6409,7 @@ globus_gsi_sysconfig_remove_all_owned_files_unix(
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_is_superuser_unix(
int * is_superuser)
@@ -6437,7 +6445,7 @@ globus_gsi_sysconfig_is_superuser_unix(
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_get_gridmap_filename_unix(
char ** filename)
@@ -6502,7 +6510,7 @@ globus_gsi_sysconfig_get_gridmap_filename_unix(
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_GRIDMAP_FILENAME);
- goto exit;
+ goto exit;
}
}
}
@@ -6535,15 +6543,15 @@ globus_gsi_sysconfig_get_gridmap_filename_unix(
* @ingroup globus_gsi_sysconfig_unix
* @details
* Get the path and file name of the authorization callback
- * configuration file
+ * configuration file
*
* @param filename
* Contains the location of the authorization callback configuration
- * file upon successful return
+ * file upon successful return
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_get_authz_conf_filename_unix(
char ** filename)
@@ -6579,7 +6587,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_unix(
}
}
else
- {
+ {
authz_filename = globus_common_create_string(
"%s",
DEFAULT_AUTHZ_FILE);
@@ -6600,7 +6608,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_unix(
authz_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_FILENAME);
@@ -6636,7 +6644,7 @@ globus_gsi_sysconfig_get_authz_conf_filename_unix(
authz_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_FILENAME);
@@ -6707,19 +6715,19 @@ globus_gsi_sysconfig_get_authz_conf_filename_unix(
}
/**
- * @brief UNIX - Get the path and file name of the authorization callback configuration file
+ * @brief UNIX - Get the path and file name of the authorization callback configuration file
* @ingroup globus_gsi_sysconfig_unix
* @details
* Get the path and file name of the authorization callback
- * configuration file
+ * configuration file
*
* @param filename
* Contains the location of the authorization callback configuration
- * file upon successful return
+ * file upon successful return
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
char ** filename)
@@ -6754,12 +6762,12 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
}
}
else
- {
+ {
authz_lib_filename = globus_common_create_string(
"%s%s_%s%s",
- DEFAULT_AUTHZ_LIB_FILE_DIR,
- DEFAULT_AUTHZ_LIB_FILE_BASE,
- flavor,
+ DEFAULT_AUTHZ_LIB_FILE_DIR,
+ DEFAULT_AUTHZ_LIB_FILE_BASE,
+ flavor,
DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
if(!authz_lib_filename)
{
@@ -6777,7 +6785,7 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
authz_lib_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_LIB_FILENAME);
@@ -6795,17 +6803,17 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
"%s%s%s%s_%s%s",
location,
FILE_SEPARATOR,
- INSTALLED_AUTHZ_LIB_DIR,
- DEFAULT_AUTHZ_LIB_FILE_BASE,
- flavor,
- DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
+ INSTALLED_AUTHZ_LIB_DIR,
+ DEFAULT_AUTHZ_LIB_FILE_BASE,
+ flavor,
+ DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
if(!authz_lib_filename)
{
GLOBUS_GSI_SYSTEM_CONFIG_MALLOC_ERROR;
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(authz_lib_filename);
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(authz_lib_filename);
if(result != GLOBUS_SUCCESS)
{
@@ -6815,7 +6823,7 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
authz_lib_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_AUTHZ_LIB_FILENAME);
@@ -6836,8 +6844,8 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
home_dir,
FILE_SEPARATOR,
HOME_AUTHZ_LIB_FILE_BASE,
- flavor,
- DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
+ flavor,
+ DEFAULT_AUTHZ_LIB_FILE_EXTENSION);
if(!authz_lib_filename)
{
GLOBUS_GSI_SYSTEM_CONFIG_MALLOC_ERROR;
@@ -6887,18 +6895,18 @@ globus_gsi_sysconfig_get_authz_lib_conf_filename_unix(
}
/**
- * @brief UNIX - Get the path and file name of the gaa configuration file
+ * @brief UNIX - Get the path and file name of the gaa configuration file
* @ingroup globus_gsi_sysconfig_unix
* @details
- * Get the path and file name of the GAA configuration file
+ * Get the path and file name of the GAA configuration file
*
* @param filename
* Contains the location of the GAA callback configuration
- * file upon successful return
+ * file upon successful return
* @return
* GLOBUS_SUCCESS if no error occurred, otherwise an error object ID
* is returned
- */
+ */
globus_result_t
globus_gsi_sysconfig_get_gaa_conf_filename_unix(
char ** filename)
@@ -6922,7 +6930,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
gaa_filename);
if(result != GLOBUS_SUCCESS)
@@ -6934,7 +6942,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
}
}
else
- {
+ {
gaa_filename = globus_common_create_string(
"%s",
DEFAULT_GAA_FILE);
@@ -6944,7 +6952,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
gaa_filename);
if(result != GLOBUS_SUCCESS)
@@ -6955,7 +6963,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
gaa_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_GAA_FILENAME);
@@ -6980,7 +6988,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
goto exit;
}
- result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
+ result = GLOBUS_GSI_SYSCONFIG_FILE_EXISTS(
gaa_filename);
if(result != GLOBUS_SUCCESS)
@@ -6991,7 +6999,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
gaa_filename = NULL;
}
else
- {
+ {
GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
result,
GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_GAA_FILENAME);
@@ -7069,7 +7077,7 @@ globus_gsi_sysconfig_get_gaa_conf_filename_unix(
* Get a unique proxy cert filename. This is mostly used
* for delegated proxy credentials. Each filename returned
* is going to be unique for each time the function is called.
- *
+ *
* @param unique_filename
* the unique filename for a delegated proxy cert
*
@@ -7317,7 +7325,7 @@ globus_gsi_sysconfig_get_vhost_cred_dir(
/* globus_gsi_sysconfig_get_vhost_cred_dir() */
-/*
+/*
* Windows Default Directory And File Routines
*/
#ifdef WIN32
@@ -7354,7 +7362,7 @@ const char *win32_cwd(void)
char * cwd = NULL;
static char buffer[MAX_PATH];
- /* Collect environment all variables we might need */
+ /* Collect environment all variables we might need */
tmp_path = getenv("TMP");
temp_path = getenv("TEMP");
globus_location(&location);
@@ -7364,17 +7372,17 @@ const char *win32_cwd(void)
{
return location;
}
- else if(cwd)
+ else if(cwd)
{
return buffer;
}
- /* Use $TMP */
- else if(tmp_path)
+ /* Use $TMP */
+ else if(tmp_path)
{
return tmp_path;
}
- /* Use $TEMP */
- else if(temp_path)
+ /* Use $TEMP */
+ else if(temp_path)
{
return temp_path;
}
diff --git a/gsi/sysconfig/source/library/globus_gsi_system_config.h b/gsi/sysconfig/source/library/globus_gsi_system_config.h
index 07bee399f4..d9b9886dd6 100644
--- a/gsi/sysconfig/source/library/globus_gsi_system_config.h
+++ b/gsi/sysconfig/source/library/globus_gsi_system_config.h
@@ -76,7 +76,7 @@ extern "C" {
*/
/**
- * @defgroup globus_gsi_sysconfig_win32 Functions for Win32 platforms
+ * @defgroup globus_gsi_sysconfig_win32 Functions for Win32 platforms
* @ingroup globus_gsi_sysconfig
* @brief Functions for Win32 platforms
*
@@ -91,7 +91,7 @@ extern "C" {
* @brief Functions for all platforms
*
* These functions are platform independent members of the Globus GSI System
- * Configuration API.
+ * Configuration API.
*
*/
@@ -137,14 +137,14 @@ extern "C" {
* subsequently called. This function may be called multiple times.
*
* To deactivate Globus GSI System Configuration API, the following function
- * must be called:
+ * must be called:
*
* @code
* globus_module_deactivate(GLOBUS_GSI_SYSCONFIG_MODULE)
* @endcode
*
* This function should be called once for each time Globus GSI System
- * Configuration API was activated.
+ * Configuration API was activated.
*/
/** Module descriptor
@@ -153,7 +153,7 @@ extern "C" {
*/
#define GLOBUS_GSI_SYSCONFIG_MODULE (&globus_i_gsi_sysconfig_module)
-extern
+extern
globus_module_descriptor_t globus_i_gsi_sysconfig_module;
#ifdef WIN32
@@ -340,7 +340,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
globus_gsi_sysconfig_get_signing_policy_filename_unix
/**
* Get a list of of trusted CA certificate filenames in a trusted CA
- * certificate directory.
+ * certificate directory.
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
* See globus_gsi_sysconfig_get_ca_cert_files_unix() and
@@ -376,7 +376,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
# define GLOBUS_GSI_SYSCONFIG_SPLIT_DIR_AND_FILENAME \
globus_gsi_sysconfig_split_dir_and_filename_unix
/**
- * Remove all proxies owned by current uid
+ * Remove all proxies owned by current uid
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
* See globus_gsi_sysconfig_remove_all_owned_files_unix() and
@@ -385,7 +385,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
# define GLOBUS_GSI_SYSCONFIG_REMOVE_ALL_OWNED_FILES \
globus_gsi_sysconfig_remove_all_owned_files_unix
/**
- * Determine the location of the grid map file.
+ * Determine the location of the grid map file.
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
* See globus_gsi_sysconfig_get_gridmap_filename_unix() and
@@ -394,7 +394,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
# define GLOBUS_GSI_SYSCONFIG_GET_GRIDMAP_FILENAME \
globus_gsi_sysconfig_get_gridmap_filename_unix
/**
- * Determine the location of the authorization callout config file.
+ * Determine the location of the authorization callout config file.
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
* See globus_gsi_sysconfig_get_authz_conf_filename_unix()
@@ -403,7 +403,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
globus_gsi_sysconfig_get_authz_conf_filename_unix
/**
- * Determine the location of the GAA callout config file.
+ * Determine the location of the GAA callout config file.
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
* See globus_gsi_sysconfig_get_gaa_conf_filename_unix()
@@ -438,7 +438,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
# define GLOBUS_GSI_SYSCONFIG_GET_PROC_ID_STRING \
globus_gsi_sysconfig_get_proc_id_string_unix
/**
- * Get the current user name
+ * Get the current user name
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
* See globus_gsi_sysconfig_get_username_unix() and
@@ -452,7 +452,7 @@ globus_module_descriptor_t globus_i_gsi_sysconfig_module;
* Generate a unique proxy file name
* @ingroup globus_gsi_system_config_defines
* @hideinitializer
- * See globus_gsi_sysconfig_get_unique_proxy_filename()
+ * See globus_gsi_sysconfig_get_unique_proxy_filename()
*/
#define GLOBUS_GSI_SYSCONFIG_GET_UNIQUE_PROXY_FILENAME \
globus_gsi_sysconfig_get_unique_proxy_filename
@@ -527,7 +527,11 @@ GLOBUS_GSI_SYSCONFIG_GET_PROXY_FILENAME(
globus_result_t
GLOBUS_GSI_SYSCONFIG_GET_SIGNING_POLICY_FILENAME(
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_NAME * ca_name,
+#else
+ const X509_NAME * ca_name,
+#endif
char * cert_dir,
char ** signing_policy_filename);
diff --git a/io/compat/configure.ac b/io/compat/configure.ac
index c6ac4c7061..23bec1a8d3 100644
--- a/io/compat/configure.ac
+++ b/io/compat/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_io],[12.4],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_io],[12.5],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/io/compat/globus_io_xio_compat.c b/io/compat/globus_io_xio_compat.c
index 84cf6264d2..5cda082321 100644
--- a/io/compat/globus_io_xio_compat.c
+++ b/io/compat/globus_io_xio_compat.c
@@ -138,8 +138,8 @@ typedef struct globus_l_io_secure_authorization_data_s
{
gss_name_t identity;
globus_io_secure_authorization_callback_t callback;
- void * callback_arg;
-} globus_l_io_secure_authorization_data_t;
+ void * callback_arg;
+} globus_l_io_secure_authorization_data_t;
typedef struct globus_l_io_attr_s
{
@@ -162,12 +162,12 @@ typedef struct globus_l_io_handle_s
globus_io_handle_t * io_handle;
globus_xio_handle_t xio_handle;
globus_callback_space_t space;
-
+
globus_list_t * pending_ops;
globus_mutex_t pending_lock;
void * user_pointer;
globus_io_attr_t attr;
-
+
/* used only for listener */
globus_xio_server_t xio_server;
globus_xio_handle_t accepted_handle;
@@ -247,7 +247,7 @@ int
globus_l_io_activate(void)
{
globus_result_t result;
-
+
if(globus_module_activate(GLOBUS_XIO_MODULE) != GLOBUS_SUCCESS)
{
goto error_activate;
@@ -258,7 +258,7 @@ globus_l_io_activate(void)
{
goto error_load_file;
}
-
+
if(globus_xio_driver_load(
"tcp", &globus_l_io_tcp_driver) != GLOBUS_SUCCESS)
{
@@ -270,78 +270,78 @@ globus_l_io_activate(void)
{
goto error_load_gsi;
}
-
+
result = globus_xio_stack_init(&globus_l_io_file_stack, GLOBUS_NULL);
if(result != GLOBUS_SUCCESS)
{
goto error_file_stack;
}
-
+
result = globus_xio_stack_push_driver(
globus_l_io_file_stack, globus_l_io_file_driver);
if(result != GLOBUS_SUCCESS)
{
goto error_file_push;
}
-
+
result = globus_xio_stack_init(&globus_l_io_tcp_stack, GLOBUS_NULL);
if(result != GLOBUS_SUCCESS)
{
goto error_tcp_stack;
}
-
+
result = globus_xio_stack_push_driver(
globus_l_io_tcp_stack, globus_l_io_tcp_driver);
if(result != GLOBUS_SUCCESS)
{
goto error_tcp_push;
}
-
+
result = globus_xio_stack_init(&globus_l_io_gsi_stack, GLOBUS_NULL);
if(result != GLOBUS_SUCCESS)
{
goto error_gsi_stack;
}
-
+
result = globus_xio_stack_push_driver(
globus_l_io_gsi_stack, globus_l_io_tcp_driver);
if(result != GLOBUS_SUCCESS)
{
goto error_gsi_push;
}
-
+
result = globus_xio_stack_push_driver(
globus_l_io_gsi_stack, globus_l_io_gsi_driver);
if(result != GLOBUS_SUCCESS)
{
goto error_gsi_push;
}
-
+
return GLOBUS_SUCCESS;
error_gsi_push:
globus_xio_stack_destroy(globus_l_io_gsi_stack);
-
+
error_gsi_stack:
error_tcp_push:
globus_xio_stack_destroy(globus_l_io_tcp_stack);
-
+
error_tcp_stack:
error_file_push:
globus_xio_stack_destroy(globus_l_io_file_stack);
-
+
error_file_stack:
globus_xio_driver_unload(globus_l_io_gsi_driver);
-
+
error_load_gsi:
globus_xio_driver_unload(globus_l_io_tcp_driver);
error_load_tcp:
globus_xio_driver_unload(globus_l_io_file_driver);
-
+
error_load_file:
globus_module_deactivate(GLOBUS_XIO_MODULE);
-
+
error_activate:
return GLOBUS_FAILURE;
}
@@ -353,11 +353,11 @@ globus_l_io_deactivate(void)
globus_xio_stack_destroy(globus_l_io_gsi_stack);
globus_xio_stack_destroy(globus_l_io_tcp_stack);
globus_xio_stack_destroy(globus_l_io_file_stack);
-
+
globus_xio_driver_unload(globus_l_io_gsi_driver);
globus_xio_driver_unload(globus_l_io_tcp_driver);
globus_xio_driver_unload(globus_l_io_file_driver);
-
+
return globus_module_deactivate(GLOBUS_XIO_MODULE);
}
@@ -372,13 +372,13 @@ globus_l_io_handle_init(
globus_result_t result;
globus_l_io_handle_t * ihandle;
GlobusIOName(globus_l_io_handle_init);
-
+
result = GlobusLIOMalloc(ihandle, globus_l_io_handle_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
ihandle->type = type;
ihandle->refs = 1;
ihandle->io_handle = io_handle;
@@ -391,11 +391,11 @@ globus_l_io_handle_init(
ihandle->user_pointer = GLOBUS_NULL;
globus_mutex_init(&ihandle->pending_lock, GLOBUS_NULL);
globus_callback_space_reference(ihandle->space);
-
+
*_ihandle = ihandle;
-
+
return GLOBUS_SUCCESS;
-
+
error_alloc:
return result;
}
@@ -407,7 +407,7 @@ globus_l_io_handle_destroy(
{
globus_bool_t destroy;
GlobusIOName(globus_l_io_handle_destroy);
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
if(--ihandle->refs == 0)
@@ -420,7 +420,7 @@ globus_l_io_handle_destroy(
}
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
if(destroy)
{
if(ihandle->attr)
@@ -452,7 +452,7 @@ globus_l_io_attr_check(
const char * func_name)
{
globus_l_io_attr_t * iattr;
-
+
if(!attr)
{
return globus_error_put(
@@ -463,9 +463,9 @@ globus_l_io_attr_check(
1,
(char *) func_name));
}
-
+
iattr = (globus_l_io_attr_t *) *attr;
-
+
if(!iattr || !(iattr->type & types))
{
return globus_error_put(
@@ -476,7 +476,7 @@ globus_l_io_attr_check(
1,
(char *) func_name));
}
-
+
return GLOBUS_SUCCESS;
}
@@ -491,17 +491,17 @@ globus_l_io_iattr_copy(
globus_io_secure_authorization_data_t data;
globus_result_t result;
GlobusIOName(globus_l_io_iattr_copy);
-
+
source_iattr = (globus_l_io_attr_t *) *source;
-
+
result = GlobusLIOMalloc(dest_iattr, globus_l_io_attr_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
memset(dest_iattr, 0, sizeof(globus_l_io_attr_t));
-
+
dest_iattr->type = source_iattr->type;
if(dest_iattr->type == GLOBUS_I_IO_TCP_ATTR)
{
@@ -517,7 +517,7 @@ globus_l_io_iattr_copy(
{
goto error_auth_copy;
}
-
+
dest_iattr->authz_data.identity = data->identity;
dest_iattr->authz_data.callback = data->callback;
dest_iattr->authz_data.callback_arg = data->callback_arg;
@@ -528,7 +528,7 @@ globus_l_io_iattr_copy(
globus_assert(dest_iattr->type == GLOBUS_I_IO_FILE_ATTR);
dest_iattr->file_flags = source_iattr->file_flags;
}
-
+
result = globus_xio_attr_copy(&dest_iattr->attr, source_iattr->attr);
if(result != GLOBUS_SUCCESS)
{
@@ -545,7 +545,7 @@ globus_l_io_iattr_copy(
}
dest_iattr->space = source_iattr->space;
globus_callback_space_reference(dest_iattr->space);
-
+
*dest = dest_iattr;
return GLOBUS_SUCCESS;
@@ -558,10 +558,10 @@ globus_l_io_iattr_copy(
gss_release_name(&minor_status, &dest_iattr->authz_data.identity);
}
-
+
error_auth_copy:
globus_free(dest_iattr);
-
+
error_alloc:
*dest = GLOBUS_NULL;
return result;
@@ -584,9 +584,9 @@ globus_l_io_cancel_precallback(
{
globus_l_io_handle_t * ihandle;
globus_bool_t perform_callback;
-
+
ihandle = bounce_info->handle;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
perform_callback = GLOBUS_TRUE;
@@ -605,7 +605,7 @@ globus_l_io_cancel_precallback(
}
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return perform_callback;
}
@@ -615,9 +615,9 @@ globus_l_io_cancel_kickout(
void * user_arg)
{
globus_l_io_cancel_info_t * cancel_info;
-
+
cancel_info = (globus_l_io_cancel_info_t *) user_arg;
-
+
if(cancel_info->callback)
{
cancel_info->callback(
@@ -625,7 +625,7 @@ globus_l_io_cancel_kickout(
cancel_info->handle,
GLOBUS_SUCCESS);
}
-
+
globus_free(cancel_info);
}
@@ -638,10 +638,10 @@ globus_l_io_cancel_complete(
globus_l_io_cancel_info_t * cancel_info;
globus_bool_t call_cancel;
GlobusIOName(globus_l_io_cancel_complete);
-
+
ihandle = bounce_info->handle;
cancel_info = bounce_info->cancel_info;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
if(cancel_info && --cancel_info->refs == 0)
@@ -654,18 +654,18 @@ globus_l_io_cancel_complete(
}
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
if(call_cancel)
{
globus_callback_space_t space;
-
+
if(ihandle->space != GLOBUS_CALLBACK_GLOBAL_SPACE &&
globus_callback_space_get(&space) == GLOBUS_SUCCESS && (
(cancel_info->blocking && space != GLOBUS_CALLBACK_GLOBAL_SPACE) ||
(!cancel_info->blocking && space != ihandle->space)))
{
globus_result_t result;
-
+
result = globus_callback_space_register_oneshot(
GLOBUS_NULL,
GLOBUS_NULL,
@@ -692,11 +692,11 @@ globus_l_io_cancel_complete(
cancel_info->handle,
GLOBUS_SUCCESS);
}
-
+
globus_free(cancel_info);
}
}
-
+
/* removes reference added in cancel_insert and destroys if necessary */
globus_l_io_handle_destroy(ihandle);
}
@@ -707,7 +707,7 @@ globus_l_io_should_bounce(
globus_l_io_bounce_t * bounce_info)
{
globus_callback_space_t space;
-
+
if(bounce_info->handle->space != GLOBUS_CALLBACK_GLOBAL_SPACE &&
globus_callback_space_get(&space) == GLOBUS_SUCCESS &&
((bounce_info->blocking && space != GLOBUS_CALLBACK_GLOBAL_SPACE) ||
@@ -715,18 +715,18 @@ globus_l_io_should_bounce(
{
return GLOBUS_TRUE;
}
-
+
return GLOBUS_FALSE;
}
static
void
globus_l_io_bounce_io_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t len,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg);
@@ -737,11 +737,11 @@ globus_l_io_bounce_io_kickout(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_bounce_io_kickout);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
globus_l_io_bounce_io_cb(
GLOBUS_NULL,
- bounce_info->error
+ bounce_info->error
? globus_error_put(bounce_info->error) : GLOBUS_SUCCESS,
bounce_info->buffer,
0,
@@ -753,24 +753,24 @@ globus_l_io_bounce_io_kickout(
static
void
globus_l_io_bounce_io_cb(
- globus_xio_handle_t xio_handle,
+ globus_xio_handle_t xio_handle,
globus_result_t result,
globus_byte_t * buffer,
globus_size_t len,
- globus_size_t nbytes,
+ globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
void * user_arg)
{
globus_l_io_bounce_t * bounce_info;
globus_l_io_handle_t * ihandle;
GlobusIOName(globus_l_io_bounce_io_cb);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
ihandle = bounce_info->handle;
-
+
if(globus_l_io_should_bounce(bounce_info))
{
- bounce_info->error = result == GLOBUS_SUCCESS
+ bounce_info->error = result == GLOBUS_SUCCESS
? GLOBUS_NULL : globus_error_get(result);
bounce_info->buffer = buffer;
bounce_info->nbytes = nbytes;
@@ -791,7 +791,7 @@ globus_l_io_bounce_io_cb(
}
return;
}
-
+
if(result != GLOBUS_SUCCESS)
{
if(globus_xio_error_is_eof(result))
@@ -811,7 +811,7 @@ globus_l_io_bounce_io_cb(
ihandle->io_handle));
}
}
-
+
if(globus_l_io_cancel_precallback(bounce_info))
{
bounce_info->cb.read_write(
@@ -821,7 +821,7 @@ globus_l_io_bounce_io_cb(
buffer,
nbytes);
}
-
+
globus_l_io_cancel_complete(bounce_info);
globus_free(bounce_info);
}
@@ -844,11 +844,11 @@ globus_l_io_bounce_iovec_kickout(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_bounce_iovec_kickout);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
globus_l_io_bounce_iovec_cb(
GLOBUS_NULL,
- bounce_info->error
+ bounce_info->error
? globus_error_put(bounce_info->error) : GLOBUS_SUCCESS,
bounce_info->iov,
bounce_info->iovc,
@@ -871,13 +871,13 @@ globus_l_io_bounce_iovec_cb(
globus_l_io_bounce_t * bounce_info;
globus_l_io_handle_t * ihandle;
GlobusIOName(globus_l_io_bounce_iovec_cb);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
ihandle = bounce_info->handle;
-
+
if(globus_l_io_should_bounce(bounce_info))
{
- bounce_info->error = result == GLOBUS_SUCCESS
+ bounce_info->error = result == GLOBUS_SUCCESS
? GLOBUS_NULL : globus_error_get(result);
bounce_info->iov = iovec;
bounce_info->iovc = count;
@@ -899,7 +899,7 @@ globus_l_io_bounce_iovec_cb(
}
return;
}
-
+
if(result != GLOBUS_SUCCESS)
{
if(globus_xio_error_is_eof(result))
@@ -919,7 +919,7 @@ globus_l_io_bounce_iovec_cb(
ihandle->io_handle));
}
}
-
+
if(globus_l_io_cancel_precallback(bounce_info))
{
bounce_info->cb.writev(
@@ -930,7 +930,7 @@ globus_l_io_bounce_iovec_cb(
count,
nbytes);
}
-
+
globus_l_io_cancel_complete(bounce_info);
globus_free(bounce_info);
}
@@ -949,12 +949,12 @@ globus_l_io_bounce_authz_kickout(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_bounce_authz_kickout);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
globus_l_io_bounce_authz_cb(
GLOBUS_NULL,
- bounce_info->error
+ bounce_info->error
? globus_error_put(bounce_info->error) : GLOBUS_SUCCESS,
user_arg);
}
@@ -975,13 +975,13 @@ globus_l_io_bounce_authz_cb(
gss_ctx_id_t context;
globus_bool_t perform_callback;
GlobusIOName(globus_l_io_bounce_authz_cb);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
if(globus_l_io_should_bounce(bounce_info) ||
(handle != NULL && bounce_info->handle->attr->authz_data.callback))
{
- bounce_info->error = result == GLOBUS_SUCCESS
+ bounce_info->error = result == GLOBUS_SUCCESS
? GLOBUS_NULL : globus_error_get(result);
result = globus_callback_space_register_oneshot(
GLOBUS_NULL,
@@ -1001,12 +1001,12 @@ globus_l_io_bounce_authz_cb(
}
return;
}
-
+
ihandle = bounce_info->handle;
perform_callback = globus_l_io_cancel_precallback(bounce_info);
-
+
if(result != GLOBUS_SUCCESS)
- {
+ {
if(globus_xio_error_is_eof(result))
{
result = globus_error_put(
@@ -1023,7 +1023,7 @@ globus_l_io_bounce_authz_cb(
globus_error_get(result),
ihandle->io_handle));
}
- else
+ else
{
globus_object_t * error = globus_error_get(result);
if(globus_error_gssapi_match(error,
@@ -1033,7 +1033,7 @@ globus_l_io_bounce_authz_cb(
globus_l_io_gsi_driver,
error,
GLOBUS_XIO_GSI_AUTHORIZATION_FAILED))
- {
+ {
result = globus_error_put(
globus_io_error_construct_authorization_failed(
GLOBUS_IO_MODULE,
@@ -1063,24 +1063,24 @@ globus_l_io_bounce_authz_cb(
{
result = globus_error_put(error);
}
- }
+ }
goto done;
}
if(ihandle->attr->authorization_mode ==
GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK)
- {
+ {
result = globus_xio_handle_cntl(
ihandle->xio_handle,
globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_PEER_NAME,
&peer_identity);
-
+
if(result != GLOBUS_SUCCESS)
{
goto done;
}
-
+
result = globus_xio_handle_cntl(
ihandle->xio_handle,
globus_l_io_gsi_driver,
@@ -1104,7 +1104,7 @@ globus_l_io_bounce_authz_cb(
minor_status);
goto done;
}
-
+
if(!perform_callback || !ihandle->attr->authz_data.callback(
ihandle->attr->authz_data.callback_arg,
ihandle->io_handle,
@@ -1119,21 +1119,21 @@ globus_l_io_bounce_authz_cb(
ihandle->io_handle,
0,
0,
- 0));
+ 0));
}
free(peer_name_buffer.value);
}
-
+
done:
-
+
if(result != GLOBUS_SUCCESS)
{
globus_xio_close(ihandle->xio_handle, GLOBUS_NULL);
ihandle->xio_handle = GLOBUS_NULL;
*ihandle->io_handle = GLOBUS_NULL;
}
-
+
if(perform_callback)
{
bounce_info->cb.non_io(
@@ -1141,10 +1141,10 @@ globus_l_io_bounce_authz_cb(
ihandle->io_handle,
result);
}
-
+
globus_l_io_cancel_complete(bounce_info);
globus_free(bounce_info);
-
+
if(result != GLOBUS_SUCCESS)
{
globus_l_io_handle_destroy(ihandle);
@@ -1166,13 +1166,13 @@ globus_l_io_bounce_listen_kickout(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_bounce_authz_kickout);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
globus_l_io_bounce_listen_cb(
GLOBUS_NULL,
bounce_info->handle->accepted_handle,
- bounce_info->error
+ bounce_info->error
? globus_error_put(bounce_info->error) : GLOBUS_SUCCESS,
user_arg);
}
@@ -1188,14 +1188,14 @@ globus_l_io_bounce_listen_cb(
globus_l_io_bounce_t * bounce_info;
globus_l_io_handle_t * ihandle;
GlobusIOName(globus_l_io_bounce_listen_cb);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
ihandle = bounce_info->handle;
ihandle->accepted_handle = handle;
-
+
if(globus_l_io_should_bounce(bounce_info))
{
- bounce_info->error = result == GLOBUS_SUCCESS
+ bounce_info->error = result == GLOBUS_SUCCESS
? GLOBUS_NULL : globus_error_get(result);
result = globus_callback_space_register_oneshot(
GLOBUS_NULL,
@@ -1215,7 +1215,7 @@ globus_l_io_bounce_listen_cb(
}
return;
}
-
+
if(globus_l_io_cancel_precallback(bounce_info))
{
if(result != GLOBUS_SUCCESS && globus_xio_error_is_canceled(result))
@@ -1226,7 +1226,7 @@ globus_l_io_bounce_listen_cb(
globus_error_get(result),
ihandle->io_handle));
}
-
+
bounce_info->cb.non_io(
bounce_info->user_arg,
ihandle->io_handle,
@@ -1246,9 +1246,9 @@ globus_l_io_blocking_cb(
{
globus_l_io_monitor_t * monitor;
GlobusIOName(globus_l_io_blocking_cb);
-
+
monitor = (globus_l_io_monitor_t *) user_arg;
-
+
globus_mutex_lock(&monitor->lock);
{
monitor->done = GLOBUS_TRUE;
@@ -1264,13 +1264,13 @@ globus_io_attr_set_callback_space(
globus_callback_space_t space)
{
GlobusIOName(globus_io_attr_set_callback_space);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_FILE_ATTR | GLOBUS_I_IO_TCP_ATTR);
-
+
globus_callback_space_destroy((*attr)->space);
globus_callback_space_reference(space);
(*attr)->space = space;
-
+
return GLOBUS_SUCCESS;
}
@@ -1280,10 +1280,10 @@ globus_io_attr_get_callback_space(
globus_callback_space_t * space)
{
GlobusIOName(globus_io_attr_get_callback_space);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_FILE_ATTR | GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(space);
-
+
*space = (*attr)->space;
return GLOBUS_SUCCESS;
}
@@ -1297,32 +1297,32 @@ globus_io_fileattr_init(
globus_l_io_attr_t * iattr;
globus_result_t result;
GlobusIOName(globus_io_fileattr_init);
-
+
GlobusLIOCheckNullParam(attr);
-
+
result = GlobusLIOMalloc(iattr, globus_l_io_attr_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
iattr->type = GLOBUS_I_IO_FILE_ATTR;
iattr->space = GLOBUS_CALLBACK_GLOBAL_SPACE;
-
+
result = globus_xio_attr_init(&iattr->attr);
if(result != GLOBUS_SUCCESS)
{
goto error_attr;
}
-
+
iattr->file_flags = GLOBUS_IO_FILE_TYPE_BINARY;
*attr = iattr;
-
+
return GLOBUS_SUCCESS;
error_attr:
globus_free(iattr);
-
+
error_alloc:
*attr = GLOBUS_NULL;
return result;
@@ -1334,11 +1334,11 @@ globus_io_fileattr_destroy(
{
globus_l_io_attr_t * iattr;
GlobusIOName(globus_io_fileattr_destroy);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_FILE_ATTR);
-
+
iattr = (globus_l_io_attr_t *) *attr;
-
+
globus_callback_space_destroy(iattr->space);
globus_xio_attr_destroy(iattr->attr);
if(iattr->stack)
@@ -1347,7 +1347,7 @@ globus_io_fileattr_destroy(
}
globus_free(iattr);
*attr = GLOBUS_NULL;
-
+
return GLOBUS_SUCCESS;
}
@@ -1357,11 +1357,11 @@ globus_io_attr_set_file_type(
globus_io_file_type_t file_type)
{
GlobusIOName(globus_io_attr_set_file_type);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_FILE_ATTR);
-
+
(*attr)->file_flags = file_type;
-
+
return GLOBUS_SUCCESS;
}
@@ -1371,11 +1371,11 @@ globus_io_attr_get_file_type(
globus_io_file_type_t * file_type)
{
GlobusIOName(globus_io_attr_get_file_type);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_FILE_ATTR);
-
+
*file_type = (*attr)->file_flags;
-
+
return GLOBUS_SUCCESS;
}
@@ -1388,15 +1388,15 @@ globus_io_tcpattr_init(
globus_l_io_attr_t * iattr;
globus_result_t result;
GlobusIOName(globus_io_tcpattr_init);
-
+
GlobusLIOCheckNullParam(attr);
-
+
result = GlobusLIOMalloc(iattr, globus_l_io_attr_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
iattr->type = GLOBUS_I_IO_TCP_ATTR;
iattr->space = GLOBUS_CALLBACK_GLOBAL_SPACE;
iattr->file_flags = 0;
@@ -1412,8 +1412,8 @@ globus_io_tcpattr_init(
}
result = globus_xio_attr_cntl(
- iattr->attr,
- globus_l_io_gsi_driver,
+ iattr->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_PROTECTION_LEVEL,
GLOBUS_XIO_GSI_PROTECTION_LEVEL_NONE);
@@ -1421,17 +1421,17 @@ globus_io_tcpattr_init(
{
goto error_xio_attr;
}
-
+
*attr = iattr;
-
+
return GLOBUS_SUCCESS;
error_xio_attr:
globus_xio_attr_destroy(iattr->attr);
-
+
error_attr:
globus_free(iattr);
-
+
error_alloc:
*attr = GLOBUS_NULL;
return result;
@@ -1443,18 +1443,18 @@ globus_io_tcpattr_destroy(
{
globus_l_io_attr_t * iattr;
GlobusIOName(globus_io_tcpattr_destroy);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
iattr = (globus_l_io_attr_t *) *attr;
-
+
if(iattr->authz_data.identity != GSS_C_NO_NAME)
{
OM_uint32 minor_status;
gss_release_name(&minor_status, &iattr->authz_data.identity);
}
-
+
globus_callback_space_destroy(iattr->space);
globus_xio_attr_destroy(iattr->attr);
if(iattr->stack)
@@ -1463,7 +1463,7 @@ globus_io_tcpattr_destroy(
}
globus_free(iattr);
*attr = GLOBUS_NULL;
-
+
return GLOBUS_SUCCESS;
}
@@ -1473,13 +1473,13 @@ globus_io_attr_set_tcp_restrict_port(
globus_bool_t restrict_port)
{
GlobusIOName(globus_io_attr_set_tcp_restrict_port);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_SET_RESTRICT_PORT,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_SET_RESTRICT_PORT,
restrict_port);
}
@@ -1489,13 +1489,13 @@ globus_io_attr_get_tcp_restrict_port(
globus_bool_t * restrict_port)
{
GlobusIOName(globus_io_attr_get_tcp_restrict_port);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_GET_RESTRICT_PORT,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_GET_RESTRICT_PORT,
restrict_port);
}
@@ -1505,13 +1505,13 @@ globus_io_attr_set_tcp_nodelay(
globus_bool_t nodelay)
{
GlobusIOName(globus_io_attr_set_tcp_nodelay);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_SET_NODELAY,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_SET_NODELAY,
nodelay);
}
@@ -1521,13 +1521,13 @@ globus_io_attr_get_tcp_nodelay(
globus_bool_t * nodelay)
{
GlobusIOName(globus_io_attr_get_tcp_nodelay);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_GET_NODELAY,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_GET_NODELAY,
nodelay);
}
@@ -1537,13 +1537,13 @@ globus_io_attr_set_tcp_interface(
const char * interface_addr)
{
GlobusIOName(globus_io_attr_set_tcp_interface);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_SET_INTERFACE,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_SET_INTERFACE,
interface_addr);
}
@@ -1553,13 +1553,13 @@ globus_io_attr_get_tcp_interface(
char ** interface_addr)
{
GlobusIOName(globus_io_attr_get_tcp_interface);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_GET_INTERFACE,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_GET_INTERFACE,
interface_addr);
}
@@ -1570,9 +1570,9 @@ globus_io_attr_set_tcp_allow_ipv6(
{
globus_l_io_attr_t * iattr;
GlobusIOName(globus_io_attr_set_tcp_allow_ipv6);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
iattr = (globus_l_io_attr_t *) *attr;
iattr->allow_ipv6 = allow;
@@ -1586,12 +1586,12 @@ globus_io_attr_set_socket_reuseaddr(
globus_bool_t reuseaddr)
{
GlobusIOName(globus_io_attr_set_socket_reuseaddr);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_SET_REUSEADDR,
reuseaddr);
}
@@ -1602,12 +1602,12 @@ globus_io_attr_get_socket_reuseaddr(
globus_bool_t * reuseaddr)
{
GlobusIOName(globus_io_attr_get_socket_reuseaddr);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_GET_REUSEADDR,
reuseaddr);
}
@@ -1618,13 +1618,13 @@ globus_io_attr_set_socket_keepalive(
globus_bool_t keepalive)
{
GlobusIOName(globus_io_attr_set_socket_keepalive);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_SET_KEEPALIVE,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_SET_KEEPALIVE,
keepalive);
}
@@ -1634,13 +1634,13 @@ globus_io_attr_get_socket_keepalive(
globus_bool_t * keepalive)
{
GlobusIOName(globus_io_attr_get_socket_keepalive);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_GET_KEEPALIVE,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_GET_KEEPALIVE,
keepalive);
}
@@ -1651,12 +1651,12 @@ globus_io_attr_set_socket_linger(
int linger_time)
{
GlobusIOName(globus_io_attr_set_socket_linger);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_SET_LINGER,
linger,
linger_time);
@@ -1669,12 +1669,12 @@ globus_io_attr_get_socket_linger(
int * linger_time)
{
GlobusIOName(globus_io_attr_get_socket_linger);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_GET_LINGER,
linger,
linger_time);
@@ -1686,12 +1686,12 @@ globus_io_attr_set_socket_oobinline(
globus_bool_t oobinline)
{
GlobusIOName(globus_io_attr_set_socket_oobinline);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_SET_OOBINLINE,
oobinline);
}
@@ -1702,13 +1702,13 @@ globus_io_attr_get_socket_oobinline(
globus_bool_t * oobinline)
{
GlobusIOName(globus_io_attr_get_socket_oobinline);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
- GLOBUS_XIO_TCP_GET_OOBINLINE,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
+ GLOBUS_XIO_TCP_GET_OOBINLINE,
oobinline);
}
@@ -1718,12 +1718,12 @@ globus_io_attr_set_socket_sndbuf(
int sndbuf)
{
GlobusIOName(globus_io_attr_set_socket_sndbuf);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_SET_SNDBUF,
sndbuf);
}
@@ -1734,12 +1734,12 @@ globus_io_attr_get_socket_sndbuf(
int * sndbuf)
{
GlobusIOName(globus_io_attr_get_socket_sndbuf);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_GET_SNDBUF,
sndbuf);
}
@@ -1750,12 +1750,12 @@ globus_io_attr_set_socket_rcvbuf(
int rcvbuf)
{
GlobusIOName(globus_io_attr_set_socket_rcvbuf);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_SET_RCVBUF,
rcvbuf);
}
@@ -1766,12 +1766,12 @@ globus_io_attr_get_socket_rcvbuf(
int * rcvbuf)
{
GlobusIOName(globus_io_attr_get_socket_rcvbuf);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_tcp_driver,
+ (*attr)->attr,
+ globus_l_io_tcp_driver,
GLOBUS_XIO_TCP_GET_RCVBUF,
rcvbuf);
}
@@ -1784,7 +1784,7 @@ globus_io_handle_get_socket_buf(
{
globus_result_t res = GLOBUS_SUCCESS;
GlobusIOName(globus_io_handle_get_socket_buf);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
if(rcvbuf != NULL)
@@ -1835,10 +1835,10 @@ globus_l_io_file_open(
globus_l_io_attr_t * iattr;
globus_l_io_handle_t * ihandle;
GlobusIOName(globus_l_io_file_open);
-
+
GlobusLIOCheckNullParam(handle);
*handle = GLOBUS_NULL;
-
+
if(attr)
{
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_FILE_ATTR);
@@ -1853,7 +1853,7 @@ globus_l_io_file_open(
goto error_attr;
}
iattr = (globus_l_io_attr_t *) myattr;
-
+
if(path)
{
result = globus_xio_attr_cntl(
@@ -1865,7 +1865,7 @@ globus_l_io_file_open(
{
goto error_cntl;
}
-
+
result = globus_xio_attr_cntl(
iattr->attr,
globus_l_io_file_driver,
@@ -1902,21 +1902,21 @@ globus_l_io_file_open(
goto error_cntl;
}
}
-
+
result = globus_l_io_handle_init(
&ihandle, handle, GLOBUS_I_IO_FILE_HANDLE, iattr->space);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
result = globus_xio_handle_create(
&ihandle->xio_handle, globus_l_io_file_stack);
if(result != GLOBUS_SUCCESS)
{
goto error_handle;
}
-
+
result = globus_xio_open(
ihandle->xio_handle,
path,
@@ -1925,10 +1925,10 @@ globus_l_io_file_open(
{
goto error_open;
}
-
+
*handle = ihandle;
globus_io_fileattr_destroy(&myattr);
-
+
return GLOBUS_SUCCESS;
error_open:
@@ -1951,9 +1951,9 @@ globus_io_file_open(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_file_open);
-
+
GlobusLIOCheckNullParam(path);
-
+
return globus_l_io_file_open(handle, attr, path, flags, mode, -1, 0);
}
@@ -1964,9 +1964,9 @@ globus_io_file_seek(
globus_io_whence_t whence)
{
GlobusIOName(globus_io_file_seek);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_FILE_HANDLE);
-
+
return globus_xio_handle_cntl(
(*handle)->xio_handle,
globus_l_io_file_driver,
@@ -1982,7 +1982,7 @@ globus_io_file_posix_convert(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_file_posix_convert);
-
+
return globus_l_io_file_open(
handle,
attr,
@@ -2001,7 +2001,7 @@ globus_io_file_windows_convert(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_file_posix_convert);
-
+
return globus_l_io_file_open(
handle,
attr,
@@ -2064,21 +2064,21 @@ globus_l_io_tcp_register_connect(
globus_xio_stack_t stack;
char * cs = GLOBUS_NULL;
GlobusIOName(globus_l_io_tcp_register_connect);
-
+
GlobusLIOCheckNullParam(handle);
GlobusLIOCheckNullParam(callback);
-
+
if(attr)
{
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
}
-
+
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_bounce;
}
-
+
result = globus_l_io_handle_init(
&ihandle, handle, GLOBUS_I_IO_TCP_HANDLE,
attr ? (*attr)->space : GLOBUS_CALLBACK_GLOBAL_SPACE);
@@ -2116,7 +2116,7 @@ globus_l_io_tcp_register_connect(
goto error_attr;
}
}
-
+
if(!ihandle->attr->allow_ipv6)
{
result = globus_xio_attr_cntl(
@@ -2129,7 +2129,7 @@ globus_l_io_tcp_register_connect(
goto error_attr;
}
}
-
+
result = globus_xio_attr_cntl(
ihandle->attr->attr,
GLOBUS_NULL,
@@ -2141,7 +2141,7 @@ globus_l_io_tcp_register_connect(
{
goto error_attr;
}
-
+
if(host)
{
if(strchr(host, ':'))
@@ -2166,7 +2166,7 @@ globus_l_io_tcp_register_connect(
goto error_attr;
}
}
-
+
result = globus_xio_handle_create(&ihandle->xio_handle, stack);
if(result != GLOBUS_SUCCESS)
{
@@ -2179,7 +2179,7 @@ globus_l_io_tcp_register_connect(
bounce_info->blocking = blocking;
bounce_info->cancel_info = GLOBUS_NULL;
*handle = ihandle;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_register_open(
@@ -2193,11 +2193,11 @@ globus_l_io_tcp_register_connect(
globus_mutex_unlock(&ihandle->pending_lock);
goto error_open;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_open:
@@ -2222,9 +2222,9 @@ globus_io_tcp_register_connect(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_tcp_register_connect);
-
+
GlobusLIOCheckNullParam(host);
-
+
return globus_l_io_tcp_register_connect(
host,
port,
@@ -2248,11 +2248,11 @@ globus_l_io_tcp_connect(
globus_result_t result;
globus_l_io_monitor_t monitor;
GlobusIOName(globus_l_io_tcp_connect);
-
+
monitor.done = GLOBUS_FALSE;
globus_mutex_init(&monitor.lock, GLOBUS_NULL);
globus_cond_init(&monitor.cond, GLOBUS_NULL);
-
+
result = globus_l_io_tcp_register_connect(
host,
port,
@@ -2267,7 +2267,7 @@ globus_l_io_tcp_connect(
monitor.done = GLOBUS_TRUE;
monitor.error = globus_error_get(result);
}
-
+
globus_mutex_lock(&monitor.lock);
{
while(!monitor.done)
@@ -2276,18 +2276,18 @@ globus_l_io_tcp_connect(
}
}
globus_mutex_unlock(&monitor.lock);
-
+
globus_mutex_destroy(&monitor.lock);
globus_cond_destroy(&monitor.cond);
-
+
if(monitor.error != GLOBUS_NULL)
{
result = globus_error_put(monitor.error);
goto error_register;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_register:
*handle = GLOBUS_NULL;
return result;
@@ -2301,9 +2301,9 @@ globus_io_tcp_connect(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_tcp_connect);
-
+
GlobusLIOCheckNullParam(host);
-
+
return globus_l_io_tcp_connect(host, port, -1, attr, handle);
}
@@ -2322,9 +2322,9 @@ globus_l_io_tcp_create_listener(
globus_l_io_handle_t * ihandle;
globus_xio_stack_t stack;
GlobusIOName(globus_l_io_tcp_create_listener);
-
+
GlobusLIOCheckNullParam(handle);
-
+
if(attr)
{
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
@@ -2334,12 +2334,12 @@ globus_l_io_tcp_create_listener(
{
result = globus_io_tcpattr_init(&myattr);
}
-
+
if(result != GLOBUS_SUCCESS)
{
goto error_attr;
}
-
+
iattr = (globus_l_io_attr_t *) myattr;
if(port)
{
@@ -2352,7 +2352,7 @@ globus_l_io_tcp_create_listener(
{
goto error_cntl;
}
-
+
result = globus_xio_attr_cntl(
iattr->attr,
globus_l_io_tcp_driver,
@@ -2371,7 +2371,7 @@ globus_l_io_tcp_create_listener(
{
goto error_cntl;
}
-
+
if(!iattr->allow_ipv6)
{
result = globus_xio_attr_cntl(
@@ -2384,7 +2384,7 @@ globus_l_io_tcp_create_listener(
goto error_cntl;
}
}
-
+
result = globus_l_io_handle_init(
&ihandle, handle, GLOBUS_I_IO_TCP_HANDLE, iattr->space);
if(result != GLOBUS_SUCCESS)
@@ -2395,7 +2395,7 @@ globus_l_io_tcp_create_listener(
if(iattr->stack != NULL)
{
stack = iattr->stack;
- }
+ }
else if(iattr->authentication_mode ==
GLOBUS_IO_SECURE_AUTHENTICATION_MODE_NONE)
{
@@ -2405,48 +2405,48 @@ globus_l_io_tcp_create_listener(
{
stack = globus_l_io_gsi_stack;
}
-
+
result = globus_xio_server_create(
&ihandle->xio_server, iattr->attr, stack);
if(result != GLOBUS_SUCCESS)
{
goto error_server;
}
-
+
if(port && !*port)
{
char * contact_string;
char * s;
-
+
result = globus_xio_server_get_contact_string(
ihandle->xio_server, &contact_string);
if(result != GLOBUS_SUCCESS)
{
goto error_server_cntl;
}
-
+
s = strrchr(contact_string, ':');
globus_assert(s);
*port = atoi(s + 1);
-
+
globus_free(contact_string);
}
-
+
ihandle->attr = iattr;
*handle = ihandle;
-
+
return GLOBUS_SUCCESS;
error_server_cntl:
globus_xio_server_close(ihandle->xio_server);
-
+
error_server:
globus_l_io_handle_destroy(ihandle);
-
+
error_alloc:
error_cntl:
globus_io_tcpattr_destroy(&myattr);
-
+
error_attr:
*handle = GLOBUS_NULL;
return result;
@@ -2460,9 +2460,9 @@ globus_io_tcp_create_listener(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_tcp_create_listener);
-
+
GlobusLIOCheckNullParam(port);
-
+
return globus_l_io_tcp_create_listener(
port, backlog, -1, attr, handle);
}
@@ -2479,10 +2479,10 @@ globus_l_io_tcp_register_listen(
globus_l_io_handle_t * ihandle;
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_tcp_register_listen);
-
+
GlobusLIOCheckNullParam(callback);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
ihandle = *handle;
if(ihandle->accepted_handle)
{
@@ -2492,22 +2492,22 @@ globus_l_io_tcp_register_listen(
GLOBUS_IO_MODULE,
GLOBUS_NULL,
ihandle->io_handle));
-
+
goto error_registered;
}
-
+
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_bounce;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.non_io = callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = blocking;
bounce_info->cancel_info = GLOBUS_NULL;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_server_register_accept(
@@ -2519,16 +2519,16 @@ globus_l_io_tcp_register_listen(
globus_mutex_unlock(&ihandle->pending_lock);
goto error_register;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_register:
globus_free(bounce_info);
-
+
error_bounce:
error_registered:
return result;
@@ -2551,11 +2551,11 @@ globus_io_tcp_listen(
globus_result_t result;
globus_l_io_monitor_t monitor;
GlobusIOName(globus_io_tcp_listen);
-
+
monitor.done = GLOBUS_FALSE;
globus_mutex_init(&monitor.lock, GLOBUS_NULL);
globus_cond_init(&monitor.cond, GLOBUS_NULL);
-
+
result = globus_l_io_tcp_register_listen(
handle, globus_l_io_blocking_cb, &monitor, GLOBUS_TRUE);
if(result != GLOBUS_SUCCESS)
@@ -2563,7 +2563,7 @@ globus_io_tcp_listen(
monitor.done = GLOBUS_TRUE;
monitor.error = globus_error_get(result);
}
-
+
globus_mutex_lock(&monitor.lock);
{
while(!monitor.done)
@@ -2572,18 +2572,18 @@ globus_io_tcp_listen(
}
}
globus_mutex_unlock(&monitor.lock);
-
+
globus_mutex_destroy(&monitor.lock);
globus_cond_destroy(&monitor.cond);
-
+
if(monitor.error != GLOBUS_NULL)
{
result = globus_error_put(monitor.error);
goto error_register;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_register:
return result;
}
@@ -2609,11 +2609,11 @@ globus_l_io_tcp_register_accept(
globus_l_io_bounce_t * bounce_info;
char * contact_string = GLOBUS_NULL;
GlobusIOName(globus_io_tcp_register_accept);
-
+
GlobusLIOCheckNullParam(new_handle);
GlobusLIOCheckNullParam(callback);
GlobusLIOCheckHandle(listener_handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
ilistener_handle = *listener_handle;
if(!ilistener_handle->accepted_handle)
{
@@ -2624,15 +2624,15 @@ globus_l_io_tcp_register_accept(
"listener_handle",
1,
(char *) _io_name));
-
+
goto error_handle;
}
-
+
if(attr)
{
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
}
-
+
result = globus_l_io_handle_init(
&ihandle, new_handle, GLOBUS_I_IO_TCP_HANDLE,
attr ? (*attr)->space : ilistener_handle->space);
@@ -2640,20 +2640,20 @@ globus_l_io_tcp_register_accept(
{
goto error_handle;
}
-
+
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_bounce;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.non_io = callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = blocking;
bounce_info->cancel_info = GLOBUS_NULL;
*new_handle = ihandle;
-
+
if(attr)
{
result = globus_l_io_iattr_copy(&ihandle->attr, attr);
@@ -2661,12 +2661,12 @@ globus_l_io_tcp_register_accept(
{
goto error_gsi;
}
-
- if((ilistener_handle->attr->authentication_mode ==
+
+ if((ilistener_handle->attr->authentication_mode ==
GLOBUS_IO_SECURE_AUTHENTICATION_MODE_NONE ||
- ihandle->attr->authentication_mode ==
+ ihandle->attr->authentication_mode ==
GLOBUS_IO_SECURE_AUTHENTICATION_MODE_NONE) &&
- ilistener_handle->attr->authentication_mode !=
+ ilistener_handle->attr->authentication_mode !=
ihandle->attr->authentication_mode)
{
result = globus_error_put(
@@ -2693,7 +2693,7 @@ globus_l_io_tcp_register_accept(
goto error_gsi;
}
}
-
+
ihandle->xio_handle = ilistener_handle->accepted_handle;
ilistener_handle->accepted_handle = GLOBUS_NULL;
@@ -2708,7 +2708,7 @@ globus_l_io_tcp_register_accept(
{
goto error_gsi;
}
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_register_open(
@@ -2719,20 +2719,20 @@ globus_l_io_tcp_register_accept(
bounce_info);
if(contact_string != GLOBUS_NULL)
- {
+ {
globus_free(contact_string);
}
-
+
if(result != GLOBUS_SUCCESS)
{
globus_mutex_unlock(&ihandle->pending_lock);
goto error_open;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_open:
@@ -2772,11 +2772,11 @@ globus_io_tcp_accept(
globus_result_t result;
globus_l_io_monitor_t monitor;
GlobusIOName(globus_io_tcp_accept);
-
+
monitor.done = GLOBUS_FALSE;
globus_mutex_init(&monitor.lock, GLOBUS_NULL);
globus_cond_init(&monitor.cond, GLOBUS_NULL);
-
+
result = globus_l_io_tcp_register_accept(
listener_handle,
attr,
@@ -2789,7 +2789,7 @@ globus_io_tcp_accept(
monitor.done = GLOBUS_TRUE;
monitor.error = globus_error_get(result);
}
-
+
globus_mutex_lock(&monitor.lock);
{
while(!monitor.done)
@@ -2798,18 +2798,18 @@ globus_io_tcp_accept(
}
}
globus_mutex_unlock(&monitor.lock);
-
+
globus_mutex_destroy(&monitor.lock);
globus_cond_destroy(&monitor.cond);
-
+
if(monitor.error != GLOBUS_NULL)
{
result = globus_error_put(monitor.error);
goto error_register;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_register:
return result;
}
@@ -2827,12 +2827,12 @@ globus_io_tcp_get_local_address_ex(
globus_result_t result;
char * cs;
GlobusIOName(globus_io_tcp_get_local_address_ex);
-
+
GlobusLIOCheckNullParam(host);
GlobusLIOCheckNullParam(count);
GlobusLIOCheckNullParam(port);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
if((*handle)->xio_handle)
{
result = globus_xio_handle_cntl(
@@ -2853,20 +2853,20 @@ globus_io_tcp_get_local_address_ex(
{
goto error_cntl;
}
-
+
result = globus_libc_contact_string_to_ints(cs, host, count, port);
if(result != GLOBUS_SUCCESS)
{
goto error_parse;
}
-
+
globus_free(cs);
-
+
return GLOBUS_SUCCESS;
error_parse:
globus_free(cs);
-
+
error_cntl:
return result;
}
@@ -2881,12 +2881,12 @@ globus_io_tcp_get_remote_address_ex(
globus_result_t result;
char * cs;
GlobusIOName(globus_io_tcp_get_remote_address_ex);
-
+
GlobusLIOCheckNullParam(host);
GlobusLIOCheckNullParam(count);
GlobusLIOCheckNullParam(port);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
if((*handle)->xio_handle)
{
result = globus_xio_handle_cntl(
@@ -2907,20 +2907,20 @@ globus_io_tcp_get_remote_address_ex(
{
goto error_cntl;
}
-
+
result = globus_libc_contact_string_to_ints(cs, host, count, port);
if(result != GLOBUS_SUCCESS)
{
goto error_parse;
}
-
+
globus_free(cs);
-
+
return GLOBUS_SUCCESS;
error_parse:
globus_free(cs);
-
+
error_cntl:
return result;
}
@@ -2935,17 +2935,17 @@ globus_io_tcp_get_local_address(
int count;
globus_result_t result;
GlobusIOName(globus_io_tcp_get_local_address);
-
+
GlobusLIOCheckNullParam(host);
GlobusLIOCheckNullParam(port);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
result = globus_io_tcp_get_local_address_ex(handle, myhost, &count, port);
if(result != GLOBUS_SUCCESS)
{
goto error_cntl;
}
-
+
if(count != 4)
{
/* interface doesnt support ipv6 addresses */
@@ -2954,15 +2954,15 @@ globus_io_tcp_get_local_address(
GLOBUS_IO_MODULE,
GLOBUS_NULL,
(char *) _io_name));
-
+
goto error_ipv6;
}
-
+
while(count--)
{
host[count] = myhost[count];
}
-
+
return GLOBUS_SUCCESS;
error_ipv6:
@@ -2980,17 +2980,17 @@ globus_io_tcp_get_remote_address(
int count;
globus_result_t result;
GlobusIOName(globus_io_tcp_get_remote_address);
-
+
GlobusLIOCheckNullParam(host);
GlobusLIOCheckNullParam(port);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
result = globus_io_tcp_get_remote_address_ex(handle, myhost, &count, port);
if(result != GLOBUS_SUCCESS)
{
goto error_cntl;
}
-
+
if(count != 4)
{
/* interface doesnt support ipv6 addresses */
@@ -2999,15 +2999,15 @@ globus_io_tcp_get_remote_address(
GLOBUS_IO_MODULE,
GLOBUS_NULL,
(char *) _io_name));
-
+
goto error_ipv6;
}
-
+
while(count--)
{
host[count] = myhost[count];
}
-
+
return GLOBUS_SUCCESS;
error_ipv6:
@@ -3030,23 +3030,23 @@ globus_io_register_read(
globus_l_io_handle_t * ihandle;
globus_result_t result;
GlobusIOName(globus_io_register_read);
-
+
GlobusLIOCheckNullParam(callback);
GlobusLIOCheckHandle(handle, 0);
-
+
ihandle = *handle;
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.read_write = callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = GLOBUS_FALSE;
bounce_info->cancel_info = GLOBUS_NULL;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_register_read(
@@ -3062,16 +3062,16 @@ globus_io_register_read(
globus_mutex_unlock(&ihandle->pending_lock);
goto error_register;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_register:
globus_free(bounce_info);
-
+
error_alloc:
return result;
}
@@ -3085,11 +3085,11 @@ globus_io_try_read(
{
globus_result_t result;
GlobusIOName(globus_io_try_read);
-
+
GlobusLIOCheckNullParam(nbytes_read);
*nbytes_read = 0;
GlobusLIOCheckHandle(handle, 0);
-
+
result = globus_xio_read(
(*handle)->xio_handle,
buf,
@@ -3101,9 +3101,9 @@ globus_io_try_read(
{
goto error_read;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_read:
if(globus_xio_error_is_eof(result))
{
@@ -3121,7 +3121,7 @@ globus_io_try_read(
globus_error_get(result),
(*handle)->io_handle));
}
-
+
return result;
}
@@ -3135,11 +3135,11 @@ globus_io_read(
{
globus_result_t result;
GlobusIOName(globus_io_read);
-
+
GlobusLIOCheckNullParam(nbytes_read);
*nbytes_read = 0;
GlobusLIOCheckHandle(handle, 0);
-
+
result = globus_xio_read(
(*handle)->xio_handle,
buf,
@@ -3151,9 +3151,9 @@ globus_io_read(
{
goto error_read;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_read:
if(globus_xio_error_is_eof(result))
{
@@ -3171,7 +3171,7 @@ globus_io_read(
globus_error_get(result),
(*handle)->io_handle));
}
-
+
return result;
}
@@ -3189,23 +3189,23 @@ globus_io_register_write(
globus_l_io_handle_t * ihandle;
globus_result_t result;
GlobusIOName(globus_io_register_write);
-
+
GlobusLIOCheckNullParam(write_callback);
GlobusLIOCheckHandle(handle, 0);
-
+
ihandle = *handle;
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.read_write = write_callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = GLOBUS_FALSE;
bounce_info->cancel_info = GLOBUS_NULL;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_register_write(
@@ -3221,16 +3221,16 @@ globus_io_register_write(
globus_mutex_unlock(&ihandle->pending_lock);
goto error_register;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_register:
globus_free(bounce_info);
-
+
error_alloc:
return result;
}
@@ -3249,17 +3249,17 @@ globus_io_register_send(
globus_result_t result;
globus_xio_data_descriptor_t dd;
GlobusIOName(globus_io_register_send);
-
+
GlobusLIOCheckNullParam(write_callback);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
ihandle = *handle;
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
if(flags)
{
result = globus_xio_data_descriptor_init(&dd, ihandle->xio_handle);
@@ -3267,7 +3267,7 @@ globus_io_register_send(
{
goto error_dd;
}
-
+
result = globus_xio_data_descriptor_cntl(
dd,
globus_l_io_tcp_driver,
@@ -3282,13 +3282,13 @@ globus_io_register_send(
{
dd = GLOBUS_NULL;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.read_write = write_callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = GLOBUS_FALSE;
bounce_info->cancel_info = GLOBUS_NULL;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_register_write(
@@ -3305,11 +3305,11 @@ globus_io_register_send(
globus_mutex_unlock(&ihandle->pending_lock);
goto error_register;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_register:
@@ -3318,10 +3318,10 @@ globus_io_register_send(
{
globus_xio_data_descriptor_destroy(dd);
}
-
+
error_dd:
globus_free(bounce_info);
-
+
error_alloc:
return result;
}
@@ -3340,30 +3340,30 @@ globus_io_register_writev(
int i;
globus_size_t nbytes;
GlobusIOName(globus_io_register_writev);
-
+
GlobusLIOCheckNullParam(writev_callback);
GlobusLIOCheckNullParam(iov);
GlobusLIOCheckHandle(handle, 0);
-
+
ihandle = *handle;
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.writev = writev_callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = GLOBUS_FALSE;
bounce_info->cancel_info = GLOBUS_NULL;
-
+
nbytes = 0;
for(i = 0; i < iovcnt; i++)
{
nbytes += iov[i].iov_len;
}
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
result = globus_xio_register_writev(
@@ -3379,16 +3379,16 @@ globus_io_register_writev(
globus_mutex_unlock(&ihandle->pending_lock);
goto error_register;
}
-
+
globus_l_io_cancel_insert(bounce_info);
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_register:
globus_free(bounce_info);
-
+
error_alloc:
return result;
}
@@ -3402,11 +3402,11 @@ globus_io_try_write(
{
globus_result_t result;
GlobusIOName(globus_io_try_write);
-
+
GlobusLIOCheckNullParam(nbytes_written);
*nbytes_written = 0;
GlobusLIOCheckHandle(handle, 0);
-
+
result = globus_xio_write(
(*handle)->xio_handle,
buf,
@@ -3418,9 +3418,9 @@ globus_io_try_write(
{
goto error_write;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_write:
if(globus_xio_error_is_canceled(result))
{
@@ -3430,7 +3430,7 @@ globus_io_try_write(
globus_error_get(result),
(*handle)->io_handle));
}
-
+
return result;
}
@@ -3445,11 +3445,11 @@ globus_io_try_send(
globus_result_t result;
globus_xio_data_descriptor_t dd;
GlobusIOName(globus_io_try_send);
-
+
GlobusLIOCheckNullParam(nbytes_sent);
*nbytes_sent = 0;
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
if(flags)
{
result = globus_xio_data_descriptor_init(&dd, (*handle)->xio_handle);
@@ -3457,7 +3457,7 @@ globus_io_try_send(
{
goto error_dd;
}
-
+
result = globus_xio_data_descriptor_cntl(
dd,
globus_l_io_tcp_driver,
@@ -3472,7 +3472,7 @@ globus_io_try_send(
{
dd = GLOBUS_NULL;
}
-
+
result = globus_xio_write(
(*handle)->xio_handle,
buf,
@@ -3486,7 +3486,7 @@ globus_io_try_send(
goto error_write;
}
return GLOBUS_SUCCESS;
-
+
error_write:
if(globus_xio_error_is_canceled(result))
{
@@ -3502,7 +3502,7 @@ globus_io_try_send(
{
globus_xio_data_descriptor_destroy(dd);
}
-
+
error_dd:
return result;
}
@@ -3516,11 +3516,11 @@ globus_io_write(
{
globus_result_t result;
GlobusIOName(globus_io_write);
-
+
GlobusLIOCheckNullParam(nbytes_written);
*nbytes_written = 0;
GlobusLIOCheckHandle(handle, 0);
-
+
result = globus_xio_write(
(*handle)->xio_handle,
buf,
@@ -3532,9 +3532,9 @@ globus_io_write(
{
goto error_write;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_write:
if(globus_xio_error_is_canceled(result))
{
@@ -3544,7 +3544,7 @@ globus_io_write(
globus_error_get(result),
(*handle)->io_handle));
}
-
+
return result;
}
@@ -3559,11 +3559,11 @@ globus_io_send(
globus_result_t result;
globus_xio_data_descriptor_t dd;
GlobusIOName(globus_io_send);
-
+
GlobusLIOCheckNullParam(nbytes_sent);
*nbytes_sent = 0;
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
if(flags)
{
result = globus_xio_data_descriptor_init(&dd, (*handle)->xio_handle);
@@ -3571,7 +3571,7 @@ globus_io_send(
{
goto error_dd;
}
-
+
result = globus_xio_data_descriptor_cntl(
dd,
globus_l_io_tcp_driver,
@@ -3586,7 +3586,7 @@ globus_io_send(
{
dd = GLOBUS_NULL;
}
-
+
result = globus_xio_write(
(*handle)->xio_handle,
buf,
@@ -3601,7 +3601,7 @@ globus_io_send(
}
return GLOBUS_SUCCESS;
-
+
error_write:
if(globus_xio_error_is_canceled(result))
{
@@ -3617,7 +3617,7 @@ globus_io_send(
{
globus_xio_data_descriptor_destroy(dd);
}
-
+
error_dd:
return result;
}
@@ -3633,18 +3633,18 @@ globus_io_writev(
int i;
globus_size_t nbytes;
GlobusIOName(globus_io_writev);
-
+
GlobusLIOCheckNullParam(bytes_written);
*bytes_written = 0;
GlobusLIOCheckNullParam(iov);
GlobusLIOCheckHandle(handle, 0);
-
+
nbytes = 0;
for(i = 0; i < iovcnt; i++)
{
nbytes += iov[i].iov_len;
}
-
+
result = globus_xio_writev(
(*handle)->xio_handle,
iov,
@@ -3656,9 +3656,9 @@ globus_io_writev(
{
goto error_write;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_write:
if(globus_xio_error_is_canceled(result))
{
@@ -3668,7 +3668,7 @@ globus_io_writev(
globus_error_get(result),
(*handle)->io_handle));
}
-
+
return result;
}
@@ -3680,7 +3680,7 @@ globus_l_io_bounce_close_cb(
globus_xio_handle_t handle,
globus_result_t result,
void * user_arg);
-
+
static
void
globus_l_io_bounce_close_kickout(
@@ -3688,12 +3688,12 @@ globus_l_io_bounce_close_kickout(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_bounce_close_kickout);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
globus_l_io_bounce_close_cb(
GLOBUS_NULL,
- bounce_info->error
+ bounce_info->error
? globus_error_put(bounce_info->error) : GLOBUS_SUCCESS,
user_arg);
}
@@ -3707,12 +3707,12 @@ globus_l_io_bounce_close_cb(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_bounce_close_cb);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
if(globus_l_io_should_bounce(bounce_info))
{
- bounce_info->error = result == GLOBUS_SUCCESS
+ bounce_info->error = result == GLOBUS_SUCCESS
? GLOBUS_NULL : globus_error_get(result);
result = globus_callback_space_register_oneshot(
GLOBUS_NULL,
@@ -3732,18 +3732,18 @@ globus_l_io_bounce_close_cb(
}
return;
}
-
+
bounce_info->cb.non_io(
bounce_info->user_arg,
bounce_info->handle->io_handle,
result);
-
+
globus_mutex_lock(&bounce_info->handle->pending_lock);
{
bounce_info->handle->refs--;
}
globus_mutex_unlock(&bounce_info->handle->pending_lock);
-
+
globus_l_io_handle_destroy(bounce_info->handle);
globus_free(bounce_info);
}
@@ -3753,17 +3753,14 @@ void
globus_l_io_server_close_cb(
globus_xio_server_t xio_server,
void * user_arg);
-
+
static
void
globus_l_io_server_close_kickout(
void * user_arg)
{
- globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_server_close_kickout);
-
- bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
globus_l_io_server_close_cb(GLOBUS_NULL, user_arg);
}
@@ -3775,13 +3772,13 @@ globus_l_io_server_close_cb(
{
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_l_io_server_close_cb);
-
+
bounce_info = (globus_l_io_bounce_t *) user_arg;
-
+
if(globus_l_io_should_bounce(bounce_info))
{
globus_result_t result;
-
+
result = globus_callback_space_register_oneshot(
GLOBUS_NULL,
GLOBUS_NULL,
@@ -3800,18 +3797,18 @@ globus_l_io_server_close_cb(
}
return;
}
-
+
bounce_info->cb.non_io(
bounce_info->user_arg,
bounce_info->handle->io_handle,
GLOBUS_SUCCESS);
-
+
globus_mutex_lock(&bounce_info->handle->pending_lock);
{
bounce_info->handle->refs--;
}
globus_mutex_unlock(&bounce_info->handle->pending_lock);
-
+
globus_l_io_handle_destroy(bounce_info->handle);
globus_free(bounce_info);
}
@@ -3827,31 +3824,31 @@ globus_l_io_register_close(
globus_l_io_handle_t * ihandle;
globus_result_t result;
GlobusIOName(globus_io_register_close);
-
+
GlobusLIOCheckNullParam(callback);
GlobusLIOCheckHandle(handle, 0);
ihandle = *handle;
-
+
result = GlobusLIOMalloc(bounce_info, globus_l_io_bounce_t);
if(result != GLOBUS_SUCCESS)
{
goto error_alloc;
}
-
+
bounce_info->handle = ihandle;
bounce_info->cb.non_io = callback;
bounce_info->user_arg = callback_arg;
bounce_info->blocking = blocking;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
if(ihandle->xio_handle)
{
globus_xio_handle_t xio_handle;
-
+
xio_handle = ihandle->xio_handle;
ihandle->xio_handle = GLOBUS_NULL;
-
+
result = globus_xio_register_close(
xio_handle,
GLOBUS_NULL,
@@ -3861,10 +3858,10 @@ globus_l_io_register_close(
else if(ihandle->xio_server)
{
globus_xio_server_t xio_server;
-
+
xio_server = ihandle->xio_server;
ihandle->xio_server = GLOBUS_NULL;
-
+
result = globus_xio_server_register_close(
xio_server,
globus_l_io_server_close_cb,
@@ -3880,24 +3877,24 @@ globus_l_io_register_close(
1,
(char *) _io_name));
}
-
+
if(result == GLOBUS_SUCCESS)
{
ihandle->refs++;
}
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
if(result != GLOBUS_SUCCESS)
{
goto error_register;
}
-
+
return GLOBUS_SUCCESS;
error_register:
globus_free(bounce_info);
-
+
error_alloc:
*handle = GLOBUS_NULL;
return result;
@@ -3920,11 +3917,11 @@ globus_io_close(
globus_result_t result;
globus_l_io_monitor_t monitor;
GlobusIOName(globus_io_close);
-
+
monitor.done = GLOBUS_FALSE;
globus_mutex_init(&monitor.lock, GLOBUS_NULL);
globus_cond_init(&monitor.cond, GLOBUS_NULL);
-
+
result = globus_l_io_register_close(
handle, globus_l_io_blocking_cb, &monitor, GLOBUS_TRUE);
if(result != GLOBUS_SUCCESS)
@@ -3932,7 +3929,7 @@ globus_io_close(
monitor.done = GLOBUS_TRUE;
monitor.error = globus_error_get(result);
}
-
+
globus_mutex_lock(&monitor.lock);
{
while(!monitor.done)
@@ -3941,18 +3938,18 @@ globus_io_close(
}
}
globus_mutex_unlock(&monitor.lock);
-
+
globus_mutex_destroy(&monitor.lock);
globus_cond_destroy(&monitor.cond);
-
+
if(monitor.error != GLOBUS_NULL)
{
result = globus_error_put(monitor.error);
goto error_register;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_register:
return result;
}
@@ -3962,7 +3959,7 @@ globus_io_eof(
globus_object_t * eof)
{
GlobusIOName(globus_io_eof);
-
+
if(eof && globus_object_get_type(eof) == GLOBUS_IO_ERROR_TYPE_EOF)
{
return GLOBUS_TRUE;
@@ -3980,7 +3977,7 @@ globus_io_tcp_posix_convert(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_tcp_posix_convert);
-
+
return globus_l_io_tcp_connect(GLOBUS_NULL, 0, socket, attr, handle);
}
@@ -3991,7 +3988,7 @@ globus_io_tcp_posix_convert_listener(
globus_io_handle_t * handle)
{
GlobusIOName(globus_io_tcp_posix_convert_listener);
-
+
return globus_l_io_tcp_create_listener(
GLOBUS_NULL, 0, socket, attr, handle);
}
@@ -4010,23 +4007,23 @@ globus_l_io_register_cancel(
globus_l_io_cancel_info_t * cancel_info;
globus_l_io_bounce_t * bounce_info;
GlobusIOName(globus_io_register_cancel);
-
+
GlobusLIOCheckHandle(handle, 0);
ihandle = *handle;
-
+
result = GlobusLIOMalloc(cancel_info, globus_l_io_cancel_info_t);
if(result != GLOBUS_SUCCESS)
{
goto error_cancel_info;
}
-
+
cancel_info->handle = handle;
cancel_info->refs = 0;
cancel_info->blocking = blocking;
cancel_info->perform_callbacks = perform_callbacks;
cancel_info->callback = cancel_callback;
cancel_info->user_arg = cancel_arg;
-
+
globus_mutex_lock(&ihandle->pending_lock);
{
if(ihandle->xio_handle)
@@ -4048,16 +4045,16 @@ globus_l_io_register_cancel(
GLOBUS_NULL,
"handle",
1,
- (char *) _io_name));
+ (char *) _io_name));
}
-
+
if(result == GLOBUS_SUCCESS)
{
globus_list_t * pending;
-
+
pending = ihandle->pending_ops;
ihandle->pending_ops = GLOBUS_NULL;
-
+
while(!globus_list_empty(pending))
{
bounce_info = globus_list_remove(&pending, pending);
@@ -4065,7 +4062,7 @@ globus_l_io_register_cancel(
cancel_info->refs++;
}
}
-
+
if(cancel_info->refs == 0)
{
result = globus_callback_space_register_oneshot(
@@ -4082,13 +4079,13 @@ globus_l_io_register_cancel(
}
}
globus_mutex_unlock(&ihandle->pending_lock);
-
+
return GLOBUS_SUCCESS;
error_oneshot:
globus_mutex_unlock(&ihandle->pending_lock);
globus_free(cancel_info);
-
+
error_cancel_info:
return result;
}
@@ -4112,11 +4109,11 @@ globus_io_cancel(
globus_result_t result;
globus_l_io_monitor_t monitor;
GlobusIOName(globus_io_cancel);
-
+
monitor.done = GLOBUS_FALSE;
globus_mutex_init(&monitor.lock, GLOBUS_NULL);
globus_cond_init(&monitor.cond, GLOBUS_NULL);
-
+
result = globus_l_io_register_cancel(
handle,
perform_callbacks,
@@ -4128,7 +4125,7 @@ globus_io_cancel(
monitor.done = GLOBUS_TRUE;
monitor.error = globus_error_get(result);
}
-
+
globus_mutex_lock(&monitor.lock);
{
while(!monitor.done)
@@ -4137,18 +4134,18 @@ globus_io_cancel(
}
}
globus_mutex_unlock(&monitor.lock);
-
+
globus_mutex_destroy(&monitor.lock);
globus_cond_destroy(&monitor.cond);
-
+
if(monitor.error != GLOBUS_NULL)
{
result = globus_error_put(monitor.error);
goto error_register;
}
-
+
return GLOBUS_SUCCESS;
-
+
error_register:
return result;
}
@@ -4163,10 +4160,10 @@ globus_l_io_bounce_select_cb(
globus_size_t nbytes)
{
globus_io_callback_t cb;
-
+
/* callback is buried in buffer... bad me */
cb = (globus_io_callback_t) buf;
-
+
cb(arg, handle, result);
}
@@ -4180,13 +4177,11 @@ globus_io_register_select(
globus_io_callback_t except_callback_func,
void * except_callback_arg)
{
- globus_l_io_handle_t * ihandle;
globus_result_t result;
GlobusIOName(globus_io_register_select);
-
+
GlobusLIOCheckHandle(handle, 0);
- ihandle = *handle;
-
+
if(except_callback_func)
{
result = globus_error_put(
@@ -4200,7 +4195,7 @@ globus_io_register_select(
_IOSL("Globus IO-XIO does not support use of the except callback")));
goto error_notsupported;
}
-
+
if(read_callback_func)
{
result = globus_io_register_read(
@@ -4215,7 +4210,7 @@ globus_io_register_select(
goto error_register;
}
}
-
+
if(write_callback_func)
{
result = globus_io_register_write(
@@ -4232,7 +4227,7 @@ globus_io_register_select(
goto error_register;
}
}
-
+
return GLOBUS_SUCCESS;
error_register:
@@ -4246,10 +4241,10 @@ globus_io_get_handle_type(
{
globus_l_io_handle_t * ihandle;
GlobusIOName(globus_io_get_handle_type);
-
+
GlobusLIOCheckHandle(handle, 0);
ihandle = *handle;
-
+
if(ihandle->type == GLOBUS_I_IO_FILE_HANDLE)
return GLOBUS_IO_HANDLE_TYPE_FILE;
else
@@ -4262,12 +4257,12 @@ globus_io_handle_get_user_pointer(
void ** user_pointer)
{
GlobusIOName(globus_io_handle_get_user_pointer);
-
+
GlobusLIOCheckHandle(handle, 0);
GlobusLIOCheckNullParam(user_pointer);
-
+
*user_pointer = (*handle)->user_pointer;
-
+
return GLOBUS_SUCCESS;
}
@@ -4277,11 +4272,11 @@ globus_io_handle_set_user_pointer(
void * user_pointer)
{
GlobusIOName(globus_io_handle_set_user_pointer);
-
+
GlobusLIOCheckHandle(handle, 0);
-
+
(*handle)->user_pointer = user_pointer;
-
+
return GLOBUS_SUCCESS;
}
@@ -4291,12 +4286,12 @@ globus_io_handle_get_xio_handle(
globus_xio_handle_t * xio_handle)
{
GlobusIOName(globus_io_handle_get_xio_handle);
-
+
GlobusLIOCheckHandle(handle, 0);
GlobusLIOCheckNullParam(xio_handle);
-
+
*xio_handle = (*handle)->xio_handle;
-
+
return GLOBUS_SUCCESS;
}
@@ -4306,10 +4301,10 @@ globus_io_tcp_get_security_context(
gss_ctx_id_t * context)
{
GlobusIOName(globus_io_tcp_get_security_context);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
GlobusLIOCheckNullParam(context);
-
+
return globus_xio_handle_cntl(
(*handle)->xio_handle,
globus_l_io_gsi_driver,
@@ -4323,10 +4318,10 @@ globus_io_tcp_get_delegated_credential(
gss_cred_id_t * cred)
{
GlobusIOName(globus_io_tcp_get_delegated_credential);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
GlobusLIOCheckNullParam(cred);
-
+
return globus_xio_handle_cntl(
(*handle)->xio_handle,
globus_l_io_gsi_driver,
@@ -4341,23 +4336,23 @@ globus_io_tcp_set_credential(
gss_cred_id_t credential)
{
GlobusIOName(globus_io_tcp_set_credential);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
-
+
if ((*handle)->xio_handle)
{
return globus_xio_handle_cntl(
- (*handle)->xio_handle,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_CREDENTIAL,
+ (*handle)->xio_handle,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_CREDENTIAL,
credential);
}
else
{
return globus_xio_attr_cntl(
- (*handle)->attr->attr,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_CREDENTIAL,
+ (*handle)->attr->attr,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_CREDENTIAL,
credential);
}
}
@@ -4369,22 +4364,22 @@ globus_io_tcp_get_credential(
gss_cred_id_t * credential)
{
GlobusIOName(globus_io_tcp_get_credential);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
GlobusLIOCheckNullParam(credential);
-
+
return globus_xio_handle_cntl(
- (*handle)->xio_handle,
- globus_l_io_gsi_driver,
+ (*handle)->xio_handle,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_CREDENTIAL,
credential);
}
static
-void
+void
globus_l_io_init_delegation_cb(
- globus_result_t result,
- void * user_arg)
+ globus_result_t result,
+ void * user_arg)
{
globus_l_io_delegation_cb_arg_t * wrapper;
GlobusIOName(globus_l_io_init_delegation_cb);
@@ -4403,16 +4398,16 @@ globus_l_io_init_delegation_cb(
}
static
-void
+void
globus_l_io_accept_delegation_cb(
- globus_result_t result,
+ globus_result_t result,
gss_cred_id_t delegated_cred,
OM_uint32 time_rec,
- void * user_arg)
+ void * user_arg)
{
globus_l_io_delegation_cb_arg_t * wrapper;
GlobusIOName(globus_l_io_accept_delegation_cb);
-
+
wrapper = (globus_l_io_delegation_cb_arg_t *) user_arg;
wrapper->callback(wrapper->user_arg,
@@ -4454,7 +4449,7 @@ globus_io_register_init_delegation(
wrapper->handle = handle;
wrapper->user_arg = callback_arg;
wrapper->callback = callback;
-
+
result = globus_xio_handle_cntl(
ihandle->xio_handle,
globus_l_io_gsi_driver,
@@ -4469,7 +4464,7 @@ globus_io_register_init_delegation(
{
free(wrapper);
}
-
+
return result;
}
@@ -4482,12 +4477,12 @@ globus_io_init_delegation(
OM_uint32 time_req)
{
globus_result_t result;
- globus_l_io_handle_t * ihandle;
+ globus_l_io_handle_t * ihandle;
GlobusIOName(globus_io_init_delegation);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
ihandle = *handle;
-
+
result = globus_xio_handle_cntl(
ihandle->xio_handle,
globus_l_io_gsi_driver,
@@ -4495,8 +4490,8 @@ globus_io_init_delegation(
cred_handle,
restriction_oids,
restriction_buffers,
- time_req);
-
+ time_req);
+
return result;
}
@@ -4513,7 +4508,7 @@ globus_io_register_accept_delegation(
globus_l_io_handle_t * ihandle;
globus_l_io_delegation_cb_arg_t * wrapper;
GlobusIOName(globus_io_register_accept_delegation);
-
+
GlobusLIOCheckNullParam(callback);
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
ihandle = *handle;
@@ -4536,7 +4531,7 @@ globus_io_register_accept_delegation(
restriction_buffers,
time_req,
globus_l_io_accept_delegation_cb,
- wrapper);
+ wrapper);
if(result != GLOBUS_SUCCESS)
{
free(wrapper);
@@ -4555,12 +4550,12 @@ globus_io_accept_delegation(
OM_uint32 * time_rec)
{
globus_result_t result;
- globus_l_io_handle_t * ihandle;
+ globus_l_io_handle_t * ihandle;
GlobusIOName(globus_io_accept_delegation);
-
+
GlobusLIOCheckHandle(handle, GLOBUS_I_IO_TCP_HANDLE);
ihandle = *handle;
-
+
result = globus_xio_handle_cntl(
ihandle->xio_handle,
globus_l_io_gsi_driver,
@@ -4570,9 +4565,9 @@ globus_io_accept_delegation(
restriction_buffers,
time_req,
time_rec);
-
+
return result;
-
+
}
globus_result_t
@@ -4584,7 +4579,7 @@ globus_io_attr_set_secure_authentication_mode(
{
globus_result_t result = GLOBUS_SUCCESS;
GlobusIOName(globus_io_attr_set_secure_authentication_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
(*attr)->authentication_mode = mode;
@@ -4593,18 +4588,18 @@ globus_io_attr_set_secure_authentication_mode(
case GLOBUS_IO_SECURE_AUTHENTICATION_MODE_GSSAPI:
case GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL:
if(credential != GSS_C_NO_CREDENTIAL)
- {
+ {
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_CREDENTIAL,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_CREDENTIAL,
credential);
}
break;
case GLOBUS_IO_SECURE_AUTHENTICATION_MODE_ANONYMOUS:
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_ANON);
break;
case GLOBUS_IO_SECURE_AUTHENTICATION_MODE_NONE:
@@ -4613,7 +4608,7 @@ globus_io_attr_set_secure_authentication_mode(
globus_assert(0 && "Unexpected state");
break;
}
-
+
return result;
}
@@ -4625,10 +4620,10 @@ globus_io_attr_get_secure_authentication_mode(
gss_cred_id_t * credential)
{
GlobusIOName(globus_io_attr_get_secure_authentication_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(mode);
-
+
*mode = (*attr)->authentication_mode;
return GLOBUS_SUCCESS;
}
@@ -4645,7 +4640,7 @@ globus_io_attr_set_secure_authorization_mode(
OM_uint32 major_status;
OM_uint32 minor_status;
GlobusIOName(globus_io_attr_set_secure_authorization_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
(*attr)->authorization_mode = mode;
@@ -4661,9 +4656,9 @@ globus_io_attr_set_secure_authorization_mode(
(*attr)->authz_data.identity = GSS_C_NO_NAME;
}
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_AUTHORIZATION_MODE,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_AUTHORIZATION_MODE,
mode);
break;
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY:
@@ -4672,7 +4667,7 @@ globus_io_attr_set_secure_authorization_mode(
{
gss_release_name(&minor_status,
&(*attr)->authz_data.identity);
- }
+ }
major_status = gss_duplicate_name(&minor_status,
(*data)->identity,
@@ -4685,34 +4680,34 @@ globus_io_attr_set_secure_authorization_mode(
minor_status);
goto error;
}
-
+
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_AUTHORIZATION_MODE,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_AUTHORIZATION_MODE,
mode);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
-
+
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_TARGET_NAME,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_TARGET_NAME,
(*attr)->authz_data.identity);
- break;
+ break;
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK:
GlobusLIOCheckNullParam(data);
- (*attr)->authz_data.callback = (*data)->callback;
- (*attr)->authz_data.callback_arg = (*data)->callback_arg;
+ (*attr)->authz_data.callback = (*data)->callback;
+ (*attr)->authz_data.callback_arg = (*data)->callback_arg;
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
- GLOBUS_XIO_GSI_SET_AUTHORIZATION_MODE,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
+ GLOBUS_XIO_GSI_SET_AUTHORIZATION_MODE,
GLOBUS_IO_SECURE_AUTHORIZATION_MODE_NONE);
- break;
+ break;
}
error:
@@ -4731,28 +4726,28 @@ globus_io_attr_get_secure_authorization_mode(
OM_uint32 major_status;
OM_uint32 minor_status;
GlobusIOName(globus_io_attr_get_secure_authorization_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(data);
GlobusLIOCheckNullParam(mode);
-
+
result = GlobusLIOMalloc(*data, globus_l_io_secure_authorization_data_t);
if(result != GLOBUS_SUCCESS)
{
goto done;
}
-
+
memset(*data, 0, sizeof(globus_l_io_secure_authorization_data_t));
*mode = (*attr)->authorization_mode;
switch((*attr)->authorization_mode)
{
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_NONE:
- break;
+ break;
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_SELF:
- break;
+ break;
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_HOST:
- break;
+ break;
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY:
major_status = gss_duplicate_name(&minor_status,
(*attr)->authz_data.identity,
@@ -4763,15 +4758,15 @@ globus_io_attr_get_secure_authorization_mode(
major_status,
minor_status);
}
- break;
+ break;
case GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK:
- (*data)->callback = (*attr)->authz_data.callback;
- (*data)->callback_arg = (*attr)->authz_data.callback_arg;
- break;
+ (*data)->callback = (*attr)->authz_data.callback;
+ (*data)->callback_arg = (*attr)->authz_data.callback_arg;
+ break;
}
done:
-
+
return result;
}
@@ -4781,7 +4776,7 @@ globus_io_attr_set_secure_extension_oids(
gss_OID_set extension_oids)
{
GlobusIOName(globus_io_attr_set_secure_extension_oids);
- return GLOBUS_SUCCESS;
+ return GLOBUS_SUCCESS;
}
globus_result_t
@@ -4790,7 +4785,7 @@ globus_io_attr_get_secure_extension_oids(
gss_OID_set * extension_oids)
{
GlobusIOName(globus_io_attr_get_secure_extension_oids);
- return GLOBUS_SUCCESS;
+ return GLOBUS_SUCCESS;
}
globus_result_t
@@ -4801,13 +4796,13 @@ globus_io_secure_authorization_data_initialize(
GlobusIOName(globus_io_secure_authorization_data_initialize);
GlobusLIOCheckNullParam(data);
-
+
result = GlobusLIOMalloc(*data, globus_l_io_secure_authorization_data_t);
if(result == GLOBUS_SUCCESS)
{
memset(*data, 0, sizeof(globus_l_io_secure_authorization_data_t));
}
-
+
return result;
}
@@ -4817,9 +4812,9 @@ globus_io_secure_authorization_data_destroy(
data)
{
GlobusIOName(globus_io_secure_authorization_data_destroy);
-
+
GlobusLIOCheckNullParam(data);
-
+
if((*data)->identity != GSS_C_NO_NAME)
{
OM_uint32 minor_status;
@@ -4830,7 +4825,7 @@ globus_io_secure_authorization_data_destroy(
globus_free(*data);
*data = GLOBUS_NULL;
-
+
return GLOBUS_SUCCESS;
}
@@ -4849,7 +4844,7 @@ globus_io_secure_authorization_data_set_identity(
GlobusLIOCheckNullParam(data);
GlobusLIOCheckNullParam(identity);
-
+
if(!strncmp("GSI-NO-TARGET", identity, 13))
{
(*data)->identity = GSS_C_NO_NAME;
@@ -4858,24 +4853,24 @@ globus_io_secure_authorization_data_set_identity(
{
name_buffer.value = identity;
name_buffer.length = strlen(identity);
-
- /*
+
+ /*
* A GSS_C_NT_HOSTBASED_SERVICE is of the form service@FQDN
- * At least the Globus gssapi, and the Kerberos gssapi
- * use the same form. We will check for
+ * At least the Globus gssapi, and the Kerberos gssapi
+ * use the same form. We will check for
* two special forms here: host@FQDN and ftp@FQDN
*/
- if (strchr(identity,'@') &&
+ if (strchr(identity,'@') &&
!strstr(identity,"CN="))
- {
+ {
name_type = GSS_C_NT_HOSTBASED_SERVICE;
}
else if(!strncmp("",identity, 11))
{
name_type = GSS_C_NT_ANONYMOUS;
}
-
+
major_status = gss_import_name(&minor_status,
&name_buffer,
name_type,
@@ -4887,7 +4882,7 @@ globus_io_secure_authorization_data_set_identity(
minor_status);
}
}
-
+
return result;
}
@@ -4899,16 +4894,16 @@ globus_io_secure_authorization_data_get_identity(
{
globus_result_t result = GLOBUS_SUCCESS;
GlobusIOName(globus_io_secure_authorization_data_get_identity);
-
+
GlobusLIOCheckNullParam(data);
GlobusLIOCheckNullParam(identity);
-
+
if((*data)->identity != GSS_C_NO_NAME)
- {
+ {
OM_uint32 major_status;
OM_uint32 minor_status;
gss_buffer_desc name_buffer;
-
+
major_status = gss_display_name(&minor_status,
(*data)->identity,
&name_buffer,
@@ -4922,7 +4917,7 @@ globus_io_secure_authorization_data_get_identity(
}
/* could probably just realloc the buffer contents */
-
+
result = GlobusLIOMallocSize(*identity, name_buffer.length + 1);
if(result != GLOBUS_SUCCESS)
@@ -4945,7 +4940,7 @@ globus_io_secure_authorization_data_get_identity(
}
done:
-
+
return result;
}
@@ -4958,12 +4953,12 @@ globus_io_secure_authorization_data_set_callback(
void * callback_arg)
{
GlobusIOName(globus_io_secure_authorization_data_set_callback);
-
+
GlobusLIOCheckNullParam(data);
-
+
(*data)->callback = callback;
(*data)->callback_arg = callback_arg;
-
+
return GLOBUS_SUCCESS;
}
@@ -4976,14 +4971,14 @@ globus_io_secure_authorization_data_get_callback(
void ** callback_arg)
{
GlobusIOName(globus_io_secure_authorization_data_get_callback);
-
+
GlobusLIOCheckNullParam(data);
GlobusLIOCheckNullParam(callback);
GlobusLIOCheckNullParam(callback_arg);
-
+
*callback = (*data)->callback;
*callback_arg = (*data)->callback_arg;
-
+
return GLOBUS_SUCCESS;
}
@@ -4994,18 +4989,18 @@ globus_io_attr_set_secure_channel_mode(
{
globus_result_t result = GLOBUS_SUCCESS;
globus_xio_gsi_protection_level_t protection_level;
-
+
GlobusIOName(globus_io_attr_set_secure_channel_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
(*attr)->channel_mode = mode;
switch(mode)
{
case GLOBUS_IO_SECURE_CHANNEL_MODE_CLEAR:
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_SSL_COMPATIBLE,
GLOBUS_FALSE);
if(result != GLOBUS_SUCCESS)
@@ -5014,8 +5009,8 @@ globus_io_attr_set_secure_channel_mode(
}
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_PROTECTION_LEVEL,
GLOBUS_XIO_GSI_PROTECTION_LEVEL_NONE);
break;
@@ -5032,18 +5027,18 @@ globus_io_attr_set_secure_channel_mode(
case GLOBUS_IO_SECURE_CHANNEL_MODE_GSI_WRAP:
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_WRAP_MODE,
GLOBUS_TRUE);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
-
+
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_PROTECTION_LEVEL,
&protection_level);
@@ -5053,10 +5048,10 @@ globus_io_attr_set_secure_channel_mode(
}
if(protection_level == GLOBUS_XIO_GSI_PROTECTION_LEVEL_NONE)
- {
+ {
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_PROTECTION_LEVEL,
GLOBUS_XIO_GSI_PROTECTION_LEVEL_INTEGRITY);
}
@@ -5064,18 +5059,18 @@ globus_io_attr_set_secure_channel_mode(
case GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP:
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_SSL_COMPATIBLE,
GLOBUS_TRUE);
if(result != GLOBUS_SUCCESS)
{
goto error;
}
-
+
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_PROTECTION_LEVEL,
&protection_level);
@@ -5085,16 +5080,16 @@ globus_io_attr_set_secure_channel_mode(
}
if(protection_level == GLOBUS_XIO_GSI_PROTECTION_LEVEL_NONE)
- {
+ {
result = globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_PROTECTION_LEVEL,
GLOBUS_XIO_GSI_PROTECTION_LEVEL_INTEGRITY);
}
break;
}
-
+
error:
return result;
}
@@ -5105,10 +5100,10 @@ globus_io_attr_get_secure_channel_mode(
globus_io_secure_channel_mode_t * mode)
{
GlobusIOName(globus_io_attr_get_secure_channel_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(mode);
-
+
*mode = (*attr)->channel_mode;
return GLOBUS_SUCCESS;
}
@@ -5119,12 +5114,12 @@ globus_io_attr_set_secure_protection_mode(
globus_io_secure_protection_mode_t mode)
{
GlobusIOName(globus_io_attr_set_secure_protection_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_PROTECTION_LEVEL,
mode);
}
@@ -5135,13 +5130,13 @@ globus_io_attr_get_secure_protection_mode(
globus_io_secure_protection_mode_t *mode)
{
GlobusIOName(globus_io_attr_get_secure_protection_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(mode);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_PROTECTION_LEVEL,
mode);
}
@@ -5152,12 +5147,12 @@ globus_io_attr_set_secure_delegation_mode(
globus_io_secure_delegation_mode_t mode)
{
GlobusIOName(globus_io_attr_set_secure_delegation_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_DELEGATION_MODE,
mode);
}
@@ -5170,13 +5165,13 @@ globus_io_attr_get_secure_delegation_mode(
mode)
{
GlobusIOName(globus_io_attr_set_secure_delegation_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(mode);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_DELEGATION_MODE,
mode);
}
@@ -5187,12 +5182,12 @@ globus_io_attr_set_secure_proxy_mode(
globus_io_secure_proxy_mode_t mode)
{
GlobusIOName(globus_io_attr_set_secure_proxy_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_SET_PROXY_MODE,
mode);
}
@@ -5203,13 +5198,13 @@ globus_io_attr_get_secure_proxy_mode(
globus_io_secure_proxy_mode_t * mode)
{
GlobusIOName(globus_io_attr_get_secure_proxy_mode);
-
+
GlobusLIOCheckAttr(attr, GLOBUS_I_IO_TCP_ATTR);
GlobusLIOCheckNullParam(mode);
-
+
return globus_xio_attr_cntl(
- (*attr)->attr,
- globus_l_io_gsi_driver,
+ (*attr)->attr,
+ globus_l_io_gsi_driver,
GLOBUS_XIO_GSI_GET_PROXY_MODE,
mode);
}
diff --git a/myproxy/source/certauth_extensions.c b/myproxy/source/certauth_extensions.c
index 14af33e542..47a12116a3 100644
--- a/myproxy/source/certauth_extensions.c
+++ b/myproxy/source/certauth_extensions.c
@@ -43,10 +43,10 @@ RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
#endif
-static int
+static int
read_cert_request(GSI_SOCKET *self,
- unsigned char **buffer,
- size_t *length) {
+ unsigned char **buffer,
+ size_t *length) {
int return_value = 1;
unsigned char * input_buffer = NULL;
@@ -58,7 +58,7 @@ read_cert_request(GSI_SOCKET *self,
}
if (GSI_SOCKET_read_token(self, &input_buffer,
- &input_buffer_length) == GSI_SOCKET_ERROR) {
+ &input_buffer_length) == GSI_SOCKET_ERROR) {
verror_put_string("read_cert_request(): Read from socket failed");
goto error;
}
@@ -81,13 +81,13 @@ read_cert_request(GSI_SOCKET *self,
}
-static int
+static int
send_certificate(GSI_SOCKET *self,
- unsigned char *buffer,
- size_t length) {
+ unsigned char *buffer,
+ size_t length) {
- if (GSI_SOCKET_write_buffer(self, (const char *)buffer,
- length) == GSI_SOCKET_ERROR) {
+ if (GSI_SOCKET_write_buffer(self, (const char *)buffer,
+ length) == GSI_SOCKET_ERROR) {
verror_put_string("Error writing certificate to client!");
return 1;
}
@@ -96,7 +96,7 @@ send_certificate(GSI_SOCKET *self,
}
-static void
+static void
add_key_value( char * key, char * value, char buffer[] ) {
strcat( buffer, key );
@@ -110,11 +110,11 @@ add_key_value( char * key, char * value, char buffer[] ) {
}
-static int
-external_callout( X509_REQ *request,
- X509 **cert,
- myproxy_request_t *client_request,
- myproxy_server_context_t *server_context) {
+static int
+external_callout( X509_REQ *request,
+ X509 **cert,
+ myproxy_request_t *client_request,
+ myproxy_server_context_t *server_context) {
int return_value = 1;
@@ -131,12 +131,12 @@ external_callout( X509_REQ *request,
memset(buffer, '\0', BUF_SIZE);
memset(intbuf, '\0', 128);
- myproxy_debug("callout using: %s",
- server_context->certificate_issuer_program);
+ myproxy_debug("callout using: %s",
+ server_context->certificate_issuer_program);
if ((pid = myproxy_popen(fds,
- server_context->certificate_issuer_program,
- NULL)) < 0) {
+ server_context->certificate_issuer_program,
+ NULL)) < 0) {
return -1; /* myproxy_popen will set verror */
}
@@ -162,7 +162,7 @@ external_callout( X509_REQ *request,
add_key_value( "authzcreds", client_request->authzcreds, buffer );
add_key_value( "keyretrieve", client_request->keyretrieve, buffer );
add_key_value( "trusted_retrievers", client_request->trusted_retrievers,
- buffer );
+ buffer );
sprintf( intbuf, "%d", server_context->max_cert_lifetime );
add_key_value( "max_cert_lifetime", (char*)intbuf, buffer );
@@ -253,10 +253,10 @@ lock_file(int fd)
while( fcntl( fd, F_SETLKW, &fl ) < 0 )
{
- if ( errno != EINTR )
- {
- return -1;
- }
+ if ( errno != EINTR )
+ {
+ return -1;
+ }
}
return 0;
}
@@ -266,9 +266,9 @@ lock_file(int fd)
* of file locking
*/
-static int
-assign_serial_number( X509 *cert,
- myproxy_server_context_t *server_context ) {
+static int
+assign_serial_number( X509 *cert,
+ myproxy_server_context_t *server_context ) {
int retval = 1;
long serialset;
@@ -301,7 +301,7 @@ assign_serial_number( X509 *cert,
const char *sdir;
sdir = myproxy_get_storage_dir();
if (sdir == NULL) {
- goto error;
+ goto error;
}
serialfile = malloc(strlen(sdir)+strlen("/serial")+1);
sprintf(serialfile, "%s/serial", sdir);
@@ -351,17 +351,17 @@ assign_serial_number( X509 *cert,
if (serialset) {
if (!a2i_ASN1_INTEGER(serialbio, current, buf, sizeof(buf))) {
- verror_put_string("Asn1 int read/conversion error\n");
+ verror_put_string("Asn1 int read/conversion error\n");
ssl_error_to_verror();
- goto error;
+ goto error;
} else {
- myproxy_debug("Loaded serial number 0x%s from %s", buf, serialfile);
+ myproxy_debug("Loaded serial number 0x%s from %s", buf, serialfile);
}
} else {
ASN1_INTEGER_set(current, server_context->certificate_serial_skip);
}
- serial = BN_bin2bn( current->data, current->length, serial );
+ serial = BN_bin2bn( ASN1_STRING_get0_data(current), ASN1_STRING_length(current), serial );
if ( serial == NULL ) {
verror_put_string("Error converting to bignum\n");
ssl_error_to_verror();
@@ -393,7 +393,7 @@ assign_serial_number( X509 *cert,
* the underlying file stream and close()ing the file descriptor,
* which will release the lock.
*/
-
+
BIO_free(serialbio);
serialbio = NULL;
serialstream = NULL;
@@ -447,7 +447,7 @@ write_certificate(X509 *cert, const char serial[], const char dir[]) {
goto error;
}
close(fd);
- if ((bp=BIO_new(BIO_s_file())) == NULL) {
+ if ((bp=BIO_new(BIO_s_file())) == NULL) {
myproxy_debug("BIO_new(BIO_s_file()) failed");
goto error;
}
@@ -463,7 +463,7 @@ write_certificate(X509 *cert, const char serial[], const char dir[]) {
error:
free(path);
- BIO_free_all(bp);
+ BIO_free_all(bp);
return rval;
}
@@ -474,14 +474,14 @@ static ENGINE *engine=NULL;
static int engine_used=0;
#endif
-static int
-generate_certificate( X509_REQ *request,
- X509 **certificate,
- EVP_PKEY *pkey,
- myproxy_request_t *client_request,
- myproxy_server_context_t *server_context) {
+static int
+generate_certificate( X509_REQ *request,
+ X509 **certificate,
+ EVP_PKEY *pkey,
+ myproxy_request_t *client_request,
+ myproxy_server_context_t *server_context) {
- int return_value = 1;
+ int return_value = 1;
int not_after;
int lockfd = -1;
int i;
@@ -503,7 +503,7 @@ generate_certificate( X509_REQ *request,
cert = X509_new();
- ctxp = &ctx; /* needed for X509V3 macros */
+ ctxp = &ctx; /* needed for X509V3 macros */
X509V3_set_ctx_nodb(ctxp);
if (cert == NULL) {
@@ -517,12 +517,12 @@ generate_certificate( X509_REQ *request,
/* this has already been called successfully, but... */
if ( user_dn_lookup( client_request->username, &userdn,
- server_context ) ) {
+ server_context ) ) {
verror_put_string("unknown username: %s", client_request->username);
goto error;
}
- subject = X509_get_subject_name(cert);
+ subject = X509_NAME_dup(X509_get_subject_name(cert));
globus_result =
globus_gsi_cert_utils_get_x509_name(userdn, strlen(userdn), subject);
@@ -536,23 +536,21 @@ generate_certificate( X509_REQ *request,
problems we find.*/
for (i = 0; i < X509_NAME_entry_count(subject); i++)
{
- X509_NAME_ENTRY *ne = NULL;
- ASN1_STRING *str = NULL;
- ASN1_OBJECT *obj = NULL;
+ const X509_NAME_ENTRY *ne = NULL;
+ const ASN1_STRING *str = NULL;
+ const ASN1_OBJECT *obj = NULL;
ne = X509_NAME_get_entry(subject, i);
str = X509_NAME_ENTRY_get_data(ne);
obj = X509_NAME_ENTRY_get_object(ne);
if ((OBJ_obj2nid(obj) == NID_domainComponent) &&
- (str->type == V_ASN1_PRINTABLESTRING)) {
- myproxy_debug("Setting DC type to IA5String.");
- str->type = V_ASN1_IA5STRING;
+ (ASN1_STRING_type(str) == V_ASN1_PRINTABLESTRING)) {
+ myproxy_debug("Can't set DC type to IA5String.");
}
if ((OBJ_obj2nid(obj) == NID_pkcs9_emailAddress) &&
- (str->type == V_ASN1_PRINTABLESTRING)) {
- myproxy_debug("Setting emailAddress type to IA5String.");
- str->type = V_ASN1_IA5STRING;
+ (ASN1_STRING_type(str) == V_ASN1_PRINTABLESTRING)) {
+ myproxy_debug("Can't set emailAddress type to IA5String.");
}
}
@@ -561,16 +559,19 @@ generate_certificate( X509_REQ *request,
issuer_cert_file = fopen(server_context->certificate_issuer_cert, "r");
if (issuer_cert_file == NULL) {
verror_put_string("Error opening certificate file %s",
- server_context->certificate_issuer_cert);
+ server_context->certificate_issuer_cert);
verror_put_errno(errno);
goto error;
}
-
+
+ X509_set_subject_name(cert, subject);
+ X509_NAME_free(subject);
+
if ((issuer_cert = PEM_read_X509(issuer_cert_file,
- NULL, NULL, NULL)) == NULL)
+ NULL, NULL, NULL)) == NULL)
{
verror_put_string("Error reading certificate %s",
- server_context->certificate_issuer_cert);
+ server_context->certificate_issuer_cert);
ssl_error_to_verror();
fclose(issuer_cert_file);
goto error;
@@ -595,10 +596,10 @@ generate_certificate( X509_REQ *request,
if (!server_context->max_cert_lifetime) {
not_after = MIN(client_request->proxy_lifetime,
- SECONDS_PER_HOUR * MYPROXY_DEFAULT_DELEG_HOURS);
+ SECONDS_PER_HOUR * MYPROXY_DEFAULT_DELEG_HOURS);
} else {
not_after = MIN(client_request->proxy_lifetime,
- server_context->max_cert_lifetime);
+ server_context->max_cert_lifetime);
}
myproxy_debug("cert lifetime: %d", not_after );
@@ -606,7 +607,7 @@ generate_certificate( X509_REQ *request,
/* allow 5m clock skew */
X509_gmtime_adj(X509_get_notBefore(cert), -(MYPROXY_DEFAULT_CLOCK_SKEW));
X509_gmtime_adj(X509_get_notAfter(cert), (long)not_after);
-
+
X509_set_pubkey(cert, pkey);
/* extensions */
@@ -617,77 +618,77 @@ generate_certificate( X509_REQ *request,
long errorline = -1;
extconf = NCONF_new(NULL);
if (server_context->certificate_extfile) {
- if (NCONF_load(extconf, server_context->certificate_extfile,
- &errorline) <= 0) {
- if (errorline <= 0) {
- verror_put_string("OpenSSL error loading the certificate_extfile '%s'", server_context->certificate_extfile);
- } else {
- verror_put_string("OpenSSL error on line %ld of certificate_extfile '%s'\n", errorline, server_context->certificate_extfile);
- }
- goto error;
- }
- myproxy_debug("Successfully loaded extensions file %s.",
- server_context->certificate_extfile);
+ if (NCONF_load(extconf, server_context->certificate_extfile,
+ &errorline) <= 0) {
+ if (errorline <= 0) {
+ verror_put_string("OpenSSL error loading the certificate_extfile '%s'", server_context->certificate_extfile);
+ } else {
+ verror_put_string("OpenSSL error on line %ld of certificate_extfile '%s'\n", errorline, server_context->certificate_extfile);
+ }
+ goto error;
+ }
+ myproxy_debug("Successfully loaded extensions file %s.",
+ server_context->certificate_extfile);
} else {
- pid_t childpid;
- int fds[3];
- int exit_status;
- FILE *nconf_stream = NULL;
- myproxy_debug("calling %s", server_context->certificate_extapp);
- if ((childpid = myproxy_popen(fds,
- server_context->certificate_extapp,
- client_request->username,
- NULL)) < 0) {
- return -1; /* myproxy_popen will set verror */
- }
- close(fds[0]);
- if (waitpid(childpid, &exit_status, 0) == -1) {
- verror_put_string("wait() failed for extapp child");
- verror_put_errno(errno);
- return -1;
- }
- if (exit_status != 0) {
- FILE *fp = NULL;
- char buf[100];
- verror_put_string("Certificate extension call-out returned non-zero.");
- fp = fdopen(fds[1], "r");
- if (fp) {
- while (fgets(buf, 100, fp) != NULL) {
- verror_put_string("%s", buf);
- }
- fclose(fp);
- }
- fp = fdopen(fds[2], "r");
- if (fp) {
- while (fgets(buf, 100, fp) != NULL) {
- verror_put_string("%s", buf);
- }
- fclose(fp);
- }
- goto error;
- }
- close(fds[2]);
- nconf_stream = fdopen(fds[1], "r");
- if (NCONF_load_fp(extconf, nconf_stream, &errorline) <= 0) {
- if (errorline <= 0) {
- verror_put_string("OpenSSL error parsing output of certificate_extapp call-out.");
- } else {
- verror_put_string("OpenSSL error parsing line %ld of of certificate_extapp call-out output.", errorline);
- }
- fclose(nconf_stream);
- goto error;
- }
- fclose(nconf_stream);
+ pid_t childpid;
+ int fds[3];
+ int exit_status;
+ FILE *nconf_stream = NULL;
+ myproxy_debug("calling %s", server_context->certificate_extapp);
+ if ((childpid = myproxy_popen(fds,
+ server_context->certificate_extapp,
+ client_request->username,
+ NULL)) < 0) {
+ return -1; /* myproxy_popen will set verror */
+ }
+ close(fds[0]);
+ if (waitpid(childpid, &exit_status, 0) == -1) {
+ verror_put_string("wait() failed for extapp child");
+ verror_put_errno(errno);
+ return -1;
+ }
+ if (exit_status != 0) {
+ FILE *fp = NULL;
+ char buf[100];
+ verror_put_string("Certificate extension call-out returned non-zero.");
+ fp = fdopen(fds[1], "r");
+ if (fp) {
+ while (fgets(buf, 100, fp) != NULL) {
+ verror_put_string("%s", buf);
+ }
+ fclose(fp);
+ }
+ fp = fdopen(fds[2], "r");
+ if (fp) {
+ while (fgets(buf, 100, fp) != NULL) {
+ verror_put_string("%s", buf);
+ }
+ fclose(fp);
+ }
+ goto error;
+ }
+ close(fds[2]);
+ nconf_stream = fdopen(fds[1], "r");
+ if (NCONF_load_fp(extconf, nconf_stream, &errorline) <= 0) {
+ if (errorline <= 0) {
+ verror_put_string("OpenSSL error parsing output of certificate_extapp call-out.");
+ } else {
+ verror_put_string("OpenSSL error parsing line %ld of of certificate_extapp call-out output.", errorline);
+ }
+ fclose(nconf_stream);
+ goto error;
+ }
+ fclose(nconf_stream);
}
X509V3_set_nconf(&ctx, extconf);
if (!X509V3_EXT_add_nconf(extconf, &ctx, "default", cert))
{
- verror_put_string("OpenSSL error adding extensions.");
+ verror_put_string("OpenSSL error adding extensions.");
ssl_error_to_verror();
- goto error;
+ goto error;
}
myproxy_debug("Successfully added extensions.");
- } else { /* add some defaults */
+ } else { /* add some defaults */
add_ext(ctxp, cert, NID_key_usage, "critical,Digital Signature, Key Encipherment, Data Encipherment");
add_ext(ctxp, cert, NID_ext_key_usage, "clientAuth");
add_ext(ctxp, cert, NID_basic_constraints, "critical,CA:FALSE");
@@ -696,9 +697,9 @@ generate_certificate( X509_REQ *request,
if (server_context->certificate_issuer_email_domain) {
char *email;
email = malloc(strlen(client_request->username)+strlen("email:@")+1+
- strlen(server_context->certificate_issuer_email_domain));
+ strlen(server_context->certificate_issuer_email_domain));
sprintf(email, "email:%s@%s", client_request->username,
- server_context->certificate_issuer_email_domain);
+ server_context->certificate_issuer_email_domain);
add_ext(ctxp, cert, NID_subject_alt_name, email);
free(email);
}
@@ -739,13 +740,13 @@ generate_certificate( X509_REQ *request,
if (!inkey) {
verror_put_string("Could not open cakey file handle: %s",
- server_context->certificate_issuer_key);
+ server_context->certificate_issuer_key);
verror_put_errno(errno);
goto error;
}
cakey = PEM_read_PrivateKey( inkey, NULL, NULL,
- (char *)server_context->certificate_issuer_key_passphrase );
+ (char *)server_context->certificate_issuer_key_passphrase );
fclose(inkey);
}
@@ -774,7 +775,7 @@ generate_certificate( X509_REQ *request,
verror_put_string("Certificate/cakey sign failed.");
ssl_error_to_verror();
goto error;
- }
+ }
serial = i2s_ASN1_OCTET_STRING(NULL, X509_get_serialNumber(cert));
#ifndef OPENSSL_NO_ENGINE
if (engine) {
@@ -794,7 +795,7 @@ generate_certificate( X509_REQ *request,
myproxy_log("Issued certificate for user \"%s\", with DN \"%s\", "
"lifetime \"%d\", and serial number \"0x%s\"",
- client_request->username, userdn,
+ client_request->username, userdn,
not_after,
serial
);
@@ -824,7 +825,8 @@ generate_certificate( X509_REQ *request,
}
-static int
+#ifndef OPENSSL_NO_ENGINE
+static int
arraylen(char **options) {
char **ptr;
int c = 0;
@@ -835,7 +837,6 @@ arraylen(char **options) {
return c;
}
-#ifndef OPENSSL_NO_ENGINE
void shutdown_openssl_engine(void) {
if (e_cakey) EVP_PKEY_free( e_cakey );
if (engine) ENGINE_finish(engine);
@@ -846,39 +847,37 @@ void shutdown_openssl_engine(void) {
if (engine_used) ENGINE_cleanup();
}
-#endif
static int ui_read_fn(UI *ui, UI_STRING *ui_string) {
switch(UI_get_string_type(ui_string)) {
- case UIT_PROMPT:
- case UIT_VERIFY:
- if(UI_get_input_flags(ui_string) & UI_INPUT_FLAG_ECHO) {
- UI_set_result(ui, ui_string, (char *) UI_get0_user_data(ui));
- return 1;
- } else {
+ case UIT_PROMPT:
+ case UIT_VERIFY:
+ if(UI_get_input_flags(ui_string) & UI_INPUT_FLAG_ECHO) {
+ UI_set_result(ui, ui_string, (char *) UI_get0_user_data(ui));
+ return 1;
+ } else {
+ return 0; /* not supported! */
+ }
+ case UIT_BOOLEAN:
+ default:
return 0; /* not supported! */
- }
- case UIT_BOOLEAN:
- default:
- return 0; /* not supported! */
}
}
static int ui_write_fn(UI *ui, UI_STRING *ui_string) {
switch(UI_get_string_type(ui_string)) {
- case UIT_ERROR:
- verror_put_string("%s", UI_get0_output_string(ui_string));
- break;
- case UIT_INFO:
- myproxy_log("%s", UI_get0_output_string(ui_string));
- break;
- default:
- break;
+ case UIT_ERROR:
+ verror_put_string("%s", UI_get0_output_string(ui_string));
+ break;
+ case UIT_INFO:
+ myproxy_log("%s", UI_get0_output_string(ui_string));
+ break;
+ default:
+ break;
}
return 1;
}
-#ifndef OPENSSL_NO_ENGINE
int initialise_openssl_engine(myproxy_server_context_t *server_context) {
ENGINE *e;
EVP_PKEY *cakey;
@@ -889,7 +888,7 @@ int initialise_openssl_engine(myproxy_server_context_t *server_context) {
UI_method_set_reader(ui_method, ui_read_fn);
UI_method_set_writer(ui_method, ui_write_fn);
- SSL_load_error_strings();
+ SSL_load_error_strings();
ENGINE_load_builtin_engines();
myproxy_log("Initialising OpenSSL signing engine '%s'....", engine_id);
@@ -900,12 +899,12 @@ int initialise_openssl_engine(myproxy_server_context_t *server_context) {
UI_destroy_method(ui_method);
return 0;
}
- if(server_context->certificate_openssl_engine_pre) {
- char **pre_cmds;
- int pre_num;
+ if(server_context->certificate_openssl_engine_pre) {
+ char **pre_cmds;
+ int pre_num;
pre_cmds = server_context->certificate_openssl_engine_pre;
- pre_num = arraylen(pre_cmds);
- while(pre_num--) {
+ pre_num = arraylen(pre_cmds);
+ while(pre_num--) {
char *name, *value=NULL;
char *n = strchr(pre_cmds[0], ':');
if(n==NULL) {
@@ -915,19 +914,19 @@ int initialise_openssl_engine(myproxy_server_context_t *server_context) {
name=pre_cmds[0];
value=n+1;
}
- if(!ENGINE_ctrl_cmd_string(e, name, value, 0)) {
+ if(!ENGINE_ctrl_cmd_string(e, name, value, 0)) {
fprintf(stderr, "Failed pre command (%s - %s:%s)\n",
engine_id, name, value ? value : "(NULL)");
ENGINE_free(e);
ENGINE_cleanup();
- UI_destroy_method(ui_method);
+ UI_destroy_method(ui_method);
return 0;
- }
- pre_cmds++;
- }
+ }
+ pre_cmds++;
+ }
}
if(!ENGINE_init(e)) {
- verror_put_string("Could not initialise engine '%s'.", engine_id);
+ verror_put_string("Could not initialise engine '%s'.", engine_id);
ssl_error_to_verror();
ENGINE_free(e);
ENGINE_cleanup();
@@ -958,7 +957,7 @@ int initialise_openssl_engine(myproxy_server_context_t *server_context) {
engine_id, name, value ? value : "(NULL)");
ENGINE_free(e);
ENGINE_cleanup();
- UI_destroy_method(ui_method);
+ UI_destroy_method(ui_method);
return 0;
}
post_cmds++;
@@ -967,31 +966,31 @@ int initialise_openssl_engine(myproxy_server_context_t *server_context) {
cakey = ENGINE_load_private_key(e, server_context->certificate_issuer_key, ui_method, (char *)server_context->certificate_issuer_key_passphrase);
- if (cakey == NULL) { /* may not be fatal... */
+ if (cakey == NULL) { /* may not be fatal... */
verror_put_string("WARNING: Could not load ENGINE cakey at %s.",
server_context->certificate_issuer_key);
ssl_error_to_verror();
myproxy_log_verror();
verror_clear();
- }
+ }
if(atexit(&shutdown_openssl_engine)!=0) {
verror_put_string("Could not register shutdown handler for engine '%s'.", engine_id);
- if (cakey) EVP_PKEY_free( cakey );
+ if (cakey) EVP_PKEY_free( cakey );
ENGINE_finish(e);
ENGINE_cleanup();
UI_destroy_method(ui_method);
return 0;
- }
+ }
myproxy_log("Initialised engine '%s' (CAKey=%s)", engine_id, server_context->certificate_issuer_key);
- /* Share with the other functions in this module. */
- e_cakey = cakey;
- engine = e;
+ /* Share with the other functions in this module. */
+ e_cakey = cakey;
+ engine = e;
- UI_destroy_method(ui_method);
- return 1;
+ UI_destroy_method(ui_method);
+ return 1;
}
#endif
@@ -1067,13 +1066,13 @@ check_newcert(const char *callout, const X509 *cert)
return do_check(callout, NULL, cert);
}
-static int
+static int
handle_certificate(unsigned char *input_buffer,
- size_t input_buffer_length,
- unsigned char **output_buffer,
- int *output_buffer_length,
- myproxy_request_t *client_request,
- myproxy_server_context_t *server_context) {
+ size_t input_buffer_length,
+ unsigned char **output_buffer,
+ int *output_buffer_length,
+ myproxy_request_t *client_request,
+ myproxy_server_context_t *server_context) {
int return_value = 1;
int verify;
@@ -1122,7 +1121,7 @@ handle_certificate(unsigned char *input_buffer,
verror_put_string("Could not extract public key from request.");
ssl_error_to_verror();
goto error;
- }
+ }
if (EVP_PKEY_id(pkey) != EVP_PKEY_RSA) {
verror_put_string("Public key in certificate request is not of type RSA.");
@@ -1155,15 +1154,15 @@ handle_certificate(unsigned char *input_buffer,
verror_put_string("Req/key did not verify: %d", verify );
ssl_error_to_verror();
goto error;
- }
+ }
/* convert pkey into string for output to log */
ASN1_digest((i2d_of_void*)i2d_PUBKEY, EVP_sha1(), (char*)pkey, md, &md_len);
- sub_hash = md[0] + (md[1] + (md[2] + (md[3] >> 1) * 256) * 256) * 256;
+ sub_hash = md[0] + (md[1] + (md[2] + (md[3] >> 1) * 256) * 256) * 256;
myproxy_log("Got a cert request for user \"%s\", "
"with pubkey hash \"0x%lx\", and lifetime \"%d\"",
- client_request->username,
+ client_request->username,
sub_hash,
client_request->proxy_lifetime
);
@@ -1177,30 +1176,30 @@ handle_certificate(unsigned char *input_buffer,
* these checks are duplicated in check_config().
*/
- if ( ( server_context->certificate_issuer_program != NULL ) &&
+ if ( ( server_context->certificate_issuer_program != NULL ) &&
( server_context->certificate_issuer_cert != NULL ) ) {
verror_put_string("CA config error: both issuer and program defined");
goto error;
- }
+ }
- if ( ( server_context->certificate_issuer_program == NULL ) &&
+ if ( ( server_context->certificate_issuer_program == NULL ) &&
( server_context->certificate_issuer_cert == NULL ) ) {
verror_put_string("CA config error: neither issuer or program defined");
goto error;
}
- if ( ( server_context->certificate_issuer_cert != NULL ) &&
+ if ( ( server_context->certificate_issuer_cert != NULL ) &&
( server_context->certificate_issuer_key == NULL ) ) {
verror_put_string("CA config error: issuer defined but no key defined");
goto error;
}
- if ( ( server_context->certificate_issuer_cert != NULL ) &&
+ if ( ( server_context->certificate_issuer_cert != NULL ) &&
( server_context->certificate_issuer_key != NULL ) ) {
myproxy_debug("Using internal openssl/generate_certificate() code");
- if ( generate_certificate( req, &cert, pkey,
- client_request, server_context ) ) {
+ if ( generate_certificate( req, &cert, pkey,
+ client_request, server_context ) ) {
verror_put_string("Internal cert generation failed");
goto error;
}
@@ -1283,16 +1282,16 @@ int is_certificate_authority_configured(myproxy_server_context_t
}
-void get_certificate_authority(myproxy_socket_attrs_t *server_attrs,
- myproxy_creds_t *creds,
- myproxy_request_t *client_request,
- myproxy_response_t *response,
- myproxy_server_context_t *server_context) {
+void get_certificate_authority(myproxy_socket_attrs_t *server_attrs,
+ myproxy_creds_t *creds,
+ myproxy_request_t *client_request,
+ myproxy_response_t *response,
+ myproxy_server_context_t *server_context) {
unsigned char * input_buffer = NULL;
- size_t input_buffer_length;
- unsigned char * output_buffer = NULL;
- int output_buffer_length;
+ size_t input_buffer_length;
+ unsigned char * output_buffer = NULL;
+ int output_buffer_length;
myproxy_debug("Calling CA Extensions");
@@ -1300,8 +1299,8 @@ void get_certificate_authority(myproxy_socket_attrs_t *server_attrs,
verror_clear();
- if ( read_cert_request( server_attrs->gsi_socket,
- &input_buffer, &input_buffer_length) ) {
+ if ( read_cert_request( server_attrs->gsi_socket,
+ &input_buffer, &input_buffer_length) ) {
verror_put_string("Unable to read request from client");
myproxy_log_verror();
response->error_string = \
@@ -1310,8 +1309,8 @@ void get_certificate_authority(myproxy_socket_attrs_t *server_attrs,
}
if ( handle_certificate( input_buffer, input_buffer_length,
- &output_buffer, &output_buffer_length,
- client_request, server_context ) ) {
+ &output_buffer, &output_buffer_length,
+ client_request, server_context ) ) {
verror_put_string("CA failed to generate certificate");
response->error_string = strdup("Certificate generation failure.\n");
myproxy_log_verror();
@@ -1319,7 +1318,7 @@ void get_certificate_authority(myproxy_socket_attrs_t *server_attrs,
}
if ( send_certificate( server_attrs->gsi_socket,
- output_buffer, output_buffer_length ) ) {
+ output_buffer, output_buffer_length ) ) {
myproxy_log_verror();
myproxy_debug("Failure to send response to client!");
goto error;
diff --git a/myproxy/source/configure.ac b/myproxy/source/configure.ac
index 032b40c71b..802618ce88 100644
--- a/myproxy/source/configure.ac
+++ b/myproxy/source/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([myproxy],[6.2.20])
+AC_INIT([myproxy],[6.2.21])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
LT_INIT([dlopen win32-dll])
diff --git a/myproxy/source/gssapi.c b/myproxy/source/gssapi.c
index e176392e4e..e78229f4eb 100644
--- a/myproxy/source/gssapi.c
+++ b/myproxy/source/gssapi.c
@@ -4,7 +4,7 @@
* Rob Siemborski (SASL v2 Conversion)
* $Id: gssapi.c,v 1.9 2007/09/27 15:40:54 basney Exp $
*/
-/*
+/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -12,7 +12,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -22,7 +22,7 @@
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any other legal
- * details, please contact
+ * details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
@@ -96,25 +96,25 @@ extern gss_OID gss_nt_service_name;
#ifdef WANT_KERBEROS5_3DES
/* Check if CyberSafe flag is defined */
#ifdef CSF_GSS_C_DES3_FLAG
-#define K5_MAX_SSF 112
+#define K5_MAX_SSF 112
#endif
/* Heimdal and MIT use the following */
#ifdef GSS_KRB5_CONF_C_QOP_DES3_KD
-#define K5_MAX_SSF 112
+#define K5_MAX_SSF 112
#endif
#endif
#ifndef K5_MAX_SSF
/* All Kerberos implementations support DES */
-#define K5_MAX_SSF 56
+#define K5_MAX_SSF 56
#endif
/* GSSAPI SASL Mechanism by Leif Johansson
* inspired by the kerberos mechanism and the gssapi_server and
* gssapi_client from the heimdal distribution by Assar Westerlund
- * and Johan Danielsson .
+ * and Johan Danielsson .
* See the configure.in file for details on dependencies.
*
* Important contributions from Sam Hartman .
@@ -126,18 +126,18 @@ extern gss_OID gss_nt_service_name;
typedef struct context {
int state;
-
+
gss_ctx_id_t gss_ctx;
gss_name_t client_name;
gss_name_t server_name;
gss_cred_id_t server_creds;
sasl_ssf_t limitssf, requiressf; /* application defined bounds, for the
- server */
+ server */
const sasl_utils_t *utils;
-
+
/* layers buffering */
decode_context_t decode_context;
-
+
char *encode_buf; /* For encoding/decoding mem management */
char *decode_buf;
char *decode_once_buf;
@@ -145,10 +145,10 @@ typedef struct context {
unsigned decode_buf_len;
unsigned decode_once_buf_len;
buffer_info_t *enc_in_buf;
-
+
char *out_buf; /* per-step mem management */
- unsigned out_buf_len;
-
+ unsigned out_buf_len;
+
char *authid; /* hold the authid between steps - server */
const char *user; /* hold the userid between steps - client */
} context_t;
@@ -210,7 +210,7 @@ static OM_uint32 (*p_krb5_gss_wrap_size_limit)
(OM_uint32 *, gss_ctx_id_t, int, gss_qop_t, OM_uint32, OM_uint32 *);
static OM_uint32 (*p_krb5_gss_add_cred)
(OM_uint32 *, gss_cred_id_t, gss_name_t, gss_OID, gss_cred_usage_t,
- OM_uint32, OM_uint32, gss_cred_id_t *, gss_OID_set *, OM_uint32 *,
+ OM_uint32, OM_uint32, gss_cred_id_t *, gss_OID_set *, OM_uint32 *,
OM_uint32 *);
static OM_uint32 (*p_krb5_gss_seal)
(OM_uint32 *, gss_ctx_id_t, int, int, gss_buffer_t, int *,
@@ -226,15 +226,15 @@ sasl_gss_lib_init(const sasl_utils_t *utils)
if (h_krb5lib) return SASL_OK;
if ((h_krb5lib = dlopen(KRB5_LIB_NAME, RTLD_LAZY)) == NULL) {
- errmsg = "Failed to open GSSAPI library";
- goto error;
+ errmsg = "Failed to open GSSAPI library";
+ goto error;
}
-#define SASL_GSS_DLSYM(x) \
- p_krb5_ ## x = dlsym(h_krb5lib, #x); \
- if (p_krb5_ ## x == NULL) { \
- errmsg = "Failed to dlsym(" #x ")"; \
- goto error; \
+#define SASL_GSS_DLSYM(x) \
+ p_krb5_ ## x = dlsym(h_krb5lib, #x); \
+ if (p_krb5_ ## x == NULL) { \
+ errmsg = "Failed to dlsym(" #x ")"; \
+ goto error; \
}
SASL_GSS_DLSYM(gss_accept_sec_context);
@@ -261,24 +261,24 @@ sasl_gss_lib_init(const sasl_utils_t *utils)
error:
dlerr = dlerror();
if (dlerr) {
- char *saslerr;
- saslerr = malloc(strlen(errmsg)+strlen(dlerr)+3);
- sprintf(saslerr, "%s: %s", errmsg, dlerr);
- SETERROR(utils, saslerr);
- free(saslerr);
+ char *saslerr;
+ saslerr = malloc(strlen(errmsg)+strlen(dlerr)+3);
+ sprintf(saslerr, "%s: %s", errmsg, dlerr);
+ SETERROR(utils, saslerr);
+ free(saslerr);
} else {
- SETERROR(utils, errmsg);
+ SETERROR(utils, errmsg);
}
if (h_krb5lib) {
- dlclose(h_krb5lib);
- h_krb5lib = NULL;
+ dlclose(h_krb5lib);
+ h_krb5lib = NULL;
}
return SASL_FAIL;
}
static void
sasl_gss_seterror_(const sasl_utils_t *utils, OM_uint32 maj, OM_uint32 min,
- int logonly)
+ int logonly)
{
OM_uint32 maj_stat, min_stat;
gss_buffer_desc msg;
@@ -288,116 +288,116 @@ sasl_gss_seterror_(const sasl_utils_t *utils, OM_uint32 maj, OM_uint32 min,
size_t len;
unsigned int curlen = 0;
const char prefix[] = "GSSAPI Error: ";
-
+
if(!utils) return;
if (sasl_gss_lib_init(utils) != SASL_OK) return;
-
+
len = sizeof(prefix);
ret = _plug_buf_alloc(utils, &out, &curlen, 256);
if(ret != SASL_OK) return;
-
+
strcpy(out, prefix);
-
+
msg_ctx = 0;
while (1) {
- maj_stat = (*p_krb5_gss_display_status)(&min_stat, maj,
- GSS_C_GSS_CODE, GSS_C_NULL_OID,
- &msg_ctx, &msg);
- if(GSS_ERROR(maj_stat)) {
- if (logonly) {
- utils->log(utils->conn, SASL_LOG_FAIL,
- "GSSAPI Failure: (could not get major error message)");
- } else {
- utils->seterror(utils->conn, 0,
- "GSSAPI Failure "
- "(could not get major error message)");
- }
- utils->free(out);
- return;
- }
-
- len += len + msg.length;
- ret = _plug_buf_alloc(utils, &out, &curlen, len);
-
- if(ret != SASL_OK) {
- utils->free(out);
- return;
- }
-
- strcat(out, msg.value);
-
- (*p_krb5_gss_release_buffer)(&min_stat, &msg);
-
- if (!msg_ctx)
- break;
+ maj_stat = (*p_krb5_gss_display_status)(&min_stat, maj,
+ GSS_C_GSS_CODE, GSS_C_NULL_OID,
+ &msg_ctx, &msg);
+ if(GSS_ERROR(maj_stat)) {
+ if (logonly) {
+ utils->log(utils->conn, SASL_LOG_FAIL,
+ "GSSAPI Failure: (could not get major error message)");
+ } else {
+ utils->seterror(utils->conn, 0,
+ "GSSAPI Failure "
+ "(could not get major error message)");
+ }
+ utils->free(out);
+ return;
+ }
+
+ len += len + msg.length;
+ ret = _plug_buf_alloc(utils, &out, &curlen, len);
+
+ if(ret != SASL_OK) {
+ utils->free(out);
+ return;
+ }
+
+ strcat(out, msg.value);
+
+ (*p_krb5_gss_release_buffer)(&min_stat, &msg);
+
+ if (!msg_ctx)
+ break;
}
-
+
/* Now get the minor status */
-
+
len += 2;
ret = _plug_buf_alloc(utils, &out, &curlen, len);
if(ret != SASL_OK) {
- utils->free(out);
- return;
+ utils->free(out);
+ return;
}
-
+
strcat(out, " (");
-
+
msg_ctx = 0;
while (1) {
- maj_stat = (*p_krb5_gss_display_status)(&min_stat, min,
- GSS_C_MECH_CODE, GSS_C_NULL_OID,
- &msg_ctx, &msg);
- if(GSS_ERROR(maj_stat)) {
- if (logonly) {
- utils->log(utils->conn, SASL_LOG_FAIL,
- "GSSAPI Failure: (could not get minor error message)");
- } else {
- utils->seterror(utils->conn, 0,
- "GSSAPI Failure "
- "(could not get minor error message)");
- }
- utils->free(out);
- return;
- }
-
- len += len + msg.length;
- ret = _plug_buf_alloc(utils, &out, &curlen, len);
-
- if(ret != SASL_OK) {
- utils->free(out);
- return;
- }
-
- strcat(out, msg.value);
-
- (*p_krb5_gss_release_buffer)(&min_stat, &msg);
-
- if (!msg_ctx)
- break;
+ maj_stat = (*p_krb5_gss_display_status)(&min_stat, min,
+ GSS_C_MECH_CODE, GSS_C_NULL_OID,
+ &msg_ctx, &msg);
+ if(GSS_ERROR(maj_stat)) {
+ if (logonly) {
+ utils->log(utils->conn, SASL_LOG_FAIL,
+ "GSSAPI Failure: (could not get minor error message)");
+ } else {
+ utils->seterror(utils->conn, 0,
+ "GSSAPI Failure "
+ "(could not get minor error message)");
+ }
+ utils->free(out);
+ return;
+ }
+
+ len += len + msg.length;
+ ret = _plug_buf_alloc(utils, &out, &curlen, len);
+
+ if(ret != SASL_OK) {
+ utils->free(out);
+ return;
+ }
+
+ strcat(out, msg.value);
+
+ (*p_krb5_gss_release_buffer)(&min_stat, &msg);
+
+ if (!msg_ctx)
+ break;
}
-
+
len += 1;
ret = _plug_buf_alloc(utils, &out, &curlen, len);
if(ret != SASL_OK) {
- utils->free(out);
- return;
+ utils->free(out);
+ return;
}
-
+
strcat(out, ")");
-
+
if (logonly) {
- utils->log(utils->conn, SASL_LOG_FAIL, "%s", out);
+ utils->log(utils->conn, SASL_LOG_FAIL, "%s", out);
} else {
- utils->seterror(utils->conn, 0, "%s", out);
+ utils->seterror(utils->conn, 0, "%s", out);
}
utils->free(out);
}
-static int
+static int
sasl_gss_encode(void *context, const struct iovec *invec, unsigned numiov,
- const char **output, unsigned *outputlen, int privacy)
+ const char **output, unsigned *outputlen, int privacy)
{
context_t *text = (context_t *)context;
OM_uint32 maj_stat, min_stat;
@@ -405,244 +405,244 @@ sasl_gss_encode(void *context, const struct iovec *invec, unsigned numiov,
gss_buffer_desc real_input_token, real_output_token;
int ret;
struct buffer_info *inblob, bufinfo;
-
+
if(!output) return SASL_BADPARAM;
-
+
if (sasl_gss_lib_init(text->utils) != SASL_OK) return SASL_FAIL;
-
+
if(numiov > 1) {
- ret = _plug_iovec_to_buf(text->utils, invec, numiov, &text->enc_in_buf);
- if(ret != SASL_OK) return ret;
- inblob = text->enc_in_buf;
+ ret = _plug_iovec_to_buf(text->utils, invec, numiov, &text->enc_in_buf);
+ if(ret != SASL_OK) return ret;
+ inblob = text->enc_in_buf;
} else {
- bufinfo.data = invec[0].iov_base;
- bufinfo.curlen = invec[0].iov_len;
- inblob = &bufinfo;
+ bufinfo.data = invec[0].iov_base;
+ bufinfo.curlen = invec[0].iov_len;
+ inblob = &bufinfo;
}
-
+
if (text->state != SASL_GSSAPI_STATE_AUTHENTICATED) return SASL_NOTDONE;
-
+
input_token = &real_input_token;
-
+
real_input_token.value = inblob->data;
real_input_token.length = inblob->curlen;
-
+
output_token = &real_output_token;
output_token->value = NULL;
output_token->length = 0;
-
+
maj_stat = (*p_krb5_gss_wrap) (&min_stat,
- text->gss_ctx,
- privacy,
- GSS_C_QOP_DEFAULT,
- input_token,
- NULL,
- output_token);
-
+ text->gss_ctx,
+ privacy,
+ GSS_C_QOP_DEFAULT,
+ input_token,
+ NULL,
+ output_token);
+
if (GSS_ERROR(maj_stat))
- {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return SASL_FAIL;
- }
-
+ {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return SASL_FAIL;
+ }
+
if (output_token->value && output) {
- int len;
-
- ret = _plug_buf_alloc(text->utils, &(text->encode_buf),
- &(text->encode_buf_len), output_token->length + 4);
-
- if (ret != SASL_OK) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return ret;
- }
-
- len = htonl(output_token->length);
- memcpy(text->encode_buf, &len, 4);
- memcpy(text->encode_buf + 4, output_token->value, output_token->length);
+ int len;
+
+ ret = _plug_buf_alloc(text->utils, &(text->encode_buf),
+ &(text->encode_buf_len), output_token->length + 4);
+
+ if (ret != SASL_OK) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return ret;
+ }
+
+ len = htonl(output_token->length);
+ memcpy(text->encode_buf, &len, 4);
+ memcpy(text->encode_buf + 4, output_token->value, output_token->length);
}
-
+
if (outputlen) {
- *outputlen = output_token->length + 4;
+ *outputlen = output_token->length + 4;
}
-
+
*output = text->encode_buf;
-
+
if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
-
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+
return SASL_OK;
}
static int gssapi_privacy_encode(void *context, const struct iovec *invec,
- unsigned numiov, const char **output,
- unsigned *outputlen)
+ unsigned numiov, const char **output,
+ unsigned *outputlen)
{
return sasl_gss_encode(context,invec,numiov,output,outputlen,1);
}
static int gssapi_integrity_encode(void *context, const struct iovec *invec,
- unsigned numiov, const char **output,
- unsigned *outputlen)
+ unsigned numiov, const char **output,
+ unsigned *outputlen)
{
return sasl_gss_encode(context,invec,numiov,output,outputlen,0);
}
static int gssapi_decode_packet(void *context,
- const char *input, unsigned inputlen,
- char **output, unsigned *outputlen)
+ const char *input, unsigned inputlen,
+ char **output, unsigned *outputlen)
{
context_t *text = (context_t *) context;
OM_uint32 maj_stat, min_stat;
gss_buffer_t input_token, output_token;
gss_buffer_desc real_input_token, real_output_token;
int result;
-
+
if (sasl_gss_lib_init(text->utils) != SASL_OK) return SASL_FAIL;
-
+
if (text->state != SASL_GSSAPI_STATE_AUTHENTICATED) {
- SETERROR(text->utils, "GSSAPI Failure");
- return SASL_NOTDONE;
+ SETERROR(text->utils, "GSSAPI Failure");
+ return SASL_NOTDONE;
}
-
- input_token = &real_input_token;
+
+ input_token = &real_input_token;
real_input_token.value = (char *) input;
real_input_token.length = inputlen;
-
+
output_token = &real_output_token;
output_token->value = NULL;
output_token->length = 0;
-
+
maj_stat = (*p_krb5_gss_unwrap) (&min_stat,
- text->gss_ctx,
- input_token,
- output_token,
- NULL,
- NULL);
-
+ text->gss_ctx,
+ input_token,
+ output_token,
+ NULL,
+ NULL);
+
if (GSS_ERROR(maj_stat))
- {
- sasl_gss_seterror(text->utils,maj_stat,min_stat);
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return SASL_FAIL;
- }
-
+ {
+ sasl_gss_seterror(text->utils,maj_stat,min_stat);
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return SASL_FAIL;
+ }
+
if (outputlen)
- *outputlen = output_token->length;
-
+ *outputlen = output_token->length;
+
if (output_token->value) {
- if (output) {
- result = _plug_buf_alloc(text->utils, &text->decode_once_buf,
- &text->decode_once_buf_len,
- *outputlen);
- if(result != SASL_OK) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return result;
- }
- *output = text->decode_once_buf;
- memcpy(*output, output_token->value, *outputlen);
- }
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ if (output) {
+ result = _plug_buf_alloc(text->utils, &text->decode_once_buf,
+ &text->decode_once_buf_len,
+ *outputlen);
+ if(result != SASL_OK) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return result;
+ }
+ *output = text->decode_once_buf;
+ memcpy(*output, output_token->value, *outputlen);
+ }
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
}
-
+
return SASL_OK;
}
static int gssapi_decode(void *context,
- const char *input, unsigned inputlen,
- const char **output, unsigned *outputlen)
+ const char *input, unsigned inputlen,
+ const char **output, unsigned *outputlen)
{
context_t *text = (context_t *) context;
int ret;
-
+
ret = _plug_decode(&text->decode_context, input, inputlen,
- &text->decode_buf, &text->decode_buf_len, outputlen,
- gssapi_decode_packet, text);
-
+ &text->decode_buf, &text->decode_buf_len, outputlen,
+ gssapi_decode_packet, text);
+
*output = text->decode_buf;
-
+
return ret;
}
static context_t *gss_new_context(const sasl_utils_t *utils)
{
context_t *ret;
-
+
ret = utils->malloc(sizeof(context_t));
if(!ret) return NULL;
-
+
memset(ret,0,sizeof(context_t));
ret->utils = utils;
-
+
return ret;
}
static void sasl_gss_free_context_contents(context_t *text)
{
- OM_uint32 maj_stat, min_stat;
-
+ OM_uint32 min_stat;
+
if (!text) return;
-
+
if (sasl_gss_lib_init(text->utils) != SASL_OK) return;
-
+
if (text->gss_ctx != GSS_C_NO_CONTEXT) {
- maj_stat = (*p_krb5_gss_delete_sec_context)(&min_stat,&text->gss_ctx,GSS_C_NO_BUFFER);
- text->gss_ctx = GSS_C_NO_CONTEXT;
+ (*p_krb5_gss_delete_sec_context)(&min_stat,&text->gss_ctx,GSS_C_NO_BUFFER);
+ text->gss_ctx = GSS_C_NO_CONTEXT;
}
-
+
if (text->client_name != GSS_C_NO_NAME) {
- maj_stat = (*p_krb5_gss_release_name)(&min_stat,&text->client_name);
- text->client_name = GSS_C_NO_NAME;
+ (*p_krb5_gss_release_name)(&min_stat,&text->client_name);
+ text->client_name = GSS_C_NO_NAME;
}
-
+
if (text->server_name != GSS_C_NO_NAME) {
- maj_stat = (*p_krb5_gss_release_name)(&min_stat,&text->server_name);
- text->server_name = GSS_C_NO_NAME;
+ (*p_krb5_gss_release_name)(&min_stat,&text->server_name);
+ text->server_name = GSS_C_NO_NAME;
}
-
+
if ( text->server_creds != GSS_C_NO_CREDENTIAL) {
- maj_stat = (*p_krb5_gss_release_cred)(&min_stat, &text->server_creds);
- text->server_creds = GSS_C_NO_CREDENTIAL;
+ (*p_krb5_gss_release_cred)(&min_stat, &text->server_creds);
+ text->server_creds = GSS_C_NO_CREDENTIAL;
}
if (text->out_buf) {
- text->utils->free(text->out_buf);
- text->out_buf = NULL;
+ text->utils->free(text->out_buf);
+ text->out_buf = NULL;
}
-
+
if (text->encode_buf) {
- text->utils->free(text->encode_buf);
- text->encode_buf = NULL;
+ text->utils->free(text->encode_buf);
+ text->encode_buf = NULL;
}
-
+
if (text->decode_buf) {
- text->utils->free(text->decode_buf);
- text->decode_buf = NULL;
+ text->utils->free(text->decode_buf);
+ text->decode_buf = NULL;
}
-
+
if (text->decode_once_buf) {
- text->utils->free(text->decode_once_buf);
- text->decode_once_buf = NULL;
+ text->utils->free(text->decode_once_buf);
+ text->decode_once_buf = NULL;
}
-
+
if (text->enc_in_buf) {
- if(text->enc_in_buf->data) text->utils->free(text->enc_in_buf->data);
- text->utils->free(text->enc_in_buf);
- text->enc_in_buf = NULL;
+ if(text->enc_in_buf->data) text->utils->free(text->enc_in_buf->data);
+ text->utils->free(text->enc_in_buf);
+ text->enc_in_buf = NULL;
}
_plug_decode_free(&text->decode_context);
-
+
if (text->authid) { /* works for both client and server */
- text->utils->free(text->authid);
- text->authid = NULL;
+ text->utils->free(text->authid);
+ text->authid = NULL;
}
}
static void gssapi_common_mech_dispose(void *conn_context,
- const sasl_utils_t *utils)
+ const sasl_utils_t *utils)
{
sasl_gss_free_context_contents((context_t *)(conn_context));
utils->free(conn_context);
@@ -650,40 +650,40 @@ static void gssapi_common_mech_dispose(void *conn_context,
/***************************** Server Section *****************************/
-static int
-gssapi_server_mech_new(void *glob_context __attribute__((unused)),
- sasl_server_params_t *params,
- const char *challenge __attribute__((unused)),
- unsigned challen __attribute__((unused)),
- void **conn_context)
+static int
+gssapi_server_mech_new(void *glob_context __attribute__((unused)),
+ sasl_server_params_t *params,
+ const char *challenge __attribute__((unused)),
+ unsigned challen __attribute__((unused)),
+ void **conn_context)
{
context_t *text;
-
+
text = gss_new_context(params->utils);
if (text == NULL) {
- MEMERROR(params->utils);
- return SASL_NOMEM;
+ MEMERROR(params->utils);
+ return SASL_NOMEM;
}
-
+
text->gss_ctx = GSS_C_NO_CONTEXT;
text->client_name = GSS_C_NO_NAME;
text->server_name = GSS_C_NO_NAME;
text->server_creds = GSS_C_NO_CREDENTIAL;
text->state = SASL_GSSAPI_STATE_AUTHNEG;
-
+
*conn_context = text;
-
+
return SASL_OK;
}
-static int
+static int
gssapi_server_mech_step(void *conn_context,
- sasl_server_params_t *params,
- const char *clientin,
- unsigned clientinlen,
- const char **serverout,
- unsigned *serveroutlen,
- sasl_out_params_t *oparams)
+ sasl_server_params_t *params,
+ const char *clientin,
+ unsigned clientinlen,
+ const char **serverout,
+ unsigned *serveroutlen,
+ sasl_out_params_t *oparams)
{
context_t *text = (context_t *)conn_context;
gss_buffer_t input_token, output_token;
@@ -692,257 +692,257 @@ gssapi_server_mech_step(void *conn_context,
OM_uint32 max_input;
gss_buffer_desc name_token;
int ret;
-
+
input_token = &real_input_token;
output_token = &real_output_token;
output_token->value = NULL; output_token->length = 0;
input_token->value = NULL; input_token->length = 0;
-
+
if(!serverout) {
- PARAMERROR(text->utils);
- return SASL_BADPARAM;
+ PARAMERROR(text->utils);
+ return SASL_BADPARAM;
}
-
+
*serverout = NULL;
- *serveroutlen = 0;
-
+ *serveroutlen = 0;
+
if (sasl_gss_lib_init(text->utils) != SASL_OK) return SASL_FAIL;
-
+
switch (text->state) {
case SASL_GSSAPI_STATE_AUTHNEG:
- if (text->server_name == GSS_C_NO_NAME) { /* only once */
- name_token.length = strlen(params->service) + 1 + strlen(params->serverFQDN);
- name_token.value = (char *)params->utils->malloc((name_token.length + 1) * sizeof(char));
- if (name_token.value == NULL) {
- MEMERROR(text->utils);
- sasl_gss_free_context_contents(text);
- return SASL_NOMEM;
- }
- sprintf(name_token.value,"%s@%s", params->service, params->serverFQDN);
-
- maj_stat = (*p_krb5_gss_import_name) (&min_stat,
- &name_token,
- GSS_C_NT_HOSTBASED_SERVICE,
- &text->server_name);
-
- params->utils->free(name_token.value);
- name_token.value = NULL;
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- if ( text->server_creds != GSS_C_NO_CREDENTIAL) {
- maj_stat = (*p_krb5_gss_release_cred)(&min_stat, &text->server_creds);
- text->server_creds = GSS_C_NO_CREDENTIAL;
- }
-
- maj_stat = (*p_krb5_gss_acquire_cred)(&min_stat,
- text->server_name,
- GSS_C_INDEFINITE,
- GSS_C_NO_OID_SET,
- GSS_C_ACCEPT,
- &text->server_creds,
- NULL,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
- }
-
- if (clientinlen) {
- real_input_token.value = (void *)clientin;
- real_input_token.length = clientinlen;
- }
-
-
- maj_stat =
- (*p_krb5_gss_accept_sec_context)(&min_stat,
- &(text->gss_ctx),
- text->server_creds,
- input_token,
- GSS_C_NO_CHANNEL_BINDINGS,
- &text->client_name,
- NULL,
- output_token,
- NULL,
- NULL,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_log(text->utils, maj_stat, min_stat);
- text->utils->seterror(text->utils->conn, SASL_NOLOG, "GSSAPI Failure: gss_accept_sec_context");
- if (output_token->value) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- }
- sasl_gss_free_context_contents(text);
- return SASL_BADAUTH;
- }
-
-
- if (serveroutlen)
- *serveroutlen = output_token->length;
- if (output_token->value) {
- if (serverout) {
- ret = _plug_buf_alloc(text->utils, &(text->out_buf),
- &(text->out_buf_len), *serveroutlen);
- if(ret != SASL_OK) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return ret;
- }
- memcpy(text->out_buf, output_token->value, *serveroutlen);
- *serverout = text->out_buf;
- }
-
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- } else {
- /* No output token, send an empty string */
- *serverout = GSSAPI_BLANK_STRING;
- serveroutlen = 0;
- }
-
- if (maj_stat == GSS_S_COMPLETE) {
- /* Switch to ssf negotiation */
- text->state = SASL_GSSAPI_STATE_SSFCAP;
- }
-
- return SASL_CONTINUE;
+ if (text->server_name == GSS_C_NO_NAME) { /* only once */
+ name_token.length = strlen(params->service) + 1 + strlen(params->serverFQDN);
+ name_token.value = (char *)params->utils->malloc((name_token.length + 1) * sizeof(char));
+ if (name_token.value == NULL) {
+ MEMERROR(text->utils);
+ sasl_gss_free_context_contents(text);
+ return SASL_NOMEM;
+ }
+ sprintf(name_token.value,"%s@%s", params->service, params->serverFQDN);
+
+ maj_stat = (*p_krb5_gss_import_name) (&min_stat,
+ &name_token,
+ GSS_C_NT_HOSTBASED_SERVICE,
+ &text->server_name);
+
+ params->utils->free(name_token.value);
+ name_token.value = NULL;
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ if ( text->server_creds != GSS_C_NO_CREDENTIAL) {
+ maj_stat = (*p_krb5_gss_release_cred)(&min_stat, &text->server_creds);
+ text->server_creds = GSS_C_NO_CREDENTIAL;
+ }
+
+ maj_stat = (*p_krb5_gss_acquire_cred)(&min_stat,
+ text->server_name,
+ GSS_C_INDEFINITE,
+ GSS_C_NO_OID_SET,
+ GSS_C_ACCEPT,
+ &text->server_creds,
+ NULL,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+ }
+
+ if (clientinlen) {
+ real_input_token.value = (void *)clientin;
+ real_input_token.length = clientinlen;
+ }
+
+
+ maj_stat =
+ (*p_krb5_gss_accept_sec_context)(&min_stat,
+ &(text->gss_ctx),
+ text->server_creds,
+ input_token,
+ GSS_C_NO_CHANNEL_BINDINGS,
+ &text->client_name,
+ NULL,
+ output_token,
+ NULL,
+ NULL,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_log(text->utils, maj_stat, min_stat);
+ text->utils->seterror(text->utils->conn, SASL_NOLOG, "GSSAPI Failure: gss_accept_sec_context");
+ if (output_token->value) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ }
+ sasl_gss_free_context_contents(text);
+ return SASL_BADAUTH;
+ }
+
+
+ if (serveroutlen)
+ *serveroutlen = output_token->length;
+ if (output_token->value) {
+ if (serverout) {
+ ret = _plug_buf_alloc(text->utils, &(text->out_buf),
+ &(text->out_buf_len), *serveroutlen);
+ if(ret != SASL_OK) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return ret;
+ }
+ memcpy(text->out_buf, output_token->value, *serveroutlen);
+ *serverout = text->out_buf;
+ }
+
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ } else {
+ /* No output token, send an empty string */
+ *serverout = GSSAPI_BLANK_STRING;
+ serveroutlen = 0;
+ }
+
+ if (maj_stat == GSS_S_COMPLETE) {
+ /* Switch to ssf negotiation */
+ text->state = SASL_GSSAPI_STATE_SSFCAP;
+ }
+
+ return SASL_CONTINUE;
case SASL_GSSAPI_STATE_SSFCAP: {
- unsigned char sasldata[4];
- gss_buffer_desc name_token;
- gss_buffer_desc name_without_realm;
- gss_name_t without = NULL;
- int equal;
-
- name_token.value = NULL;
- name_without_realm.value = NULL;
-
- /* We ignore whatever the client sent us at this stage */
-
- maj_stat = (*p_krb5_gss_display_name) (&min_stat,
- text->client_name,
- &name_token,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- if (name_without_realm.value)
- params->utils->free(name_without_realm.value);
-
- if (name_token.value)
- (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
- if (without)
- (*p_krb5_gss_release_name)(&min_stat, &without);
- SETERROR(text->utils, "GSSAPI Failure");
- sasl_gss_free_context_contents(text);
- return SASL_BADAUTH;
- }
-
- /* If the id contains a realm get the identifier for the user
- without the realm and see if it's the same id (i.e.
- tmartin == tmartin@ANDREW.CMU.EDU. If this is the case we just want
- to return the id (i.e. just "tmartin" */
- if (strchr((char *) name_token.value, (int) '@') != NULL) {
- /* NOTE: libc malloc, as it is freed below by a gssapi internal
- * function! */
- name_without_realm.value = malloc(strlen(name_token.value)+1);
- if (name_without_realm.value == NULL) {
- MEMERROR(text->utils);
- return SASL_NOMEM;
- }
-
- strcpy(name_without_realm.value, name_token.value);
-
- /* cut off string at '@' */
- (strchr(name_without_realm.value,'@'))[0] = '\0';
-
- name_without_realm.length = strlen( (char *) name_without_realm.value );
-
- maj_stat = (*p_krb5_gss_import_name) (&min_stat,
- &name_without_realm,
- /* Solaris 8/9 gss_import_name doesn't accept GSS_C_NULL_OID here,
- so use GSS_C_NT_USER_NAME instead if available. */
+ unsigned char sasldata[4];
+ gss_buffer_desc name_token;
+ gss_buffer_desc name_without_realm;
+ gss_name_t without = NULL;
+ int equal;
+
+ name_token.value = NULL;
+ name_without_realm.value = NULL;
+
+ /* We ignore whatever the client sent us at this stage */
+
+ maj_stat = (*p_krb5_gss_display_name) (&min_stat,
+ text->client_name,
+ &name_token,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ if (name_without_realm.value)
+ params->utils->free(name_without_realm.value);
+
+ if (name_token.value)
+ (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
+ if (without)
+ (*p_krb5_gss_release_name)(&min_stat, &without);
+ SETERROR(text->utils, "GSSAPI Failure");
+ sasl_gss_free_context_contents(text);
+ return SASL_BADAUTH;
+ }
+
+ /* If the id contains a realm get the identifier for the user
+ without the realm and see if it's the same id (i.e.
+ tmartin == tmartin@ANDREW.CMU.EDU. If this is the case we just want
+ to return the id (i.e. just "tmartin" */
+ if (strchr((char *) name_token.value, (int) '@') != NULL) {
+ /* NOTE: libc malloc, as it is freed below by a gssapi internal
+ * function! */
+ name_without_realm.value = malloc(strlen(name_token.value)+1);
+ if (name_without_realm.value == NULL) {
+ MEMERROR(text->utils);
+ return SASL_NOMEM;
+ }
+
+ strcpy(name_without_realm.value, name_token.value);
+
+ /* cut off string at '@' */
+ (strchr(name_without_realm.value,'@'))[0] = '\0';
+
+ name_without_realm.length = strlen( (char *) name_without_realm.value );
+
+ maj_stat = (*p_krb5_gss_import_name) (&min_stat,
+ &name_without_realm,
+ /* Solaris 8/9 gss_import_name doesn't accept GSS_C_NULL_OID here,
+ so use GSS_C_NT_USER_NAME instead if available. */
#ifdef HAVE_GSS_C_NT_USER_NAME
- GSS_C_NT_USER_NAME,
+ GSS_C_NT_USER_NAME,
#else
- GSS_C_NULL_OID,
+ GSS_C_NULL_OID,
#endif
- &without);
-
- if (GSS_ERROR(maj_stat)) {
- params->utils->free(name_without_realm.value);
- if (name_token.value)
- (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
- if (without)
- (*p_krb5_gss_release_name)(&min_stat, &without);
- SETERROR(text->utils, "GSSAPI Failure");
- sasl_gss_free_context_contents(text);
- return SASL_BADAUTH;
- }
-
- maj_stat = (*p_krb5_gss_compare_name)(&min_stat,
- text->client_name,
- without,
- &equal);
-
- if (GSS_ERROR(maj_stat)) {
- params->utils->free(name_without_realm.value);
- if (name_token.value)
- (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
- if (without)
- (*p_krb5_gss_release_name)(&min_stat, &without);
- SETERROR(text->utils, "GSSAPI Failure");
- sasl_gss_free_context_contents(text);
- return SASL_BADAUTH;
- }
-
- (*p_krb5_gss_release_name)(&min_stat,&without);
- } else {
- equal = 0;
- }
-
- if (equal) {
- text->authid = strdup(name_without_realm.value);
-
- if (text->authid == NULL) {
- MEMERROR(params->utils);
- return SASL_NOMEM;
- }
- } else {
- text->authid = strdup(name_token.value);
-
- if (text->authid == NULL) {
- MEMERROR(params->utils);
- return SASL_NOMEM;
- }
- }
-
- if (name_token.value)
- (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
- if (name_without_realm.value)
- params->utils->free(name_without_realm.value);
-
-
- /* we have to decide what sort of encryption/integrity/etc.,
- we support */
- if (params->props.max_ssf < params->external_ssf) {
- text->limitssf = 0;
- } else {
- text->limitssf = params->props.max_ssf - params->external_ssf;
- }
- if (params->props.min_ssf < params->external_ssf) {
- text->requiressf = 0;
- } else {
- text->requiressf = params->props.min_ssf - params->external_ssf;
- }
-
- /* build up our security properties token */
+ &without);
+
+ if (GSS_ERROR(maj_stat)) {
+ params->utils->free(name_without_realm.value);
+ if (name_token.value)
+ (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
+ if (without)
+ (*p_krb5_gss_release_name)(&min_stat, &without);
+ SETERROR(text->utils, "GSSAPI Failure");
+ sasl_gss_free_context_contents(text);
+ return SASL_BADAUTH;
+ }
+
+ maj_stat = (*p_krb5_gss_compare_name)(&min_stat,
+ text->client_name,
+ without,
+ &equal);
+
+ if (GSS_ERROR(maj_stat)) {
+ params->utils->free(name_without_realm.value);
+ if (name_token.value)
+ (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
+ if (without)
+ (*p_krb5_gss_release_name)(&min_stat, &without);
+ SETERROR(text->utils, "GSSAPI Failure");
+ sasl_gss_free_context_contents(text);
+ return SASL_BADAUTH;
+ }
+
+ (*p_krb5_gss_release_name)(&min_stat,&without);
+ } else {
+ equal = 0;
+ }
+
+ if (equal) {
+ text->authid = strdup(name_without_realm.value);
+
+ if (text->authid == NULL) {
+ MEMERROR(params->utils);
+ return SASL_NOMEM;
+ }
+ } else {
+ text->authid = strdup(name_token.value);
+
+ if (text->authid == NULL) {
+ MEMERROR(params->utils);
+ return SASL_NOMEM;
+ }
+ }
+
+ if (name_token.value)
+ (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
+ if (name_without_realm.value)
+ params->utils->free(name_without_realm.value);
+
+
+ /* we have to decide what sort of encryption/integrity/etc.,
+ we support */
+ if (params->props.max_ssf < params->external_ssf) {
+ text->limitssf = 0;
+ } else {
+ text->limitssf = params->props.max_ssf - params->external_ssf;
+ }
+ if (params->props.min_ssf < params->external_ssf) {
+ text->requiressf = 0;
+ } else {
+ text->requiressf = params->props.min_ssf - params->external_ssf;
+ }
+
+ /* build up our security properties token */
if (params->props.maxbufsize > 0xFFFFFF) {
/* make sure maxbufsize isn't too large */
/* maxbufsize = 0xFFFFFF */
@@ -952,226 +952,226 @@ gssapi_server_mech_step(void *conn_context,
sasldata[2] = (params->props.maxbufsize >> 8) & 0xFF;
sasldata[3] = (params->props.maxbufsize >> 0) & 0xFF;
}
- sasldata[0] = 0;
- if(text->requiressf != 0 && !params->props.maxbufsize) {
- params->utils->seterror(params->utils->conn, 0,
- "GSSAPI needs a security layer but one is forbidden");
- return SASL_TOOWEAK;
- }
-
- if (text->requiressf == 0) {
- sasldata[0] |= 1; /* authentication */
- }
- if (text->requiressf <= 1 && text->limitssf >= 1
- && params->props.maxbufsize) {
- sasldata[0] |= 2;
- }
- if (text->requiressf <= K5_MAX_SSF && text->limitssf >= K5_MAX_SSF
- && params->props.maxbufsize) {
- sasldata[0] |= 4;
- }
-
- real_input_token.value = (void *)sasldata;
- real_input_token.length = 4;
-
- maj_stat = (*p_krb5_gss_wrap)(&min_stat,
- text->gss_ctx,
- 0, /* Just integrity checking here */
- GSS_C_QOP_DEFAULT,
- input_token,
- NULL,
- output_token);
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
-
- if (serveroutlen)
- *serveroutlen = output_token->length;
- if (output_token->value) {
- if (serverout) {
- ret = _plug_buf_alloc(text->utils, &(text->out_buf),
- &(text->out_buf_len), *serveroutlen);
- if(ret != SASL_OK) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return ret;
- }
- memcpy(text->out_buf, output_token->value, *serveroutlen);
- *serverout = text->out_buf;
- }
-
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- }
-
- /* Wait for ssf request and authid */
- text->state = SASL_GSSAPI_STATE_SSFREQ;
-
- return SASL_CONTINUE;
+ sasldata[0] = 0;
+ if(text->requiressf != 0 && !params->props.maxbufsize) {
+ params->utils->seterror(params->utils->conn, 0,
+ "GSSAPI needs a security layer but one is forbidden");
+ return SASL_TOOWEAK;
+ }
+
+ if (text->requiressf == 0) {
+ sasldata[0] |= 1; /* authentication */
+ }
+ if (text->requiressf <= 1 && text->limitssf >= 1
+ && params->props.maxbufsize) {
+ sasldata[0] |= 2;
+ }
+ if (text->requiressf <= K5_MAX_SSF && text->limitssf >= K5_MAX_SSF
+ && params->props.maxbufsize) {
+ sasldata[0] |= 4;
+ }
+
+ real_input_token.value = (void *)sasldata;
+ real_input_token.length = 4;
+
+ maj_stat = (*p_krb5_gss_wrap)(&min_stat,
+ text->gss_ctx,
+ 0, /* Just integrity checking here */
+ GSS_C_QOP_DEFAULT,
+ input_token,
+ NULL,
+ output_token);
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+
+ if (serveroutlen)
+ *serveroutlen = output_token->length;
+ if (output_token->value) {
+ if (serverout) {
+ ret = _plug_buf_alloc(text->utils, &(text->out_buf),
+ &(text->out_buf_len), *serveroutlen);
+ if(ret != SASL_OK) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return ret;
+ }
+ memcpy(text->out_buf, output_token->value, *serveroutlen);
+ *serverout = text->out_buf;
+ }
+
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ }
+
+ /* Wait for ssf request and authid */
+ text->state = SASL_GSSAPI_STATE_SSFREQ;
+
+ return SASL_CONTINUE;
}
case SASL_GSSAPI_STATE_SSFREQ: {
- int layerchoice;
-
- real_input_token.value = (void *)clientin;
- real_input_token.length = clientinlen;
-
- maj_stat = (*p_krb5_gss_unwrap)(&min_stat,
- text->gss_ctx,
- input_token,
- output_token,
- NULL,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- layerchoice = (int)(((char *)(output_token->value))[0]);
- if (layerchoice == 1 && text->requiressf == 0) { /* no encryption */
- oparams->encode = NULL;
- oparams->decode = NULL;
- oparams->mech_ssf = 0;
- } else if (layerchoice == 2 && text->requiressf <= 1 &&
- text->limitssf >= 1) { /* integrity */
- oparams->encode=&gssapi_integrity_encode;
- oparams->decode=&gssapi_decode;
- oparams->mech_ssf=1;
- } else if (layerchoice == 4 && text->requiressf <= K5_MAX_SSF &&
- text->limitssf >= K5_MAX_SSF) { /* privacy */
- oparams->encode = &gssapi_privacy_encode;
- oparams->decode = &gssapi_decode;
- /* FIX ME: Need to extract the proper value here */
- oparams->mech_ssf = K5_MAX_SSF;
- } else {
- /* not a supported encryption layer */
- SETERROR(text->utils,
- "protocol violation: client requested invalid layer");
- /* Mark that we attempted negotiation */
- oparams->mech_ssf = 2;
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- if (output_token->length > 4) {
- int ret;
-
- ret = params->canon_user(params->utils->conn,
- ((char *) output_token->value) + 4,
- (output_token->length - 4) * sizeof(char),
- SASL_CU_AUTHZID, oparams);
-
- if (ret != SASL_OK) {
- sasl_gss_free_context_contents(text);
- return ret;
- }
-
- ret = params->canon_user(params->utils->conn,
- text->authid,
- 0, /* strlen(text->authid) */
- SASL_CU_AUTHID, oparams);
- if (ret != SASL_OK) {
- sasl_gss_free_context_contents(text);
- return ret;
- }
- } else if(output_token->length == 4) {
- /* null authzid */
- int ret;
-
- ret = params->canon_user(params->utils->conn,
- text->authid,
- 0, /* strlen(text->authid) */
- SASL_CU_AUTHZID | SASL_CU_AUTHID,
- oparams);
-
- if (ret != SASL_OK) {
- sasl_gss_free_context_contents(text);
- return ret;
- }
- } else {
- SETERROR(text->utils,
- "token too short");
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- /* No matter what, set the rest of the oparams */
-
+ int layerchoice;
+
+ real_input_token.value = (void *)clientin;
+ real_input_token.length = clientinlen;
+
+ maj_stat = (*p_krb5_gss_unwrap)(&min_stat,
+ text->gss_ctx,
+ input_token,
+ output_token,
+ NULL,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ layerchoice = (int)(((char *)(output_token->value))[0]);
+ if (layerchoice == 1 && text->requiressf == 0) { /* no encryption */
+ oparams->encode = NULL;
+ oparams->decode = NULL;
+ oparams->mech_ssf = 0;
+ } else if (layerchoice == 2 && text->requiressf <= 1 &&
+ text->limitssf >= 1) { /* integrity */
+ oparams->encode=&gssapi_integrity_encode;
+ oparams->decode=&gssapi_decode;
+ oparams->mech_ssf=1;
+ } else if (layerchoice == 4 && text->requiressf <= K5_MAX_SSF &&
+ text->limitssf >= K5_MAX_SSF) { /* privacy */
+ oparams->encode = &gssapi_privacy_encode;
+ oparams->decode = &gssapi_decode;
+ /* FIX ME: Need to extract the proper value here */
+ oparams->mech_ssf = K5_MAX_SSF;
+ } else {
+ /* not a supported encryption layer */
+ SETERROR(text->utils,
+ "protocol violation: client requested invalid layer");
+ /* Mark that we attempted negotiation */
+ oparams->mech_ssf = 2;
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ if (output_token->length > 4) {
+ int ret;
+
+ ret = params->canon_user(params->utils->conn,
+ ((char *) output_token->value) + 4,
+ (output_token->length - 4) * sizeof(char),
+ SASL_CU_AUTHZID, oparams);
+
+ if (ret != SASL_OK) {
+ sasl_gss_free_context_contents(text);
+ return ret;
+ }
+
+ ret = params->canon_user(params->utils->conn,
+ text->authid,
+ 0, /* strlen(text->authid) */
+ SASL_CU_AUTHID, oparams);
+ if (ret != SASL_OK) {
+ sasl_gss_free_context_contents(text);
+ return ret;
+ }
+ } else if(output_token->length == 4) {
+ /* null authzid */
+ int ret;
+
+ ret = params->canon_user(params->utils->conn,
+ text->authid,
+ 0, /* strlen(text->authid) */
+ SASL_CU_AUTHZID | SASL_CU_AUTHID,
+ oparams);
+
+ if (ret != SASL_OK) {
+ sasl_gss_free_context_contents(text);
+ return ret;
+ }
+ } else {
+ SETERROR(text->utils,
+ "token too short");
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ /* No matter what, set the rest of the oparams */
+
oparams->maxoutbuf =
- (((unsigned char *) output_token->value)[1] << 16) |
+ (((unsigned char *) output_token->value)[1] << 16) |
(((unsigned char *) output_token->value)[2] << 8) |
(((unsigned char *) output_token->value)[3] << 0);
- if (oparams->mech_ssf) {
- maj_stat = (*p_krb5_gss_wrap_size_limit)(&min_stat,
- text->gss_ctx,
- 1,
- GSS_C_QOP_DEFAULT,
- (OM_uint32) oparams->maxoutbuf,
- &max_input);
-
- if(max_input > oparams->maxoutbuf) {
- /* Heimdal appears to get this wrong */
- oparams->maxoutbuf -= (max_input - oparams->maxoutbuf);
- } else {
- /* This code is actually correct */
- oparams->maxoutbuf = max_input;
- }
- }
-
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
-
- text->state = SASL_GSSAPI_STATE_AUTHENTICATED;
-
- /* used by layers */
- _plug_decode_init(&text->decode_context, text->utils,
- (params->props.maxbufsize > 0xFFFFFF) ? 0xFFFFFF :
- params->props.maxbufsize);
-
- oparams->doneflag = 1;
-
- return SASL_OK;
+ if (oparams->mech_ssf) {
+ maj_stat = (*p_krb5_gss_wrap_size_limit)(&min_stat,
+ text->gss_ctx,
+ 1,
+ GSS_C_QOP_DEFAULT,
+ (OM_uint32) oparams->maxoutbuf,
+ &max_input);
+
+ if(max_input > oparams->maxoutbuf) {
+ /* Heimdal appears to get this wrong */
+ oparams->maxoutbuf -= (max_input - oparams->maxoutbuf);
+ } else {
+ /* This code is actually correct */
+ oparams->maxoutbuf = max_input;
+ }
+ }
+
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+
+ text->state = SASL_GSSAPI_STATE_AUTHENTICATED;
+
+ /* used by layers */
+ _plug_decode_init(&text->decode_context, text->utils,
+ (params->props.maxbufsize > 0xFFFFFF) ? 0xFFFFFF :
+ params->props.maxbufsize);
+
+ oparams->doneflag = 1;
+
+ return SASL_OK;
}
-
+
default:
- params->utils->log(NULL, SASL_LOG_ERR,
- "Invalid GSSAPI server step %d\n", text->state);
- return SASL_FAIL;
+ params->utils->log(NULL, SASL_LOG_ERR,
+ "Invalid GSSAPI server step %d\n", text->state);
+ return SASL_FAIL;
}
-
+
return SASL_FAIL; /* should never get here */
}
-static sasl_server_plug_t gssapi_server_plugins[] =
+static sasl_server_plug_t gssapi_server_plugins[] =
{
{
- "GSSAPI", /* mech_name */
- K5_MAX_SSF, /* max_ssf */
- SASL_SEC_NOPLAINTEXT
- | SASL_SEC_NOACTIVE
- | SASL_SEC_NOANONYMOUS
- | SASL_SEC_MUTUAL_AUTH, /* security_flags */
- SASL_FEAT_WANT_CLIENT_FIRST
- | SASL_FEAT_ALLOWS_PROXY, /* features */
- NULL, /* glob_context */
- &gssapi_server_mech_new, /* mech_new */
- &gssapi_server_mech_step, /* mech_step */
- &gssapi_common_mech_dispose, /* mech_dispose */
- NULL, /* mech_free */
- NULL, /* setpass */
- NULL, /* user_query */
- NULL, /* idle */
- NULL, /* mech_avail */
- NULL /* spare */
+ "GSSAPI", /* mech_name */
+ K5_MAX_SSF, /* max_ssf */
+ SASL_SEC_NOPLAINTEXT
+ | SASL_SEC_NOACTIVE
+ | SASL_SEC_NOANONYMOUS
+ | SASL_SEC_MUTUAL_AUTH, /* security_flags */
+ SASL_FEAT_WANT_CLIENT_FIRST
+ | SASL_FEAT_ALLOWS_PROXY, /* features */
+ NULL, /* glob_context */
+ &gssapi_server_mech_new, /* mech_new */
+ &gssapi_server_mech_step, /* mech_step */
+ &gssapi_common_mech_dispose, /* mech_dispose */
+ NULL, /* mech_free */
+ NULL, /* setpass */
+ NULL, /* user_query */
+ NULL, /* idle */
+ NULL, /* mech_avail */
+ NULL /* spare */
}
};
@@ -1180,7 +1180,7 @@ int gssapiv2_server_plug_init(
const sasl_utils_t *utils __attribute__((unused)),
#else
const sasl_utils_t *utils,
-#endif
+#endif
int maxversion,
int *out_version,
sasl_server_plug_t **pluglist,
@@ -1191,78 +1191,78 @@ int gssapiv2_server_plug_init(
char keytab_path[1024];
unsigned int rl;
#endif
-
+
if (maxversion < SASL_SERVER_PLUG_VERSION) {
- return SASL_BADVERS;
+ return SASL_BADVERS;
}
-
+
#ifdef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
/* unfortunately, we don't check for readability of keytab if it's
the standard one, since we don't know where it is */
-
+
/* FIXME: This code is broken */
-
+
utils->getopt(utils->getopt_context, "GSSAPI", "keytab", &keytab, &rl);
if (keytab != NULL) {
- if (access(keytab, R_OK) != 0) {
- utils->log(NULL, SASL_LOG_ERR,
- "Could not find keytab file: %s: %m",
- keytab, errno);
- return SASL_FAIL;
- }
-
- if(strlen(keytab) > 1024) {
- utils->log(NULL, SASL_LOG_ERR,
- "path to keytab is > 1024 characters");
- return SASL_BUFOVER;
- }
-
- strncpy(keytab_path, keytab, 1024);
-
- gsskrb5_register_acceptor_identity(keytab_path);
+ if (access(keytab, R_OK) != 0) {
+ utils->log(NULL, SASL_LOG_ERR,
+ "Could not find keytab file: %s: %m",
+ keytab, errno);
+ return SASL_FAIL;
+ }
+
+ if(strlen(keytab) > 1024) {
+ utils->log(NULL, SASL_LOG_ERR,
+ "path to keytab is > 1024 characters");
+ return SASL_BUFOVER;
+ }
+
+ strncpy(keytab_path, keytab, 1024);
+
+ gsskrb5_register_acceptor_identity(keytab_path);
}
#endif
-
+
*out_version = SASL_SERVER_PLUG_VERSION;
*pluglist = gssapi_server_plugins;
- *plugcount = 1;
-
+ *plugcount = 1;
+
return SASL_OK;
}
/***************************** Client Section *****************************/
-static int gssapi_client_mech_new(void *glob_context __attribute__((unused)),
- sasl_client_params_t *params,
- void **conn_context)
+static int gssapi_client_mech_new(void *glob_context __attribute__((unused)),
+ sasl_client_params_t *params,
+ void **conn_context)
{
context_t *text;
-
+
/* holds state are in */
text = gss_new_context(params->utils);
if (text == NULL) {
- MEMERROR(params->utils);
- return SASL_NOMEM;
+ MEMERROR(params->utils);
+ return SASL_NOMEM;
}
-
+
text->state = SASL_GSSAPI_STATE_AUTHNEG;
text->gss_ctx = GSS_C_NO_CONTEXT;
text->client_name = GSS_C_NO_NAME;
text->server_creds = GSS_C_NO_CREDENTIAL;
*conn_context = text;
-
+
return SASL_OK;
}
static int gssapi_client_mech_step(void *conn_context,
- sasl_client_params_t *params,
- const char *serverin,
- unsigned serverinlen,
- sasl_interact_t **prompt_need,
- const char **clientout,
- unsigned *clientoutlen,
- sasl_out_params_t *oparams)
+ sasl_client_params_t *params,
+ const char *serverin,
+ unsigned serverinlen,
+ sasl_interact_t **prompt_need,
+ const char **clientout,
+ unsigned *clientoutlen,
+ sasl_out_params_t *oparams)
{
context_t *text = (context_t *)conn_context;
gss_buffer_t input_token, output_token;
@@ -1275,286 +1275,286 @@ static int gssapi_client_mech_step(void *conn_context,
input_token = &real_input_token;
output_token = &real_output_token;
output_token->value = NULL;
- input_token->value = NULL;
+ input_token->value = NULL;
input_token->length = 0;
-
+
*clientout = NULL;
*clientoutlen = 0;
-
+
if (sasl_gss_lib_init(text->utils) != SASL_OK) return SASL_FAIL;
-
+
switch (text->state) {
case SASL_GSSAPI_STATE_AUTHNEG:
- /* try to get the userid */
- if (text->user == NULL) {
- int user_result = SASL_OK;
-
- user_result = _plug_get_userid(params->utils, &text->user,
- prompt_need);
-
- if ((user_result != SASL_OK) && (user_result != SASL_INTERACT)) {
- sasl_gss_free_context_contents(text);
- return user_result;
- }
-
- /* free prompts we got */
- if (prompt_need && *prompt_need) {
- params->utils->free(*prompt_need);
- *prompt_need = NULL;
- }
-
- /* if there are prompts not filled in */
- if (user_result == SASL_INTERACT) {
- /* make the prompt list */
- int result =
- _plug_make_prompts(params->utils, prompt_need,
- user_result == SASL_INTERACT ?
- "Please enter your authorization name" : NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL);
- if (result != SASL_OK) return result;
-
- return SASL_INTERACT;
- }
- }
-
- if (text->server_name == GSS_C_NO_NAME) { /* only once */
- name_token.length = strlen(params->service) + 1 + strlen(params->serverFQDN);
- name_token.value = (char *)params->utils->malloc((name_token.length + 1) * sizeof(char));
- if (name_token.value == NULL) {
- sasl_gss_free_context_contents(text);
- return SASL_NOMEM;
- }
- if (params->serverFQDN == NULL
- || strlen(params->serverFQDN) == 0) {
- SETERROR(text->utils, "GSSAPI Failure: no serverFQDN");
- return SASL_FAIL;
- }
-
- sprintf(name_token.value,"%s@%s", params->service, params->serverFQDN);
-
- maj_stat = (*p_krb5_gss_import_name) (&min_stat,
- &name_token,
- GSS_C_NT_HOSTBASED_SERVICE,
- &text->server_name);
-
- params->utils->free(name_token.value);
- name_token.value = NULL;
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
- }
-
- if (serverinlen == 0)
- input_token = GSS_C_NO_BUFFER;
-
- if (serverinlen) {
- real_input_token.value = (void *)serverin;
- real_input_token.length = serverinlen;
- }
- else if (text->gss_ctx != GSS_C_NO_CONTEXT ) {
- /* This can't happen under GSSAPI: we have a non-null context
- * and no input from the server. However, thanks to Imap,
- * which discards our first output, this happens all the time.
- * Throw away the context and try again. */
- maj_stat = (*p_krb5_gss_delete_sec_context) (&min_stat,&text->gss_ctx,GSS_C_NO_BUFFER);
- text->gss_ctx = GSS_C_NO_CONTEXT;
- }
-
- /* Setup req_flags properly */
- req_flags = GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG;
- if(params->props.max_ssf > params->external_ssf) {
- /* We are requesting a security layer */
- req_flags |= GSS_C_INTEG_FLAG;
- /* Any SSF bigger than 1 is confidentiality. */
- /* Let's check if the client of the API requires confidentiality,
- and it wasn't already provided by an external layer */
- if(params->props.max_ssf - params->external_ssf > 1) {
- /* We want to try for privacy */
- req_flags |= GSS_C_CONF_FLAG;
- }
- }
-
- maj_stat = (*p_krb5_gss_init_sec_context)(&min_stat,
- GSS_C_NO_CREDENTIAL,
- &text->gss_ctx,
- text->server_name,
- GSS_C_NO_OID,
- req_flags,
- 0,
- GSS_C_NO_CHANNEL_BINDINGS,
- input_token,
- NULL,
- output_token,
- &out_req_flags,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- *clientoutlen = output_token->length;
-
- if (output_token->value) {
- if (clientout) {
- ret = _plug_buf_alloc(text->utils, &(text->out_buf),
- &(text->out_buf_len), *clientoutlen);
- if(ret != SASL_OK) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return ret;
- }
- memcpy(text->out_buf, output_token->value, *clientoutlen);
- *clientout = text->out_buf;
- }
-
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- }
-
- if (maj_stat == GSS_S_COMPLETE) {
- maj_stat = (*p_krb5_gss_inquire_context)(&min_stat,
- text->gss_ctx,
- &text->client_name,
- NULL, /* targ_name */
- NULL, /* lifetime */
- NULL, /* mech */
- /* FIX ME: Should check the resulting flags here */
- NULL, /* flags */
- NULL, /* local init */
- NULL); /* open */
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- name_token.length = 0;
- maj_stat = (*p_krb5_gss_display_name)(&min_stat,
- text->client_name,
- &name_token,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- if (name_token.value)
- (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
- SETERROR(text->utils, "GSSAPI Failure");
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- if (text->user && text->user[0]) {
- ret = params->canon_user(params->utils->conn,
- text->user, 0,
- SASL_CU_AUTHZID, oparams);
- if (ret == SASL_OK)
- ret = params->canon_user(params->utils->conn,
- name_token.value, 0,
- SASL_CU_AUTHID, oparams);
- } else {
- ret = params->canon_user(params->utils->conn,
- name_token.value, 0,
- SASL_CU_AUTHID | SASL_CU_AUTHZID,
- oparams);
- }
- (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
-
- if (ret != SASL_OK) return ret;
-
- /* Switch to ssf negotiation */
- text->state = SASL_GSSAPI_STATE_SSFCAP;
- }
-
- return SASL_CONTINUE;
+ /* try to get the userid */
+ if (text->user == NULL) {
+ int user_result = SASL_OK;
+
+ user_result = _plug_get_userid(params->utils, &text->user,
+ prompt_need);
+
+ if ((user_result != SASL_OK) && (user_result != SASL_INTERACT)) {
+ sasl_gss_free_context_contents(text);
+ return user_result;
+ }
+
+ /* free prompts we got */
+ if (prompt_need && *prompt_need) {
+ params->utils->free(*prompt_need);
+ *prompt_need = NULL;
+ }
+
+ /* if there are prompts not filled in */
+ if (user_result == SASL_INTERACT) {
+ /* make the prompt list */
+ int result =
+ _plug_make_prompts(params->utils, prompt_need,
+ user_result == SASL_INTERACT ?
+ "Please enter your authorization name" : NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
+ if (result != SASL_OK) return result;
+
+ return SASL_INTERACT;
+ }
+ }
+
+ if (text->server_name == GSS_C_NO_NAME) { /* only once */
+ name_token.length = strlen(params->service) + 1 + strlen(params->serverFQDN);
+ name_token.value = (char *)params->utils->malloc((name_token.length + 1) * sizeof(char));
+ if (name_token.value == NULL) {
+ sasl_gss_free_context_contents(text);
+ return SASL_NOMEM;
+ }
+ if (params->serverFQDN == NULL
+ || strlen(params->serverFQDN) == 0) {
+ SETERROR(text->utils, "GSSAPI Failure: no serverFQDN");
+ return SASL_FAIL;
+ }
+
+ sprintf(name_token.value,"%s@%s", params->service, params->serverFQDN);
+
+ maj_stat = (*p_krb5_gss_import_name) (&min_stat,
+ &name_token,
+ GSS_C_NT_HOSTBASED_SERVICE,
+ &text->server_name);
+
+ params->utils->free(name_token.value);
+ name_token.value = NULL;
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+ }
+
+ if (serverinlen == 0)
+ input_token = GSS_C_NO_BUFFER;
+
+ if (serverinlen) {
+ real_input_token.value = (void *)serverin;
+ real_input_token.length = serverinlen;
+ }
+ else if (text->gss_ctx != GSS_C_NO_CONTEXT ) {
+ /* This can't happen under GSSAPI: we have a non-null context
+ * and no input from the server. However, thanks to Imap,
+ * which discards our first output, this happens all the time.
+ * Throw away the context and try again. */
+ maj_stat = (*p_krb5_gss_delete_sec_context) (&min_stat,&text->gss_ctx,GSS_C_NO_BUFFER);
+ text->gss_ctx = GSS_C_NO_CONTEXT;
+ }
+
+ /* Setup req_flags properly */
+ req_flags = GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG;
+ if(params->props.max_ssf > params->external_ssf) {
+ /* We are requesting a security layer */
+ req_flags |= GSS_C_INTEG_FLAG;
+ /* Any SSF bigger than 1 is confidentiality. */
+ /* Let's check if the client of the API requires confidentiality,
+ and it wasn't already provided by an external layer */
+ if(params->props.max_ssf - params->external_ssf > 1) {
+ /* We want to try for privacy */
+ req_flags |= GSS_C_CONF_FLAG;
+ }
+ }
+
+ maj_stat = (*p_krb5_gss_init_sec_context)(&min_stat,
+ GSS_C_NO_CREDENTIAL,
+ &text->gss_ctx,
+ text->server_name,
+ GSS_C_NO_OID,
+ req_flags,
+ 0,
+ GSS_C_NO_CHANNEL_BINDINGS,
+ input_token,
+ NULL,
+ output_token,
+ &out_req_flags,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ *clientoutlen = output_token->length;
+
+ if (output_token->value) {
+ if (clientout) {
+ ret = _plug_buf_alloc(text->utils, &(text->out_buf),
+ &(text->out_buf_len), *clientoutlen);
+ if(ret != SASL_OK) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return ret;
+ }
+ memcpy(text->out_buf, output_token->value, *clientoutlen);
+ *clientout = text->out_buf;
+ }
+
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ }
+
+ if (maj_stat == GSS_S_COMPLETE) {
+ maj_stat = (*p_krb5_gss_inquire_context)(&min_stat,
+ text->gss_ctx,
+ &text->client_name,
+ NULL, /* targ_name */
+ NULL, /* lifetime */
+ NULL, /* mech */
+ /* FIX ME: Should check the resulting flags here */
+ NULL, /* flags */
+ NULL, /* local init */
+ NULL); /* open */
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ name_token.length = 0;
+ maj_stat = (*p_krb5_gss_display_name)(&min_stat,
+ text->client_name,
+ &name_token,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ if (name_token.value)
+ (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
+ SETERROR(text->utils, "GSSAPI Failure");
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ if (text->user && text->user[0]) {
+ ret = params->canon_user(params->utils->conn,
+ text->user, 0,
+ SASL_CU_AUTHZID, oparams);
+ if (ret == SASL_OK)
+ ret = params->canon_user(params->utils->conn,
+ name_token.value, 0,
+ SASL_CU_AUTHID, oparams);
+ } else {
+ ret = params->canon_user(params->utils->conn,
+ name_token.value, 0,
+ SASL_CU_AUTHID | SASL_CU_AUTHZID,
+ oparams);
+ }
+ (*p_krb5_gss_release_buffer)(&min_stat, &name_token);
+
+ if (ret != SASL_OK) return ret;
+
+ /* Switch to ssf negotiation */
+ text->state = SASL_GSSAPI_STATE_SSFCAP;
+ }
+
+ return SASL_CONTINUE;
case SASL_GSSAPI_STATE_SSFCAP: {
- sasl_security_properties_t *secprops = &(params->props);
- unsigned int alen, external = params->external_ssf;
- sasl_ssf_t need, allowed;
- char serverhas, mychoice;
-
- real_input_token.value = (void *) serverin;
- real_input_token.length = serverinlen;
-
- maj_stat = (*p_krb5_gss_unwrap)(&min_stat,
- text->gss_ctx,
- input_token,
- output_token,
- NULL,
- NULL);
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- sasl_gss_free_context_contents(text);
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return SASL_FAIL;
- }
-
- /* taken from kerberos.c */
- if (secprops->min_ssf > (K5_MAX_SSF + external)) {
- return SASL_TOOWEAK;
- } else if (secprops->min_ssf > secprops->max_ssf) {
- return SASL_BADPARAM;
- }
-
- /* need bits of layer -- sasl_ssf_t is unsigned so be careful */
- if (secprops->max_ssf >= external) {
- allowed = secprops->max_ssf - external;
- } else {
- allowed = 0;
- }
- if (secprops->min_ssf >= external) {
- need = secprops->min_ssf - external;
- } else {
- /* good to go */
- need = 0;
- }
-
- /* bit mask of server support */
- serverhas = ((char *)output_token->value)[0];
-
- /* if client didn't set use strongest layer available */
- if (allowed >= K5_MAX_SSF && need <= K5_MAX_SSF && (serverhas & 4)) {
- /* encryption */
- oparams->encode = &gssapi_privacy_encode;
- oparams->decode = &gssapi_decode;
- /* FIX ME: Need to extract the proper value here */
- oparams->mech_ssf = K5_MAX_SSF;
- mychoice = 4;
- } else if (allowed >= 1 && need <= 1 && (serverhas & 2)) {
- /* integrity */
- oparams->encode = &gssapi_integrity_encode;
- oparams->decode = &gssapi_decode;
- oparams->mech_ssf = 1;
- mychoice = 2;
- } else if (need <= 0 && (serverhas & 1)) {
- /* no layer */
- oparams->encode = NULL;
- oparams->decode = NULL;
- oparams->mech_ssf = 0;
- mychoice = 1;
- } else {
- /* there's no appropriate layering for us! */
- sasl_gss_free_context_contents(text);
- return SASL_TOOWEAK;
- }
-
+ sasl_security_properties_t *secprops = &(params->props);
+ unsigned int alen, external = params->external_ssf;
+ sasl_ssf_t need, allowed;
+ char serverhas, mychoice;
+
+ real_input_token.value = (void *) serverin;
+ real_input_token.length = serverinlen;
+
+ maj_stat = (*p_krb5_gss_unwrap)(&min_stat,
+ text->gss_ctx,
+ input_token,
+ output_token,
+ NULL,
+ NULL);
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ sasl_gss_free_context_contents(text);
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return SASL_FAIL;
+ }
+
+ /* taken from kerberos.c */
+ if (secprops->min_ssf > (K5_MAX_SSF + external)) {
+ return SASL_TOOWEAK;
+ } else if (secprops->min_ssf > secprops->max_ssf) {
+ return SASL_BADPARAM;
+ }
+
+ /* need bits of layer -- sasl_ssf_t is unsigned so be careful */
+ if (secprops->max_ssf >= external) {
+ allowed = secprops->max_ssf - external;
+ } else {
+ allowed = 0;
+ }
+ if (secprops->min_ssf >= external) {
+ need = secprops->min_ssf - external;
+ } else {
+ /* good to go */
+ need = 0;
+ }
+
+ /* bit mask of server support */
+ serverhas = ((char *)output_token->value)[0];
+
+ /* if client didn't set use strongest layer available */
+ if (allowed >= K5_MAX_SSF && need <= K5_MAX_SSF && (serverhas & 4)) {
+ /* encryption */
+ oparams->encode = &gssapi_privacy_encode;
+ oparams->decode = &gssapi_decode;
+ /* FIX ME: Need to extract the proper value here */
+ oparams->mech_ssf = K5_MAX_SSF;
+ mychoice = 4;
+ } else if (allowed >= 1 && need <= 1 && (serverhas & 2)) {
+ /* integrity */
+ oparams->encode = &gssapi_integrity_encode;
+ oparams->decode = &gssapi_decode;
+ oparams->mech_ssf = 1;
+ mychoice = 2;
+ } else if (need <= 0 && (serverhas & 1)) {
+ /* no layer */
+ oparams->encode = NULL;
+ oparams->decode = NULL;
+ oparams->mech_ssf = 0;
+ mychoice = 1;
+ } else {
+ /* there's no appropriate layering for us! */
+ sasl_gss_free_context_contents(text);
+ return SASL_TOOWEAK;
+ }
+
oparams->maxoutbuf =
- (((unsigned char *) output_token->value)[1] << 16) |
+ (((unsigned char *) output_token->value)[1] << 16) |
(((unsigned char *) output_token->value)[2] << 8) |
(((unsigned char *) output_token->value)[3] << 0);
- if(oparams->mech_ssf) {
+ if(oparams->mech_ssf) {
maj_stat = (*p_krb5_gss_wrap_size_limit)(&min_stat,
text->gss_ctx,
1,
@@ -1562,38 +1562,38 @@ static int gssapi_client_mech_step(void *conn_context,
(OM_uint32) oparams->maxoutbuf,
&max_input);
- if(max_input > oparams->maxoutbuf) {
- /* Heimdal appears to get this wrong */
- oparams->maxoutbuf -= (max_input - oparams->maxoutbuf);
- } else {
- /* This code is actually correct */
- oparams->maxoutbuf = max_input;
- }
- }
-
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
-
- /* oparams->user is always set, due to canon_user requirements.
- * Make sure the client actually requested it though, by checking
- * if our context was set.
- */
- if (text->user && text->user[0])
- alen = strlen(oparams->user);
- else
- alen = 0;
-
- input_token->length = 4 + alen;
- input_token->value =
- (char *)params->utils->malloc((input_token->length + 1)*sizeof(char));
- if (input_token->value == NULL) {
- sasl_gss_free_context_contents(text);
- return SASL_NOMEM;
- }
-
- if (alen)
- memcpy((char *)input_token->value+4,oparams->user,alen);
-
- /* build up our security properties token */
+ if(max_input > oparams->maxoutbuf) {
+ /* Heimdal appears to get this wrong */
+ oparams->maxoutbuf -= (max_input - oparams->maxoutbuf);
+ } else {
+ /* This code is actually correct */
+ oparams->maxoutbuf = max_input;
+ }
+ }
+
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+
+ /* oparams->user is always set, due to canon_user requirements.
+ * Make sure the client actually requested it though, by checking
+ * if our context was set.
+ */
+ if (text->user && text->user[0])
+ alen = strlen(oparams->user);
+ else
+ alen = 0;
+
+ input_token->length = 4 + alen;
+ input_token->value =
+ (char *)params->utils->malloc((input_token->length + 1)*sizeof(char));
+ if (input_token->value == NULL) {
+ sasl_gss_free_context_contents(text);
+ return SASL_NOMEM;
+ }
+
+ if (alen)
+ memcpy((char *)input_token->value+4,oparams->user,alen);
+
+ /* build up our security properties token */
if (params->props.maxbufsize > 0xFFFFFF) {
/* make sure maxbufsize isn't too large */
/* maxbufsize = 0xFFFFFF */
@@ -1601,115 +1601,115 @@ static int gssapi_client_mech_step(void *conn_context,
((unsigned char *)input_token->value)[2] = 0xFF;
((unsigned char *)input_token->value)[3] = 0xFF;
} else {
- ((unsigned char *)input_token->value)[1] =
+ ((unsigned char *)input_token->value)[1] =
(params->props.maxbufsize >> 16) & 0xFF;
- ((unsigned char *)input_token->value)[2] =
+ ((unsigned char *)input_token->value)[2] =
(params->props.maxbufsize >> 8) & 0xFF;
- ((unsigned char *)input_token->value)[3] =
+ ((unsigned char *)input_token->value)[3] =
(params->props.maxbufsize >> 0) & 0xFF;
}
- ((unsigned char *)input_token->value)[0] = mychoice;
-
- maj_stat = (*p_krb5_gss_wrap) (&min_stat,
- text->gss_ctx,
- 0, /* Just integrity checking here */
- GSS_C_QOP_DEFAULT,
- input_token,
- NULL,
- output_token);
-
- params->utils->free(input_token->value);
- input_token->value = NULL;
-
- if (GSS_ERROR(maj_stat)) {
- sasl_gss_seterror(text->utils, maj_stat, min_stat);
- if (output_token->value)
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- sasl_gss_free_context_contents(text);
- return SASL_FAIL;
- }
-
- if (clientoutlen)
- *clientoutlen = output_token->length;
- if (output_token->value) {
- if (clientout) {
- ret = _plug_buf_alloc(text->utils, &(text->out_buf),
- &(text->out_buf_len), *clientoutlen);
- if (ret != SASL_OK) {
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- return ret;
- }
- memcpy(text->out_buf, output_token->value, *clientoutlen);
- *clientout = text->out_buf;
- }
-
- (*p_krb5_gss_release_buffer)(&min_stat, output_token);
- }
-
- text->state = SASL_GSSAPI_STATE_AUTHENTICATED;
-
- oparams->doneflag = 1;
-
- /* used by layers */
- _plug_decode_init(&text->decode_context, text->utils,
- (params->props.maxbufsize > 0xFFFFFF) ? 0xFFFFFF :
- params->props.maxbufsize);
-
- return SASL_OK;
+ ((unsigned char *)input_token->value)[0] = mychoice;
+
+ maj_stat = (*p_krb5_gss_wrap) (&min_stat,
+ text->gss_ctx,
+ 0, /* Just integrity checking here */
+ GSS_C_QOP_DEFAULT,
+ input_token,
+ NULL,
+ output_token);
+
+ params->utils->free(input_token->value);
+ input_token->value = NULL;
+
+ if (GSS_ERROR(maj_stat)) {
+ sasl_gss_seterror(text->utils, maj_stat, min_stat);
+ if (output_token->value)
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ sasl_gss_free_context_contents(text);
+ return SASL_FAIL;
+ }
+
+ if (clientoutlen)
+ *clientoutlen = output_token->length;
+ if (output_token->value) {
+ if (clientout) {
+ ret = _plug_buf_alloc(text->utils, &(text->out_buf),
+ &(text->out_buf_len), *clientoutlen);
+ if (ret != SASL_OK) {
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ return ret;
+ }
+ memcpy(text->out_buf, output_token->value, *clientoutlen);
+ *clientout = text->out_buf;
+ }
+
+ (*p_krb5_gss_release_buffer)(&min_stat, output_token);
+ }
+
+ text->state = SASL_GSSAPI_STATE_AUTHENTICATED;
+
+ oparams->doneflag = 1;
+
+ /* used by layers */
+ _plug_decode_init(&text->decode_context, text->utils,
+ (params->props.maxbufsize > 0xFFFFFF) ? 0xFFFFFF :
+ params->props.maxbufsize);
+
+ return SASL_OK;
}
-
+
default:
- params->utils->log(NULL, SASL_LOG_ERR,
- "Invalid GSSAPI client step %d\n", text->state);
- return SASL_FAIL;
+ params->utils->log(NULL, SASL_LOG_ERR,
+ "Invalid GSSAPI client step %d\n", text->state);
+ return SASL_FAIL;
}
-
+
return SASL_FAIL; /* should never get here */
}
static const unsigned long gssapi_required_prompts[] = {
SASL_CB_LIST_END
-};
+};
-static sasl_client_plug_t gssapi_client_plugins[] =
+static sasl_client_plug_t gssapi_client_plugins[] =
{
{
- "GSSAPI", /* mech_name */
- K5_MAX_SSF, /* max_ssf */
- SASL_SEC_NOPLAINTEXT
- | SASL_SEC_NOACTIVE
- | SASL_SEC_NOANONYMOUS
- | SASL_SEC_MUTUAL_AUTH, /* security_flags */
- SASL_FEAT_NEEDSERVERFQDN
- | SASL_FEAT_WANT_CLIENT_FIRST
- | SASL_FEAT_ALLOWS_PROXY, /* features */
- gssapi_required_prompts, /* required_prompts */
- NULL, /* glob_context */
- &gssapi_client_mech_new, /* mech_new */
- &gssapi_client_mech_step, /* mech_step */
- &gssapi_common_mech_dispose, /* mech_dispose */
- NULL, /* mech_free */
- NULL, /* idle */
- NULL, /* spare */
- NULL /* spare */
+ "GSSAPI", /* mech_name */
+ K5_MAX_SSF, /* max_ssf */
+ SASL_SEC_NOPLAINTEXT
+ | SASL_SEC_NOACTIVE
+ | SASL_SEC_NOANONYMOUS
+ | SASL_SEC_MUTUAL_AUTH, /* security_flags */
+ SASL_FEAT_NEEDSERVERFQDN
+ | SASL_FEAT_WANT_CLIENT_FIRST
+ | SASL_FEAT_ALLOWS_PROXY, /* features */
+ gssapi_required_prompts, /* required_prompts */
+ NULL, /* glob_context */
+ &gssapi_client_mech_new, /* mech_new */
+ &gssapi_client_mech_step, /* mech_step */
+ &gssapi_common_mech_dispose, /* mech_dispose */
+ NULL, /* mech_free */
+ NULL, /* idle */
+ NULL, /* spare */
+ NULL /* spare */
}
};
-int gssapiv2_client_plug_init(const sasl_utils_t *utils __attribute__((unused)),
- int maxversion,
- int *out_version,
- sasl_client_plug_t **pluglist,
- int *plugcount)
+int gssapiv2_client_plug_init(const sasl_utils_t *utils __attribute__((unused)),
+ int maxversion,
+ int *out_version,
+ sasl_client_plug_t **pluglist,
+ int *plugcount)
{
if (maxversion < SASL_CLIENT_PLUG_VERSION) {
- SETERROR(utils, "Version mismatch in GSSAPI");
- return SASL_BADVERS;
+ SETERROR(utils, "Version mismatch in GSSAPI");
+ return SASL_BADVERS;
}
-
+
*out_version = SASL_CLIENT_PLUG_VERSION;
*pluglist = gssapi_client_plugins;
*plugcount = 1;
-
+
return SASL_OK;
}
@@ -1728,17 +1728,17 @@ int gssapiv2_client_plug_init(const sasl_utils_t *utils __attribute__((unused)),
OM_uint32
gss_add_cred(
- OM_uint32 *minor_status,
- gss_cred_id_t input_cred_handle,
- gss_name_t desired_name,
- gss_OID desired_mech,
- gss_cred_usage_t cred_usage,
- OM_uint32 initiator_time_req,
- OM_uint32 acceptor_time_req,
- gss_cred_id_t *output_cred_handle,
- gss_OID_set *actual_mechs,
- OM_uint32 *initiator_time_rec,
- OM_uint32 *acceptor_time_rec)
+ OM_uint32 *minor_status,
+ gss_cred_id_t input_cred_handle,
+ gss_name_t desired_name,
+ gss_OID desired_mech,
+ gss_cred_usage_t cred_usage,
+ OM_uint32 initiator_time_req,
+ OM_uint32 acceptor_time_req,
+ gss_cred_id_t *output_cred_handle,
+ gss_OID_set *actual_mechs,
+ OM_uint32 *initiator_time_rec,
+ OM_uint32 *acceptor_time_rec)
{
return((*p_krb5_gss_add_cred)(minor_status, input_cred_handle,
desired_name,
@@ -1758,8 +1758,8 @@ gss_seal(OM_uint32 *minor_status,
gss_buffer_t output_message_buffer)
{
return((*p_krb5_gss_seal)(minor_status, context_handle,
- conf_req_flag, qop_req, input_message_buffer,
- conf_state, output_message_buffer));
+ conf_req_flag, qop_req, input_message_buffer,
+ conf_state, output_message_buffer));
}
OM_uint32
@@ -1771,8 +1771,8 @@ gss_unseal(OM_uint32 *minor_status,
int *qop_state)
{
return((*p_krb5_gss_unseal)(minor_status, context_handle,
- input_message_buffer, output_message_buffer,
- conf_state, qop_state));
+ input_message_buffer, output_message_buffer,
+ conf_state, qop_state));
}
#endif
diff --git a/myproxy/source/myproxy.c b/myproxy/source/myproxy.c
index 963449d6a0..34e8041270 100644
--- a/myproxy/source/myproxy.c
+++ b/myproxy/source/myproxy.c
@@ -896,30 +896,30 @@ myproxy_authenticate_init(myproxy_socket_attrs_t *attrs,
gss_buffer_desc name_buf;
const char *services[] = { "myproxy", "host" };
int s;
- OM_uint32 major_status, minor_status;
+ OM_uint32 minor_status;
- fqhn = GSI_SOCKET_get_peer_hostname(attrs->gsi_socket);
- if (!fqhn) {
- GSI_SOCKET_get_error_string(attrs->gsi_socket, error_string,
- sizeof(error_string));
- verror_put_string("Error getting name of remote party: %s\n",
- error_string);
- goto error;
- }
- for (s = 0; s < (sizeof services)/(sizeof *services); s++)
- {
+ fqhn = GSI_SOCKET_get_peer_hostname(attrs->gsi_socket);
+ if (!fqhn) {
+ GSI_SOCKET_get_error_string(attrs->gsi_socket, error_string,
+ sizeof(error_string));
+ verror_put_string("Error getting name of remote party: %s\n",
+ error_string);
+ goto error;
+ }
+ for (s = 0; s < (sizeof services)/(sizeof *services); s++)
+ {
name_buf.value = globus_common_create_string("%s@%s",
services[s], fqhn);
name_buf.length = strlen(name_buf.value);
- major_status = gss_import_name(
+ gss_import_name(
&minor_status,
&name_buf,
GSS_C_NT_HOSTBASED_SERVICE,
&accepted_peer_names[s]);
- }
+ }
- free(fqhn);
+ free(fqhn);
}
}
@@ -2812,7 +2812,7 @@ convert_message(const char *buffer,
char **line)
{
int foundone = 0;
- char *varname_start;
+ const char *varname_start;
int return_value = -1;
int line_index = 0;
const char *buffer_p;
@@ -2836,7 +2836,7 @@ convert_message(const char *buffer,
while ((varname_start = strstr(buffer_p, varname)) != NULL)
{
- char *value_start;
+ const char *value_start;
int value_length;
/* Have is this the first varname we've found? */
diff --git a/myproxy/source/myproxy_alcf.c b/myproxy/source/myproxy_alcf.c
index 308fd3498b..e67ea464e8 100644
--- a/myproxy/source/myproxy_alcf.c
+++ b/myproxy/source/myproxy_alcf.c
@@ -5,10 +5,10 @@
*
*/
-#include "myproxy_common.h" /* all needed headers included here */
+#include "myproxy_common.h" /* all needed headers included here */
#define MYPROXY_DEFAULT_PROXY "/tmp/myproxy-proxy"
-#define SECONDS_PER_HOUR (60 * 60)
+#define SECONDS_PER_HOUR (60 * 60)
static int dn_as_username = 0;
static char usage[] = \
@@ -26,7 +26,7 @@ static char usage[] = \
" -c | --certfile Certificate file name\n"
" -y | --keyfile Key file name\n"
" -l | --username Username for the delegated proxy\n"
-" -t | --proxy_lifetime Lifetime of proxies delegated by\n"
+" -t | --proxy_lifetime Lifetime of proxies delegated by\n"
" server (default 12 hours)\n"
" -a | --allow_anonymous_retrievers Allow credentials to be retrieved\n"
" with just username/passphrase\n"
@@ -55,8 +55,8 @@ struct option long_options[] =
{
{"help", no_argument, NULL, 'h'},
{"usage", no_argument, NULL, 'u'},
- {"certfile", required_argument, NULL, 'c'},
- {"keyfile", required_argument, NULL, 'y'},
+ {"certfile", required_argument, NULL, 'c'},
+ {"keyfile", required_argument, NULL, 'y'},
{"proxy_lifetime", required_argument, NULL, 't'},
{"storage", required_argument, NULL, 's'},
{"username", required_argument, NULL, 'l'},
@@ -68,9 +68,9 @@ struct option long_options[] =
{"retrievable_by", required_argument, NULL, 'r'},
{"renewable_by", required_argument, NULL, 'R'},
{"regex_dn_match", no_argument, NULL, 'x'},
- {"match_cn_only", no_argument, NULL, 'X'},
- {"credname", required_argument, NULL, 'k'},
- {"creddesc", required_argument, NULL, 'K'},
+ {"match_cn_only", no_argument, NULL, 'X'},
+ {"credname", required_argument, NULL, 'k'},
+ {"creddesc", required_argument, NULL, 'K'},
{"retrievable_by_cert", required_argument, NULL, 'Z'},
{"retrieve_key", required_argument, NULL, 'E'},
{0, 0, 0, 0}
@@ -90,7 +90,7 @@ static char version[] =
void init_arguments(int argc, char *argv[], myproxy_creds_t *my_creds);
int makeproxy(const char certfile[], const char keyfile[],
- const char proxyfile[]);
+ const char proxyfile[]);
int get_storage_dir_owner(uid_t *owner);
int main(int argc, char *argv[])
@@ -101,10 +101,10 @@ int main(int argc, char *argv[])
/* check library version */
if (myproxy_check_version()) {
- fprintf(stderr, "MyProxy library version mismatch.\n"
- "Expecting %s. Found %s.\n",
- MYPROXY_VERSION_DATE, myproxy_version(0,0,0));
- exit(1);
+ fprintf(stderr, "MyProxy library version mismatch.\n"
+ "Expecting %s. Found %s.\n",
+ MYPROXY_VERSION_DATE, myproxy_version(0,0,0));
+ exit(1);
}
myproxy_log_use_stream (stderr);
@@ -112,61 +112,61 @@ int main(int argc, char *argv[])
init_arguments (argc, argv, &my_creds);
if (certfile == NULL) {
- fprintf (stderr, "Specify certificate file with -c option\n");
- fprintf(stderr, "%s", usage);
- goto cleanup;
+ fprintf (stderr, "Specify certificate file with -c option\n");
+ fprintf(stderr, "%s", usage);
+ goto cleanup;
}
if (keyfile == NULL) {
- fprintf (stderr, "Specify key file with -y option\n");
- fprintf(stderr, "%s", usage);
- goto cleanup;
+ fprintf (stderr, "Specify key file with -y option\n");
+ fprintf(stderr, "%s", usage);
+ goto cleanup;
}
sprintf(proxyfile, "%s.%u.%u", MYPROXY_DEFAULT_PROXY,
- (unsigned)getuid(), (unsigned)getpid());
+ (unsigned)getuid(), (unsigned)getpid());
/* Remove proxyfile if it already exists. */
ssl_proxy_file_destroy(proxyfile);
verror_clear();
if (makeproxy(certfile, keyfile, proxyfile) < 0) {
- fprintf(stderr, "Failed to create temporary credentials file.\n");
- goto cleanup;
+ fprintf(stderr, "Failed to create temporary credentials file.\n");
+ goto cleanup;
}
-
+
if (my_creds.username == NULL) { /* set default username */
- if (dn_as_username) {
- if (ssl_get_base_subject_file(proxyfile,
- &my_creds.username)) {
- fprintf(stderr,
- "Cannot get subject name from your certificate\n");
- goto cleanup;
- }
- } else {
- char *username = NULL;
- if (!(username = getenv("LOGNAME"))) {
- fprintf(stderr, "Please specify a username.\n");
- goto cleanup;
- }
- my_creds.username = strdup(username);
- }
+ if (dn_as_username) {
+ if (ssl_get_base_subject_file(proxyfile,
+ &my_creds.username)) {
+ fprintf(stderr,
+ "Cannot get subject name from your certificate\n");
+ goto cleanup;
+ }
+ } else {
+ char *username = NULL;
+ if (!(username = getenv("LOGNAME"))) {
+ fprintf(stderr, "Please specify a username.\n");
+ goto cleanup;
+ }
+ my_creds.username = strdup(username);
+ }
}
if (ssl_get_base_subject_file(proxyfile,
- &my_creds.owner_name)) {
- fprintf(stderr,
- "Cannot get subject name from certificate.\n");
- goto cleanup;
+ &my_creds.owner_name)) {
+ fprintf(stderr,
+ "Cannot get subject name from certificate.\n");
+ goto cleanup;
}
my_creds.location = strdup(proxyfile);
if (myproxy_creds_store(&my_creds) < 0) {
- myproxy_log_verror();
- fprintf (stderr, "Unable to store credentials. %s\n",
- verror_get_string());
+ myproxy_log_verror();
+ fprintf (stderr, "Unable to store credentials. %s\n",
+ verror_get_string());
goto cleanup;
} else {
- fprintf (stdout, "Credential stored successfully\n");
+ fprintf (stdout, "Credential stored successfully\n");
}
rval = 0;
@@ -176,9 +176,9 @@ int main(int argc, char *argv[])
}
-void
-init_arguments(int argc,
- char *argv[], myproxy_creds_t *my_creds)
+void
+init_arguments(int argc,
+ char *argv[], myproxy_creds_t *my_creds)
{
extern char *optarg;
int arg;
@@ -186,176 +186,176 @@ init_arguments(int argc,
my_creds->lifetime = SECONDS_PER_HOUR * MYPROXY_DEFAULT_DELEG_HOURS;
- while((arg = getopt_long(argc, argv, short_options,
- long_options, NULL)) != EOF)
+ while((arg = getopt_long(argc, argv, short_options,
+ long_options, NULL)) != EOF)
{
- switch(arg)
- {
+ switch(arg)
+ {
case 's': /* set the credential storage directory */
- myproxy_set_storage_dir(optarg);
+ myproxy_set_storage_dir(optarg);
storage_dir = optarg;
- break;
-
- case 'c': /* credential file name*/
- certfile = strdup (optarg);
- break;
- case 'y': /* key file name */
- keyfile = strdup (optarg);
- break;
- case 'u': /* print help and exit */
+ break;
+
+ case 'c': /* credential file name*/
+ certfile = strdup (optarg);
+ break;
+ case 'y': /* key file name */
+ keyfile = strdup (optarg);
+ break;
+ case 'u': /* print help and exit */
printf("%s", usage);
exit(0);
- break;
- case 't': /* Specify proxy lifetime in hours */
- my_creds->lifetime = SECONDS_PER_HOUR * atoi(optarg);
- break;
- case 'h': /* print help and exit */
+ break;
+ case 't': /* Specify proxy lifetime in hours */
+ my_creds->lifetime = SECONDS_PER_HOUR * atoi(optarg);
+ break;
+ case 'h': /* print help and exit */
printf("%s", usage);
exit(0);
break;
- case 'l': /* username */
- my_creds->username = strdup (optarg);
- break;
- case 'v': /* verbose */
- myproxy_debug_set_level(1);
- break;
+ case 'l': /* username */
+ my_creds->username = strdup (optarg);
+ break;
+ case 'v': /* verbose */
+ myproxy_debug_set_level(1);
+ break;
case 'V': /* print version and exit */
printf("%s", version);
exit(0);
break;
-
-
- case 'r': /* retrievers list */
- if (my_creds->renewers) {
- fprintf(stderr, "-r is incompatible with -A and -R. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
- exit(1);
- }
- if (my_creds->retrievers) {
- fprintf(stderr, "Only one -a or -r option may be specified.\n");
- exit(1);
- }
- if (expr_type == REGULAR_EXP) /*copy as is */
- my_creds->retrievers = strdup (optarg);
- else
- {
- my_creds->retrievers = (char *)malloc(strlen(optarg)+6);
- strcpy (my_creds->retrievers, "*/CN=");
- my_creds->retrievers = strcat(my_creds->retrievers,
- optarg);
- myproxy_debug("authorized retriever %s",
- my_creds->retrievers);
- }
- break;
- case 'Z': /* retrievers list */
- if (my_creds->trusted_retrievers) {
- fprintf(stderr, "Only one -Z option may be specified.\n");
- exit(1);
- }
- if (expr_type == REGULAR_EXP) /*copy as is */
- my_creds->trusted_retrievers = strdup (optarg);
- else
- {
- my_creds->trusted_retrievers = (char *)malloc(strlen(optarg)+6);
- strcpy (my_creds->trusted_retrievers, "*/CN=");
- my_creds->trusted_retrievers = strcat(my_creds->trusted_retrievers,
- optarg);
- myproxy_debug("trusted retriever %s",
- my_creds->trusted_retrievers);
- }
- break;
- case 'R': /* renewers list */
- if (my_creds->retrievers) {
- fprintf(stderr, "-R is incompatible with -a and -r. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
- exit(1);
- }
- if (my_creds->renewers) {
- fprintf(stderr, "Only one -A or -R option may be specified.\n");
- exit(1);
- }
- if (expr_type == REGULAR_EXP) /*copy as is */
- my_creds->renewers = strdup (optarg);
- else
- {
- my_creds->renewers = (char *)malloc(strlen(optarg)+6);
- strcpy (my_creds->renewers, "*/CN=");
- my_creds->renewers = strcat (my_creds->renewers,optarg);
- myproxy_debug("authorized renewer %s",
- my_creds->renewers);
- }
- break;
- case 'd': /* use the certificate subject (DN) as the default
- username instead of LOGNAME */
- dn_as_username = 1;
- break;
- case 'x': /*set expression type to regex*/
- expr_type = REGULAR_EXP;
- myproxy_debug("expr-type = regex");
- break;
- case 'X': /*set expression type to common name*/
- expr_type = MATCH_CN_ONLY;
- myproxy_debug("expr-type = CN");
- break;
- case 'a': /*allow anonymous retrievers*/
- if (my_creds->renewers) {
- fprintf(stderr, "-a is incompatible with -A and -R. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
- exit(1);
- }
- if (my_creds->retrievers) {
- fprintf(stderr, "Only one -a or -r option may be specified.\n");
- exit(1);
- }
- my_creds->retrievers = strdup ("*");
- myproxy_debug("anonymous retrievers allowed");
- break;
- case 'A': /*allow anonymous renewers*/
- if (my_creds->retrievers) {
- fprintf(stderr, "-A is incompatible with -a and -r. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
- exit(1);
- }
- if (my_creds->renewers) {
- fprintf(stderr, "Only one -A or -R option may be specified.\n");
- exit(1);
- }
- my_creds->renewers = strdup ("*");
- myproxy_debug("anonymous renewers allowed");
- break;
- case 'E' : /* key retriever list */
- if (expr_type == REGULAR_EXP) {
- /* Copy as is */
- my_creds->keyretrieve = strdup(optarg);
- } else {
- my_creds->keyretrieve =
- (char *) malloc(strlen(optarg) + 6);
- strcpy(my_creds->keyretrieve, "*/CN=");
- my_creds->keyretrieve =
- strcat(my_creds->keyretrieve, optarg);
- myproxy_debug("authorized key retriever %s",
- my_creds->keyretrieve);
- }
- break;
- case 'k': /*credential name*/
- my_creds->credname = strdup (optarg);
- break;
- case 'K': /*credential description*/
- my_creds->creddesc = strdup (optarg);
- break;
-
- default: /* print usage and exit */
+
+
+ case 'r': /* retrievers list */
+ if (my_creds->renewers) {
+ fprintf(stderr, "-r is incompatible with -A and -R. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
+ exit(1);
+ }
+ if (my_creds->retrievers) {
+ fprintf(stderr, "Only one -a or -r option may be specified.\n");
+ exit(1);
+ }
+ if (expr_type == REGULAR_EXP) /*copy as is */
+ my_creds->retrievers = strdup (optarg);
+ else
+ {
+ my_creds->retrievers = (char *)malloc(strlen(optarg)+6);
+ strcpy (my_creds->retrievers, "*/CN=");
+ my_creds->retrievers = strcat(my_creds->retrievers,
+ optarg);
+ myproxy_debug("authorized retriever %s",
+ my_creds->retrievers);
+ }
+ break;
+ case 'Z': /* retrievers list */
+ if (my_creds->trusted_retrievers) {
+ fprintf(stderr, "Only one -Z option may be specified.\n");
+ exit(1);
+ }
+ if (expr_type == REGULAR_EXP) /*copy as is */
+ my_creds->trusted_retrievers = strdup (optarg);
+ else
+ {
+ my_creds->trusted_retrievers = (char *)malloc(strlen(optarg)+6);
+ strcpy (my_creds->trusted_retrievers, "*/CN=");
+ my_creds->trusted_retrievers = strcat(my_creds->trusted_retrievers,
+ optarg);
+ myproxy_debug("trusted retriever %s",
+ my_creds->trusted_retrievers);
+ }
+ break;
+ case 'R': /* renewers list */
+ if (my_creds->retrievers) {
+ fprintf(stderr, "-R is incompatible with -a and -r. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
+ exit(1);
+ }
+ if (my_creds->renewers) {
+ fprintf(stderr, "Only one -A or -R option may be specified.\n");
+ exit(1);
+ }
+ if (expr_type == REGULAR_EXP) /*copy as is */
+ my_creds->renewers = strdup (optarg);
+ else
+ {
+ my_creds->renewers = (char *)malloc(strlen(optarg)+6);
+ strcpy (my_creds->renewers, "*/CN=");
+ my_creds->renewers = strcat (my_creds->renewers,optarg);
+ myproxy_debug("authorized renewer %s",
+ my_creds->renewers);
+ }
+ break;
+ case 'd': /* use the certificate subject (DN) as the default
+ username instead of LOGNAME */
+ dn_as_username = 1;
+ break;
+ case 'x': /*set expression type to regex*/
+ expr_type = REGULAR_EXP;
+ myproxy_debug("expr-type = regex");
+ break;
+ case 'X': /*set expression type to common name*/
+ expr_type = MATCH_CN_ONLY;
+ myproxy_debug("expr-type = CN");
+ break;
+ case 'a': /*allow anonymous retrievers*/
+ if (my_creds->renewers) {
+ fprintf(stderr, "-a is incompatible with -A and -R. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
+ exit(1);
+ }
+ if (my_creds->retrievers) {
+ fprintf(stderr, "Only one -a or -r option may be specified.\n");
+ exit(1);
+ }
+ my_creds->retrievers = strdup ("*");
+ myproxy_debug("anonymous retrievers allowed");
+ break;
+ case 'A': /*allow anonymous renewers*/
+ if (my_creds->retrievers) {
+ fprintf(stderr, "-A is incompatible with -a and -r. A credential may not be used for both\nretrieval and renewal. If both are desired, upload multiple credentials with\ndifferent names, using the -k option.\n");
+ exit(1);
+ }
+ if (my_creds->renewers) {
+ fprintf(stderr, "Only one -A or -R option may be specified.\n");
+ exit(1);
+ }
+ my_creds->renewers = strdup ("*");
+ myproxy_debug("anonymous renewers allowed");
+ break;
+ case 'E' : /* key retriever list */
+ if (expr_type == REGULAR_EXP) {
+ /* Copy as is */
+ my_creds->keyretrieve = strdup(optarg);
+ } else {
+ my_creds->keyretrieve =
+ (char *) malloc(strlen(optarg) + 6);
+ strcpy(my_creds->keyretrieve, "*/CN=");
+ my_creds->keyretrieve =
+ strcat(my_creds->keyretrieve, optarg);
+ myproxy_debug("authorized key retriever %s",
+ my_creds->keyretrieve);
+ }
+ break;
+ case 'k': /*credential name*/
+ my_creds->credname = strdup (optarg);
+ break;
+ case 'K': /*credential description*/
+ my_creds->creddesc = strdup (optarg);
+ break;
+
+ default: /* print usage and exit */
fprintf(stderr, "%s", usage);
- exit(1);
- break;
+ exit(1);
+ break;
}
}
if (optind != argc) {
- fprintf(stderr, "%s: invalid option -- %s\n", argv[0],
- argv[optind]);
- fprintf(stderr, "%s", usage);
- exit(1);
+ fprintf(stderr, "%s: invalid option -- %s\n", argv[0],
+ argv[optind]);
+ fprintf(stderr, "%s", usage);
+ exit(1);
}
}
int makeproxy(const char certfile[], const char keyfile[],
- const char proxyfile[])
+ const char proxyfile[])
{
static char BEGINCERT[] = "-----BEGIN CERTIFICATE-----";
static char ENDCERT[] = "-----END CERTIFICATE-----";
@@ -366,20 +366,20 @@ int makeproxy(const char certfile[], const char keyfile[],
static char ENDKEY2[] = "-----END PRIVATE KEY-----";
static char ENDKEY3[] = "-----END ENCRYPTED PRIVATE KEY-----";
unsigned char *certbuf=NULL, *keybuf=NULL;
- char *certstart, *certend, *keystart, *keyend;
+ const char *certstart, *certend, *keystart, *keyend;
int return_value = -1, size, rval, fd=0;
uid_t owner;
/* Read the certificate(s) into a buffer. */
if (buffer_from_file(certfile, &certbuf, NULL) < 0) {
- fprintf(stderr, "Failed to read %s\n", certfile);
- goto cleanup;
+ fprintf(stderr, "Failed to read %s\n", certfile);
+ goto cleanup;
}
/* Read the key into a buffer. */
if (buffer_from_file(keyfile, &keybuf, NULL) < 0) {
- fprintf(stderr, "Failed to read %s\n", keyfile);
- goto cleanup;
+ fprintf(stderr, "Failed to read %s\n", keyfile);
+ goto cleanup;
}
/* special case: run as root w/ non-root storage dir */
@@ -390,96 +390,96 @@ int makeproxy(const char certfile[], const char keyfile[],
/* Open the output file. */
if ((fd = open(proxyfile, O_CREAT | O_EXCL | O_WRONLY,
- S_IRUSR | S_IWUSR)) < 0) {
- fprintf(stderr, "open(%s) failed: %s\n", proxyfile, strerror(errno));
- goto cleanup;
+ S_IRUSR | S_IWUSR)) < 0) {
+ fprintf(stderr, "open(%s) failed: %s\n", proxyfile, strerror(errno));
+ goto cleanup;
}
/* Write the first certificate. */
if ((certstart = strstr((const char *)certbuf, BEGINCERT)) == NULL) {
- fprintf(stderr, "%s doesn't contain '%s'.\n", certfile, BEGINCERT);
- goto cleanup;
+ fprintf(stderr, "%s doesn't contain '%s'.\n", certfile, BEGINCERT);
+ goto cleanup;
}
if ((certend = strstr((const char *)certstart, ENDCERT)) == NULL) {
- fprintf(stderr, "%s doesn't contain '%s'.\n", certfile, ENDCERT);
- goto cleanup;
+ fprintf(stderr, "%s doesn't contain '%s'.\n", certfile, ENDCERT);
+ goto cleanup;
}
certend += strlen(ENDCERT);
size = certend-certstart;
while (size) {
- if ((rval = write(fd, certstart, size)) < 0) {
- perror("write");
- goto cleanup;
- }
- size -= rval;
- certstart += rval;
+ if ((rval = write(fd, certstart, size)) < 0) {
+ perror("write");
+ goto cleanup;
+ }
+ size -= rval;
+ certstart += rval;
}
if (write(fd, "\n", 1) < 0) {
- perror("write");
- goto cleanup;
+ perror("write");
+ goto cleanup;
}
/* Write the key. */
if ((keystart = strstr((const char *)keybuf, BEGINKEY1)) == NULL
- && (keystart = strstr((const char *)keybuf, BEGINKEY2)) == NULL
- && (keystart = strstr((const char *)keybuf, BEGINKEY3)) == NULL) {
- fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor '%s'.\n", keyfile,
- BEGINKEY1, BEGINKEY2, BEGINKEY3);
- goto cleanup;
+ && (keystart = strstr((const char *)keybuf, BEGINKEY2)) == NULL
+ && (keystart = strstr((const char *)keybuf, BEGINKEY3)) == NULL) {
+ fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor '%s'.\n", keyfile,
+ BEGINKEY1, BEGINKEY2, BEGINKEY3);
+ goto cleanup;
}
if ((keyend = strstr((const char *)keystart, ENDKEY1)) != NULL)
- keyend += strlen(ENDKEY1);
+ keyend += strlen(ENDKEY1);
else if ((keyend = strstr((const char *)keystart, ENDKEY2)) != NULL)
- keyend += strlen(ENDKEY2);
+ keyend += strlen(ENDKEY2);
else if ((keyend = strstr((const char *)keystart, ENDKEY3)) != NULL)
- keyend += strlen(ENDKEY3);
+ keyend += strlen(ENDKEY3);
else {
- fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor '%s'.\n", keyfile,
- ENDKEY1, ENDKEY2, ENDKEY3);
- goto cleanup;
+ fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor '%s'.\n", keyfile,
+ ENDKEY1, ENDKEY2, ENDKEY3);
+ goto cleanup;
}
size = keyend-keystart;
while (size) {
- if ((rval = write(fd, keystart, size)) < 0) {
- perror("write");
- goto cleanup;
- }
- size -= rval;
- keystart += rval;
+ if ((rval = write(fd, keystart, size)) < 0) {
+ perror("write");
+ goto cleanup;
+ }
+ size -= rval;
+ keystart += rval;
}
if (write(fd, "\n", 1) < 0) {
- perror("write");
- goto cleanup;
+ perror("write");
+ goto cleanup;
}
/* Write any remaining certificates. */
while ((certstart = strstr((const char *)certstart, BEGINCERT)) != NULL) {
- if ((certend = strstr((const char *)certstart, ENDCERT)) == NULL) {
- fprintf(stderr, "Can't find matching '%s' in %s.\n", ENDCERT,
- certfile);
- goto cleanup;
- }
- certend += strlen(ENDCERT);
- size = certend-certstart;
-
- while (size) {
- if ((rval = write(fd, certstart, size)) < 0) {
- perror("write");
- goto cleanup;
- }
- size -= rval;
- certstart += rval;
- }
- if (write(fd, "\n", 1) < 0) {
- perror("write");
- goto cleanup;
- }
+ if ((certend = strstr((const char *)certstart, ENDCERT)) == NULL) {
+ fprintf(stderr, "Can't find matching '%s' in %s.\n", ENDCERT,
+ certfile);
+ goto cleanup;
+ }
+ certend += strlen(ENDCERT);
+ size = certend-certstart;
+
+ while (size) {
+ if ((rval = write(fd, certstart, size)) < 0) {
+ perror("write");
+ goto cleanup;
+ }
+ size -= rval;
+ certstart += rval;
+ }
+ if (write(fd, "\n", 1) < 0) {
+ perror("write");
+ goto cleanup;
+ }
}
return_value = 0;
diff --git a/myproxy/source/myproxy_get_credential.c b/myproxy/source/myproxy_get_credential.c
index 298856dbf2..b60efaf381 100644
--- a/myproxy/source/myproxy_get_credential.c
+++ b/myproxy/source/myproxy_get_credential.c
@@ -4,7 +4,7 @@
* Webserver program to retrieve a end-entity credential from a myproxy-server
*/
-#include "myproxy_common.h" /* all needed headers included here */
+#include "myproxy_common.h" /* all needed headers included here */
#ifndef MAXPATHLEN
#define MAXPATHLEN 4096
@@ -48,7 +48,7 @@ struct option long_options[] =
{"version", no_argument, NULL, 'V'},
{"authorization", required_argument, NULL, 'r'},
{"dn_as_username", no_argument, NULL, 'd'},
- {"credname", required_argument, NULL, 'k'},
+ {"credname", required_argument, NULL, 'k'},
{"stdin_pass", no_argument, NULL, 'S'},
{"no_passphrase", no_argument, NULL, 'n'},
{"certfile", required_argument, NULL, 'c'},
@@ -62,18 +62,18 @@ static char short_options[] = "hus:p:l:t:c:y:vVa:dk:SnT";
static char version[] =
"myproxy-retrieve version " MYPROXY_VERSION " (" MYPROXY_VERSION_DATE ") " "\n";
-void
-init_arguments(int argc, char *argv[],
- myproxy_socket_attrs_t *attrs,
- myproxy_request_t *request);
-
+void
+init_arguments(int argc, char *argv[],
+ myproxy_socket_attrs_t *attrs,
+ myproxy_request_t *request);
+
int
store_credential( char *delegfile,
char *certfile,
char *keyfile );
int
-buffer2file( char *buffer,
+buffer2file( const char *buffer,
int size,
int fd );
@@ -92,7 +92,7 @@ mkpath( char *path );
* Use setvbuf() instead of setlinebuf() since cygwin doesn't support
* setlinebuf().
*/
-#define my_setlinebuf(stream) setvbuf((stream), (char *) NULL, _IOLBF, 0)
+#define my_setlinebuf(stream) setvbuf((stream), (char *) NULL, _IOLBF, 0)
/* location of delegated proxy */
static char *certfile = NULL; /* certificate file name */
@@ -102,8 +102,8 @@ static int read_passwd_from_stdin = 0;
static int use_empty_passwd = 0;
int
-main(int argc, char *argv[])
-{
+main(int argc, char *argv[])
+{
myproxy_socket_attrs_t *socket_attrs;
myproxy_request_t *client_request;
myproxy_response_t *server_response;
@@ -116,10 +116,10 @@ main(int argc, char *argv[])
/* check library version */
if (myproxy_check_version()) {
- fprintf(stderr, "MyProxy library version mismatch.\n"
- "Expecting %s. Found %s.\n",
- MYPROXY_VERSION_DATE, myproxy_version(0,0,0));
- exit(1);
+ fprintf(stderr, "MyProxy library version mismatch.\n"
+ "Expecting %s. Found %s.\n",
+ MYPROXY_VERSION_DATE, myproxy_version(0,0,0));
+ exit(1);
}
myproxy_log_use_stream (stderr);
@@ -154,36 +154,36 @@ main(int argc, char *argv[])
}
if (getuid() == 0) {
- get_host_credential_filenames( &certfile, &keyfile );
+ get_host_credential_filenames( &certfile, &keyfile );
} else {
- get_user_credential_filenames( &certfile, &keyfile );
+ get_user_credential_filenames( &certfile, &keyfile );
}
/* Initialize client arguments and create client request object */
init_arguments(argc, argv, socket_attrs, client_request);
if (!certfile && !keyfile) {
- fprintf(stderr, "Unable to determine credential output locations.\n"
- "Use --certfile and --keyfile options.\n");
- goto error;
+ fprintf(stderr, "Unable to determine credential output locations.\n"
+ "Use --certfile and --keyfile options.\n");
+ goto error;
} else if (!certfile) {
- fprintf(stderr, "Unable to determine certificate output location.\n"
- "Use --certfile option.\n");
- goto error;
+ fprintf(stderr, "Unable to determine certificate output location.\n"
+ "Use --certfile option.\n");
+ goto error;
} else if (!keyfile) {
- fprintf(stderr, "Unable to determine private key output location.\n"
- "Use --keyfile option.\n");
- goto error;
+ fprintf(stderr, "Unable to determine private key output location.\n"
+ "Use --keyfile option.\n");
+ goto error;
}
if (access(certfile, F_OK) == 0) {
- fprintf(stderr, "%s exists.\n", certfile);
- goto error;
+ fprintf(stderr, "%s exists.\n", certfile);
+ goto error;
}
if (access(keyfile, F_OK) == 0) {
- fprintf(stderr, "%s exists.\n", keyfile);
- goto error;
+ fprintf(stderr, "%s exists.\n", keyfile);
+ goto error;
}
/* Bootstrap trusted certificate directory if none exists. */
@@ -205,7 +205,7 @@ main(int argc, char *argv[])
verror_print_error(stderr);
goto error;
}
-
+
/* Attempt anonymous-mode credential retrieval if we don't have a
credential. */
GSI_SOCKET_allow_anonymous(socket_attrs->gsi_socket, 1);
@@ -239,60 +239,60 @@ main(int argc, char *argv[])
if (!use_empty_passwd) {
/* Allow user to provide a passphrase */
- int rval;
- if (read_passwd_from_stdin) {
- rval = myproxy_read_passphrase_stdin(
- client_request->passphrase,
- sizeof(client_request->passphrase),
- NULL);
- } else {
- rval = myproxy_read_passphrase(client_request->passphrase,
- sizeof(client_request->passphrase),
- NULL);
- }
- if (rval == -1) {
- verror_print_error(stderr);
+ int rval;
+ if (read_passwd_from_stdin) {
+ rval = myproxy_read_passphrase_stdin(
+ client_request->passphrase,
+ sizeof(client_request->passphrase),
+ NULL);
+ } else {
+ rval = myproxy_read_passphrase(client_request->passphrase,
+ sizeof(client_request->passphrase),
+ NULL);
+ }
+ if (rval == -1) {
+ verror_print_error(stderr);
goto error;
- }
+ }
}
if (client_request->username == NULL) { /* set default username */
- if (dn_as_username) {
- if (client_request->authzcreds) {
- if (ssl_get_base_subject_file(client_request->authzcreds,
- &client_request->username)) {
- fprintf(stderr, "Cannot get subject name from %s\n",
- client_request->authzcreds);
+ if (dn_as_username) {
+ if (client_request->authzcreds) {
+ if (ssl_get_base_subject_file(client_request->authzcreds,
+ &client_request->username)) {
+ fprintf(stderr, "Cannot get subject name from %s\n",
+ client_request->authzcreds);
goto error;
- }
- } else {
- if (ssl_get_base_subject_file(NULL,
- &client_request->username)) {
- fprintf(stderr,
- "Cannot get subject name from your certificate\n");
+ }
+ } else {
+ if (ssl_get_base_subject_file(NULL,
+ &client_request->username)) {
+ fprintf(stderr,
+ "Cannot get subject name from your certificate\n");
goto error;
- }
- }
- } else {
- char *username = NULL;
- if (!(username = getenv("LOGNAME"))) {
- fprintf(stderr, "Please specify a username.\n");
+ }
+ }
+ } else {
+ char *username = NULL;
+ if (!(username = getenv("LOGNAME"))) {
+ fprintf(stderr, "Please specify a username.\n");
goto error;
- }
- client_request->username = strdup(username);
- }
+ }
+ client_request->username = strdup(username);
+ }
}
/* Serialize client request object */
requestlen = myproxy_serialize_request_ex(client_request, &request_buffer);
if (requestlen < 0) {
- verror_print_error(stderr);
+ verror_print_error(stderr);
goto error;
}
/* Send request to the myproxy-server */
if (myproxy_send(socket_attrs, request_buffer, requestlen) < 0) {
- verror_print_error(stderr);
+ verror_print_error(stderr);
goto error;
}
free(request_buffer);
@@ -308,8 +308,8 @@ main(int argc, char *argv[])
/* Accept delegated credentials from server */
deletefile = 1;
if (myproxy_accept_credentials(socket_attrs, delegfile,
- sizeof(delegfile)) < 0) {
- verror_print_error(stderr);
+ sizeof(delegfile)) < 0) {
+ verror_print_error(stderr);
goto error;
}
@@ -338,22 +338,22 @@ main(int argc, char *argv[])
/* Store file in trusted directory if requested and returned */
if (client_request->want_trusted_certs) {
if (server_response->trusted_certs != NULL) {
- if (myproxy_install_trusted_cert_files(server_response->trusted_certs) != 0) {
- verror_print_error(stderr);
- goto error;
+ if (myproxy_install_trusted_cert_files(server_response->trusted_certs) != 0) {
+ verror_print_error(stderr);
+ goto error;
} else {
- char *path;
- path = get_trusted_certs_path();
+ char *path;
+ path = get_trusted_certs_path();
if (path) {
printf("Trust roots have been installed in %s.\n", path);
free(path);
}
- }
+ }
} else {
myproxy_debug("Requested trusted certs but didn't get any.\n");
}
}
-
+
retval = 0;
error:
@@ -372,89 +372,89 @@ main(int argc, char *argv[])
return retval;
}
-void
-init_arguments(int argc,
- char *argv[],
- myproxy_socket_attrs_t *attrs,
- myproxy_request_t *request)
-{
+void
+init_arguments(int argc,
+ char *argv[],
+ myproxy_socket_attrs_t *attrs,
+ myproxy_request_t *request)
+{
extern char *optarg;
int arg;
- while((arg = getopt_long(argc, argv, short_options,
- long_options, NULL)) != EOF)
+ while((arg = getopt_long(argc, argv, short_options,
+ long_options, NULL)) != EOF)
{
- switch(arg)
+ switch(arg)
{
- case 's': /* pshost name */
- attrs->pshost = strdup(optarg);
+ case 's': /* pshost name */
+ attrs->pshost = strdup(optarg);
break;
- case 'p': /* psport */
+ case 'p': /* psport */
attrs->psport = atoi(optarg);
break;
- case 'h': /* print help and exit */
- case 'u': /* print help and exit */
+ case 'h': /* print help and exit */
+ case 'u': /* print help and exit */
printf("%s", usage);
exit(0);
break;
- case 'l': /* username */
+ case 'l': /* username */
request->username = strdup(optarg);
break;
- case 'a': /* special authorization */
- request->authzcreds = strdup(optarg);
- use_empty_passwd = 1;
- break;
- case 'n': /* no passphrase */
- use_empty_passwd = 1;
- break;
- case 'v':
- myproxy_debug_set_level(1);
- break;
+ case 'a': /* special authorization */
+ request->authzcreds = strdup(optarg);
+ use_empty_passwd = 1;
+ break;
+ case 'n': /* no passphrase */
+ use_empty_passwd = 1;
+ break;
+ case 'v':
+ myproxy_debug_set_level(1);
+ break;
case 'V': /* print version and exit */
printf("%s", version);
exit(0);
break;
- case 'd': /* use the certificate subject (DN) as the default
- username instead of LOGNAME */
- dn_as_username = 1;
- break;
- case 'k': /* credential name */
- request->credname = strdup (optarg);
- break;
- case 'S':
- read_passwd_from_stdin = 1;
- break;
- case 'T':
- request->want_trusted_certs = 1;
+ case 'd': /* use the certificate subject (DN) as the default
+ username instead of LOGNAME */
+ dn_as_username = 1;
+ break;
+ case 'k': /* credential name */
+ request->credname = strdup (optarg);
+ break;
+ case 'S':
+ read_passwd_from_stdin = 1;
+ break;
+ case 'T':
+ request->want_trusted_certs = 1;
myproxy_debug("Requesting trusted certificates.\n");
- break;
+ break;
case 'c': /* credential file name */
- if (certfile) free(certfile);
+ if (certfile) free(certfile);
certfile = strdup(optarg);
break;
case 'y': /* key file name */
- if (keyfile) free(keyfile);
+ if (keyfile) free(keyfile);
keyfile = strdup(optarg);
break;
- default: /* print usage and exit */
+ default: /* print usage and exit */
fprintf(stderr, "%s", usage);
- exit(1);
- break;
+ exit(1);
+ break;
}
}
/* Check to see if myproxy-server specified */
if (attrs->pshost == NULL) {
- fprintf(stderr, "Unspecified myproxy-server. Set the MYPROXY_SERVER environment variable to\nthe hostname of the myproxy-server or run with '-s server-hostname'.\n");
- exit(1);
+ fprintf(stderr, "Unspecified myproxy-server. Set the MYPROXY_SERVER environment variable to\nthe hostname of the myproxy-server or run with '-s server-hostname'.\n");
+ exit(1);
}
return;
}
int
-store_credential( char *delegfile,
- char *certfile,
+store_credential( char *delegfile,
+ char *certfile,
char *keyfile )
{
unsigned char *input_buffer = NULL;
@@ -488,13 +488,13 @@ store_credential( char *delegfile,
}
int
-write_cert( char *path,
+write_cert( char *path,
const char *buffer )
{
int fd = 0;
static char BEGINCERT[] = "-----BEGIN CERTIFICATE-----";
static char ENDCERT[] = "-----END CERTIFICATE-----";
- char *certstart,
+ const char *certstart,
*certend;
int retval = -1;
int size;
@@ -570,7 +570,7 @@ write_cert( char *path,
}
int
-write_key( char *path,
+write_key( char *path,
const char *buffer )
{
int fd = 0;
@@ -580,7 +580,7 @@ write_key( char *path,
static char ENDKEY1[] = "-----END RSA PRIVATE KEY-----";
static char ENDKEY2[] = "-----END PRIVATE KEY-----";
static char ENDKEY3[] = "-----END ENCRYPTED PRIVATE KEY-----";
- char *keystart,
+ const char *keystart,
*keyend;
int retval = -1;
int size;
@@ -607,24 +607,24 @@ write_key( char *path,
/* Write the key. */
if ((keystart = strstr(buffer, BEGINKEY1)) == NULL
- && (keystart = strstr(buffer, BEGINKEY2)) == NULL
- && (keystart = strstr(buffer, BEGINKEY3)) == NULL)
+ && (keystart = strstr(buffer, BEGINKEY2)) == NULL
+ && (keystart = strstr(buffer, BEGINKEY3)) == NULL)
{
fprintf(stderr, "CREDKEY doesn't contain '%s' nor '%s' nor '%s'.\n",
- BEGINKEY1, BEGINKEY2, BEGINKEY3);
+ BEGINKEY1, BEGINKEY2, BEGINKEY3);
goto error;
}
if ((keyend = strstr(keystart, ENDKEY1)) != NULL)
- keyend += strlen(ENDKEY1);
+ keyend += strlen(ENDKEY1);
else if ((keyend = strstr(keystart, ENDKEY2)) != NULL)
- keyend += strlen(ENDKEY2);
+ keyend += strlen(ENDKEY2);
else if ((keyend = strstr(keystart, ENDKEY3)) != NULL)
- keyend += strlen(ENDKEY3);
+ keyend += strlen(ENDKEY3);
else
{
fprintf(stderr, "CREDKEY doesn't contain '%s' nor '%s' nor '%s'.\n",
- ENDKEY1, ENDKEY2, ENDKEY3);
+ ENDKEY1, ENDKEY2, ENDKEY3);
goto error;
}
@@ -648,12 +648,12 @@ write_key( char *path,
}
int
-buffer2file( char *buffer,
+buffer2file( const char *buffer,
int size,
int fd )
{
int rval;
- char *certstart;
+ const char *certstart;
certstart = buffer;
diff --git a/myproxy/source/myproxy_ocsp.c b/myproxy/source/myproxy_ocsp.c
index cd584a3f3d..1cde641c74 100644
--- a/myproxy/source/myproxy_ocsp.c
+++ b/myproxy/source/myproxy_ocsp.c
@@ -4,19 +4,19 @@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
- * met:
+ * met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* 3. Neither the names of the authors nor the names of the
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -86,7 +86,7 @@ myproxy_ocsp_set_responder_cert(const char *path) {
int count;
int rval = -1;
- sk_X509_pop_free(responder_cert, X509_free);
+ sk_X509_pop_free(responder_cert, X509_free);
responder_cert = NULL;
in = BIO_new(BIO_s_file());
@@ -164,11 +164,15 @@ static int
verify_cert_hostname(X509 *cert, char *hostname) {
int extcount, i, j, ok = 0;
char name[256];
- X509_NAME *subj;
+ const X509_NAME *subj;
const char *extstr;
CONF_VALUE *nval;
const unsigned char *data;
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
X509_EXTENSION *ext;
+#else
+ const X509_EXTENSION *ext;
+#endif
X509V3_EXT_METHOD *meth;
STACK_OF(CONF_VALUE) *val;
@@ -178,9 +182,9 @@ verify_cert_hostname(X509 *cert, char *hostname) {
extstr = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));
if (!strcasecmp(extstr, "subjectAltName")) {
if (!(meth = (X509V3_EXT_METHOD *)X509V3_EXT_get(ext))) break;
- data = X509_EXTENSION_get_data(ext)->data;
+ data = ASN1_STRING_get0_data(X509_EXTENSION_get_data(ext));
- val = meth->i2v(meth, meth->d2i(0, &data, X509_EXTENSION_get_data(ext)->length), 0);
+ val = meth->i2v(meth, meth->d2i(0, &data, ASN1_STRING_length(X509_EXTENSION_get_data(ext))), 0);
for (j = 0; j < sk_CONF_VALUE_num(val); j++) {
nval = sk_CONF_VALUE_value(val, j);
if (!strcasecmp(nval->name, "DNS") && !strcasecmp(nval->value, hostname)) {
@@ -365,7 +369,7 @@ int myproxy_ocsp_verify(X509 *cert, X509 *issuer) {
if (!responder_cert ||
(rc = OCSP_basic_verify(basic, responder_cert, store,
OCSP_TRUSTOTHER)) <= 0)
- if ((rc = OCSP_basic_verify(basic, NULL, store, 0)) <= 0)
+ if ((rc = OCSP_basic_verify(basic, NULL, store, 0)) <= 0)
goto end;
if (!OCSP_resp_find_status(basic, id, &status, &reason, &producedAt,
diff --git a/myproxy/source/myproxy_ocsp_aia.c b/myproxy/source/myproxy_ocsp_aia.c
index 91ee306b19..4a62465f54 100644
--- a/myproxy/source/myproxy_ocsp_aia.c
+++ b/myproxy/source/myproxy_ocsp_aia.c
@@ -35,79 +35,95 @@
#include
#include
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
static AUTHORITY_INFO_ACCESS *
-my_aia_get(X509_EXTENSION *ext) {
- const X509V3_EXT_METHOD *method = NULL;
- void *ext_str = NULL;
- const unsigned char *p;
- int len;
-
- if (ext == NULL) {
- verror_put_string("my_aia_get: ext is NULL");
- return(NULL);
- }
-
- method = X509V3_EXT_get(ext);
- if (method == NULL) {
- myproxy_debug("my_aia_get: cannot get method");
- return(NULL);
- }
-
- p = X509_EXTENSION_get_data(ext)->data;
- len = X509_EXTENSION_get_data(ext)->length;
- if (method->it) {
- ext_str = ASN1_item_d2i(NULL, &p, len, ASN1_ITEM_ptr(method->it));
- } else {
- ext_str = method->d2i(NULL, &p, len);
- }
- if (ext_str == NULL) {
- myproxy_debug("my_aia_get: null ext_str!");
- return(NULL);
- }
-
- return((AUTHORITY_INFO_ACCESS*)ext_str);
+my_aia_get(X509_EXTENSION *ext)
+#else
+static AUTHORITY_INFO_ACCESS *
+my_aia_get(const X509_EXTENSION *ext)
+#endif
+{
+ const X509V3_EXT_METHOD *method = NULL;
+ void *ext_str = NULL;
+ const unsigned char *p;
+ int len;
+
+ if (ext == NULL) {
+ verror_put_string("my_aia_get: ext is NULL");
+ return(NULL);
+ }
+
+ method = X509V3_EXT_get(ext);
+ if (method == NULL) {
+ myproxy_debug("my_aia_get: cannot get method");
+ return(NULL);
+ }
+
+ p = ASN1_STRING_get0_data(X509_EXTENSION_get_data(ext));
+ len = ASN1_STRING_length(X509_EXTENSION_get_data(ext));
+ if (method->it) {
+ ext_str = ASN1_item_d2i(NULL, &p, len, ASN1_ITEM_ptr(method->it));
+ } else {
+ ext_str = method->d2i(NULL, &p, len);
+ }
+ if (ext_str == NULL) {
+ myproxy_debug("my_aia_get: null ext_str!");
+ return(NULL);
+ }
+
+ return((AUTHORITY_INFO_ACCESS*)ext_str);
}
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
static void
-my_aia_free(X509_EXTENSION *ext, AUTHORITY_INFO_ACCESS* aia) {
- const X509V3_EXT_METHOD *method = NULL;
-
- if (ext == NULL) {
- verror_put_string("my_aia_free: ext is NULL");
- return;
- }
-
- method = X509V3_EXT_get(ext);
- if (method == NULL) return;
-
- if (method->it) {
- ASN1_item_free((void*)aia, ASN1_ITEM_ptr(method->it));
- } else {
- method->ext_free(aia);
- }
+my_aia_free(X509_EXTENSION *ext, AUTHORITY_INFO_ACCESS* aia)
+#else
+static void
+my_aia_free(const X509_EXTENSION *ext, AUTHORITY_INFO_ACCESS* aia)
+#endif
+{
+ const X509V3_EXT_METHOD *method = NULL;
+
+ if (ext == NULL) {
+ verror_put_string("my_aia_free: ext is NULL");
+ return;
+ }
+
+ method = X509V3_EXT_get(ext);
+ if (method == NULL) return;
+
+ if (method->it) {
+ ASN1_item_free((void*)aia, ASN1_ITEM_ptr(method->it));
+ } else {
+ method->ext_free(aia);
+ }
}
char *
myproxy_get_aia_ocsp_uri(X509 *cert)
{
- int loc = -1;
+ int loc = -1;
char *uri = NULL;
- if (cert == NULL) return(0);
+ if (cert == NULL) return(0);
- for (loc = X509_get_ext_by_NID(cert, NID_info_access, loc);
+ for (loc = X509_get_ext_by_NID(cert, NID_info_access, loc);
loc >= 0;
loc = X509_get_ext_by_NID(cert, NID_info_access, loc)) {
- X509_EXTENSION *xe;
- AUTHORITY_INFO_ACCESS *aia;
+#if OPENSSL_VERSION_NUMBER < 0x40000000L
+ X509_EXTENSION *xe;
+#else
+ const X509_EXTENSION *xe;
+#endif
+ AUTHORITY_INFO_ACCESS *aia;
int k;
- xe = X509_get_ext(cert, loc);
- if (xe == NULL) {
- myproxy_debug("get_aia_ocsp_uri: cannot get x509 extension");
- continue;
- }
+ xe = X509_get_ext(cert, loc);
+ if (xe == NULL) {
+ myproxy_debug("get_aia_ocsp_uri: cannot get x509 extension");
+ continue;
+ }
aia = my_aia_get(xe);
if (aia == NULL) continue;
@@ -123,14 +139,14 @@ myproxy_get_aia_ocsp_uri(X509 *cert)
if (gn->type != GEN_URI) continue;
asn1_uri = gn->d.uniformResourceIdentifier;
- uri = strdup((const char*)asn1_uri->data);
+ uri = strdup((const char*)ASN1_STRING_get0_data(asn1_uri));
break;
}
my_aia_free(xe, aia);
- if (uri) break;
- }
+ if (uri) break;
+ }
return uri;
}
diff --git a/myproxy/source/myproxy_store.c b/myproxy/source/myproxy_store.c
index 19d02e2f56..1efd8ce7ce 100644
--- a/myproxy/source/myproxy_store.c
+++ b/myproxy/source/myproxy_store.c
@@ -4,7 +4,7 @@
* Client program to store a end-entity credential to a myproxy-server
*/
-#include "myproxy_common.h" /* all needed headers included here */
+#include "myproxy_common.h" /* all needed headers included here */
/* Location of default proxy */
#define MYPROXY_DEFAULT_USERCERT "usercert.pem"
@@ -85,27 +85,27 @@ static char version[] =
"myproxy-store version " MYPROXY_VERSION " (" MYPROXY_VERSION_DATE ") "
"\n";
-static char *certfile = NULL; /* certificate file name */
-static char *keyfile = NULL; /* key file name */
+static char *certfile = NULL; /* certificate file name */
+static char *keyfile = NULL; /* key file name */
static int dn_as_username = 0;
static int verbose = 0;
/* Function declarations */
-int
+int
init_arguments( int argc,
- char *argv[],
- myproxy_socket_attrs_t *attrs,
+ char *argv[],
+ myproxy_socket_attrs_t *attrs,
myproxy_request_t *request);
-int
+int
makecertfile( const char certfile[],
- const char keyfile[],
+ const char keyfile[],
char **credbuf);
-#define SECONDS_PER_HOUR (60 * 60)
+#define SECONDS_PER_HOUR (60 * 60)
-int
-main(int argc,
+int
+main(int argc,
char *argv[])
{
char *pshost = NULL;
@@ -120,10 +120,10 @@ main(int argc,
/* check library version */
if (myproxy_check_version()) {
- fprintf(stderr, "MyProxy library version mismatch.\n"
- "Expecting %s. Found %s.\n",
- MYPROXY_VERSION_DATE, myproxy_version(0,0,0));
- exit(1);
+ fprintf(stderr, "MyProxy library version mismatch.\n"
+ "Expecting %s. Found %s.\n",
+ MYPROXY_VERSION_DATE, myproxy_version(0,0,0));
+ exit(1);
}
myproxy_log_use_stream(stderr);
@@ -145,18 +145,18 @@ main(int argc,
pshost = getenv("MYPROXY_SERVER");
if (pshost != NULL) {
- socket_attrs->pshost = strdup(pshost);
+ socket_attrs->pshost = strdup(pshost);
}
if (getenv("MYPROXY_SERVER_PORT")) {
- socket_attrs->psport = atoi(getenv("MYPROXY_SERVER_PORT"));
+ socket_attrs->psport = atoi(getenv("MYPROXY_SERVER_PORT"));
} else {
- socket_attrs->psport = MYPROXY_SERVER_PORT;
+ socket_attrs->psport = MYPROXY_SERVER_PORT;
}
globus_module_activate(GLOBUS_GSI_SYSCONFIG_MODULE);
GLOBUS_GSI_SYSCONFIG_GET_USER_CERT_FILENAME( &certfile,
- &keyfile );
+ &keyfile );
client_request->proxy_lifetime = SECONDS_PER_HOUR *
MYPROXY_DEFAULT_DELEG_HOURS;
@@ -168,17 +168,17 @@ main(int argc,
}
if (!certfile && !keyfile) {
- fprintf(stderr, "Credentials not found in default location.\n"
- "Use --certfile and --keyfile options.\n");
- goto cleanup;
+ fprintf(stderr, "Credentials not found in default location.\n"
+ "Use --certfile and --keyfile options.\n");
+ goto cleanup;
} else if (!certfile) {
- fprintf(stderr, "Certificate not found in default location.\n"
- "Use --certfile option.\n");
- goto cleanup;
+ fprintf(stderr, "Certificate not found in default location.\n"
+ "Use --certfile option.\n");
+ goto cleanup;
} else if (!keyfile) {
- fprintf(stderr, "Private key not found in default location.\n"
- "Use --keyfile option.\n");
- goto cleanup;
+ fprintf(stderr, "Private key not found in default location.\n"
+ "Use --keyfile option.\n");
+ goto cleanup;
}
/*
@@ -192,7 +192,7 @@ main(int argc,
/* Set up client socket attributes */
if (myproxy_init_client(socket_attrs) < 0) {
- verror_print_error(stderr);
+ verror_print_error(stderr);
goto cleanup;
}
@@ -217,7 +217,7 @@ main(int argc,
/* Authenticate client to server */
if (myproxy_authenticate_init(socket_attrs, NULL) < 0) {
- verror_print_error(stderr);
+ verror_print_error(stderr);
goto cleanup;
}
@@ -239,14 +239,14 @@ main(int argc,
/* Continue unless the response is not OK */
if (myproxy_recv_response_ex(socket_attrs,
- server_response, client_request) != 0) {
+ server_response, client_request) != 0) {
verror_print_error(stderr);
goto cleanup;
}
/* Send end-entity credentials to server. */
if (myproxy_init_credentials(socket_attrs,
- credkeybuf) < 0) {
+ credkeybuf) < 0) {
verror_print_error(stderr);
goto cleanup;
}
@@ -273,93 +273,93 @@ main(int argc,
int
init_arguments(int argc,
- char *argv[],
- myproxy_socket_attrs_t *attrs,
+ char *argv[],
+ myproxy_socket_attrs_t *attrs,
myproxy_request_t * request)
{
extern char *optarg;
- int expr_type = MATCH_CN_ONLY; /*default */
+ int expr_type = MATCH_CN_ONLY; /*default */
int arg;
while ((arg = getopt_long(argc,
- argv,
- short_options,
- long_options, NULL)) != EOF) {
- switch (arg) {
- case 's': /* pshost name */
- attrs->pshost = strdup(optarg);
- break;
-
- case 'p': /* psport */
- attrs->psport = atoi(optarg);
- break;
-
- case 'c': /* credential file name */
- if (certfile) free(certfile);
- certfile = strdup(optarg);
- break;
-
- case 'y': /* key file name */
- if (keyfile) free(keyfile);
- keyfile = strdup(optarg);
- break;
-
- case 'u': /* print help and exit */
- printf("%s", usage);
- exit(0);
- break;
-
- case 't': /* Specify proxy lifetime in hours */
- request->proxy_lifetime = SECONDS_PER_HOUR * atoi(optarg);
+ argv,
+ short_options,
+ long_options, NULL)) != EOF) {
+ switch (arg) {
+ case 's': /* pshost name */
+ attrs->pshost = strdup(optarg);
+ break;
+
+ case 'p': /* psport */
+ attrs->psport = atoi(optarg);
+ break;
+
+ case 'c': /* credential file name */
+ if (certfile) free(certfile);
+ certfile = strdup(optarg);
+ break;
+
+ case 'y': /* key file name */
+ if (keyfile) free(keyfile);
+ keyfile = strdup(optarg);
+ break;
+
+ case 'u': /* print help and exit */
+ printf("%s", usage);
+ exit(0);
+ break;
+
+ case 't': /* Specify proxy lifetime in hours */
+ request->proxy_lifetime = SECONDS_PER_HOUR * atoi(optarg);
if (request->proxy_lifetime < 0) {
fprintf(stderr, "Requested lifetime (-t option) out of bounds.\n");
exit(1);
}
- break;
+ break;
+
+ case 'h': /* print help and exit */
+ printf("%s", usage);
+ exit(0);
+ break;
- case 'h': /* print help and exit */
- printf("%s", usage);
- exit(0);
- break;
+ case 'l': /* username */
+ request->username = strdup(optarg);
+ break;
- case 'l': /* username */
- request->username = strdup(optarg);
- break;
+ case 'v': /* verbose */
+ myproxy_debug_set_level(1);
+ verbose = 1;
+ break;
- case 'v': /* verbose */
- myproxy_debug_set_level(1);
- verbose = 1;
- break;
+ case 'V': /* print version and exit */
+ printf("%s", version);
+ exit(0);
+ break;
- case 'V': /* print version and exit */
- printf("%s", version);
- exit(0);
- break;
+ case 'r': /* retrievers list */
+ if (request->retrievers) {
+ fprintf(stderr,
+ "Only one -a or -r option may be specified.\n");
+ exit(1);
+ }
- case 'r': /* retrievers list */
- if (request->retrievers) {
- fprintf(stderr,
- "Only one -a or -r option may be specified.\n");
- exit(1);
- }
+ if (expr_type == REGULAR_EXP) {
- if (expr_type == REGULAR_EXP) {
-
/* Copy as is */
- request->retrievers = strdup(optarg);
- } else {
- request->retrievers =
- (char *) malloc(strlen(optarg) + 6);
- strcpy(request->retrievers, "*/CN=");
- myproxy_debug("authorized retriever %s",
- request->retrievers);
- request->retrievers =
- strcat(request->retrievers, optarg);
- }
- break;
-
- case 'R': /* renewers list */
+ request->retrievers = strdup(optarg);
+ } else {
+ request->retrievers =
+ (char *) malloc(strlen(optarg) + 6);
+ strcpy(request->retrievers, "*/CN=");
+ myproxy_debug("authorized retriever %s",
+ request->retrievers);
+ request->retrievers =
+ strcat(request->retrievers, optarg);
+ }
+ break;
+
+ case 'R': /* renewers list */
/*
** This needs to be readdressed. Right now, the private key is
** being stored encrypted. This is a problem if the user calls
@@ -368,127 +368,127 @@ init_arguments(int argc,
** So, do we want to add code to unencrypt the private key if
** this option is used?
*/
- if (request->renewers) {
- fprintf(stderr,
- "Only one -A or -R option may be specified.\n");
- exit(1);
- }
-
- if (expr_type == REGULAR_EXP) {
- /* Copy as is */
- request->renewers = strdup(optarg);
- } else {
- request->renewers =
- (char *) malloc(strlen(optarg) + 6);
- strcpy(request->renewers, "*/CN=");
- myproxy_debug("authorized renewer %s", request->renewers);
- request->renewers = strcat(request->renewers, optarg);
- }
- break;
-
- case 'Z': /* retrievers list */
- if (request->trusted_retrievers) {
- fprintf(stderr,
- "Only one -Z option may be specified.\n");
- exit(1);
- }
-
- if (expr_type == REGULAR_EXP) {
-
+ if (request->renewers) {
+ fprintf(stderr,
+ "Only one -A or -R option may be specified.\n");
+ exit(1);
+ }
+
+ if (expr_type == REGULAR_EXP) {
/* Copy as is */
- request->trusted_retrievers = strdup(optarg);
- } else {
- request->trusted_retrievers =
- (char *) malloc(strlen(optarg) + 6);
- strcpy(request->trusted_retrievers, "*/CN=");
- myproxy_debug("trusted retriever %s",
- request->trusted_retrievers);
- request->trusted_retrievers =
- strcat(request->trusted_retrievers, optarg);
- }
- break;
-
- case 'E' : /* key retriever list */
- if (expr_type == REGULAR_EXP) {
- /* Copy as is */
- request->keyretrieve = strdup(optarg);
- } else {
- request->keyretrieve =
- (char *) malloc(strlen(optarg) + 6);
- strcpy(request->keyretrieve, "*/CN=");
- myproxy_debug("authorized key retriever %s",
- request->keyretrieve);
- request->keyretrieve =
- strcat(request->keyretrieve, optarg);
- }
- break;
-
- case 'd': /*
- ** use the certificate subject (DN) as the
- ** default username instead of LOGNAME
- */
- dn_as_username = 1;
- break;
-
- case 'x': /*set expression type to regex */
- expr_type = REGULAR_EXP;
- myproxy_debug("expr-type = regex");
- break;
-
- case 'X': /*set expression type to common name */
- expr_type = MATCH_CN_ONLY;
- myproxy_debug("expr-type = CN");
- break;
-
- case 'a': /*allow anonymous retrievers */
- if (request->retrievers) {
- fprintf(stderr,
- "Only one -a or -r option may be specified.\n");
- exit(1);
- }
-
- request->retrievers = strdup("*");
- myproxy_debug("anonymous retrievers allowed");
- break;
-
- case 'A': /*allow anonymous renewers */
- if (request->renewers) {
- fprintf(stderr,
- "Only one -A or -R option may be specified.\n");
- exit(1);
- }
-
- request->renewers = strdup("*");
- myproxy_debug("anonymous renewers allowed");
- break;
-
- case 'k': /*credential name */
- request->credname = strdup(optarg);
- break;
-
- case 'K': /*credential description */
- request->creddesc = strdup(optarg);
- break;
-
- default: /* print usage and exit */
- fprintf(stderr, "%s", usage);
- exit(1);
- break;
- }
+ request->renewers = strdup(optarg);
+ } else {
+ request->renewers =
+ (char *) malloc(strlen(optarg) + 6);
+ strcpy(request->renewers, "*/CN=");
+ myproxy_debug("authorized renewer %s", request->renewers);
+ request->renewers = strcat(request->renewers, optarg);
+ }
+ break;
+
+ case 'Z': /* retrievers list */
+ if (request->trusted_retrievers) {
+ fprintf(stderr,
+ "Only one -Z option may be specified.\n");
+ exit(1);
+ }
+
+ if (expr_type == REGULAR_EXP) {
+
+ /* Copy as is */
+ request->trusted_retrievers = strdup(optarg);
+ } else {
+ request->trusted_retrievers =
+ (char *) malloc(strlen(optarg) + 6);
+ strcpy(request->trusted_retrievers, "*/CN=");
+ myproxy_debug("trusted retriever %s",
+ request->trusted_retrievers);
+ request->trusted_retrievers =
+ strcat(request->trusted_retrievers, optarg);
+ }
+ break;
+
+ case 'E' : /* key retriever list */
+ if (expr_type == REGULAR_EXP) {
+ /* Copy as is */
+ request->keyretrieve = strdup(optarg);
+ } else {
+ request->keyretrieve =
+ (char *) malloc(strlen(optarg) + 6);
+ strcpy(request->keyretrieve, "*/CN=");
+ myproxy_debug("authorized key retriever %s",
+ request->keyretrieve);
+ request->keyretrieve =
+ strcat(request->keyretrieve, optarg);
+ }
+ break;
+
+ case 'd': /*
+ ** use the certificate subject (DN) as the
+ ** default username instead of LOGNAME
+ */
+ dn_as_username = 1;
+ break;
+
+ case 'x': /*set expression type to regex */
+ expr_type = REGULAR_EXP;
+ myproxy_debug("expr-type = regex");
+ break;
+
+ case 'X': /*set expression type to common name */
+ expr_type = MATCH_CN_ONLY;
+ myproxy_debug("expr-type = CN");
+ break;
+
+ case 'a': /*allow anonymous retrievers */
+ if (request->retrievers) {
+ fprintf(stderr,
+ "Only one -a or -r option may be specified.\n");
+ exit(1);
+ }
+
+ request->retrievers = strdup("*");
+ myproxy_debug("anonymous retrievers allowed");
+ break;
+
+ case 'A': /*allow anonymous renewers */
+ if (request->renewers) {
+ fprintf(stderr,
+ "Only one -A or -R option may be specified.\n");
+ exit(1);
+ }
+
+ request->renewers = strdup("*");
+ myproxy_debug("anonymous renewers allowed");
+ break;
+
+ case 'k': /*credential name */
+ request->credname = strdup(optarg);
+ break;
+
+ case 'K': /*credential description */
+ request->creddesc = strdup(optarg);
+ break;
+
+ default: /* print usage and exit */
+ fprintf(stderr, "%s", usage);
+ exit(1);
+ break;
+ }
}
/* Check to see if myproxy-server specified */
if (attrs->pshost == NULL) {
fprintf(stderr, "%s", usage);
- fprintf(stderr,
- "Unspecified myproxy-server! Either set the MYPROXY_SERVER environment variable or explicitly set the myproxy-server via the -s flag\n");
- return -1;
+ fprintf(stderr,
+ "Unspecified myproxy-server! Either set the MYPROXY_SERVER environment variable or explicitly set the myproxy-server via the -s flag\n");
+ return -1;
}
return 0;
}
-int
+int
makecertfile(const char certfile[],
const char keyfile[],
char **credbuf)
@@ -506,11 +506,11 @@ makecertfile(const char certfile[],
static char ENDKEY1[] = "-----END RSA PRIVATE KEY-----";
static char ENDKEY2[] = "-----END PRIVATE KEY-----";
static char ENDKEY3[] = "-----END ENCRYPTED PRIVATE KEY-----";
- char *certstart;
- char *certend;
+ const char *certstart;
+ const char *certend;
int size;
- char *keystart;
- char *keyend;
+ const char *keystart;
+ const char *keyend;
/* Figure out how much memory we are going to need */
@@ -530,8 +530,8 @@ makecertfile(const char certfile[],
/* Read the certificate(s) into a buffer. */
if (buffer_from_file(certfile, &certbuf, NULL) < 0) {
- fprintf(stderr, "Failed to read %s\n", certfile);
- goto cleanup;
+ fprintf(stderr, "Failed to read %s\n", certfile);
+ goto cleanup;
}
/* Read the key into a buffer. */
@@ -554,29 +554,29 @@ makecertfile(const char certfile[],
certend += strlen(ENDCERT);
size = certend-certstart;
- strncat( *credbuf, certstart, size );
+ strncat( *credbuf, certstart, size );
strcat( *credbuf, "\n" );
certstart += size;
/* Write the key. */
if ((keystart = strstr((const char *)keybuf, BEGINKEY1)) == NULL
- && (keystart = strstr((const char *)keybuf, BEGINKEY2)) == NULL
- && (keystart = strstr((const char *)keybuf, BEGINKEY3)) == NULL) {
- fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor %s.\n", keyfile,
- BEGINKEY1, BEGINKEY2, BEGINKEY3);
- goto cleanup;
+ && (keystart = strstr((const char *)keybuf, BEGINKEY2)) == NULL
+ && (keystart = strstr((const char *)keybuf, BEGINKEY3)) == NULL) {
+ fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor %s.\n", keyfile,
+ BEGINKEY1, BEGINKEY2, BEGINKEY3);
+ goto cleanup;
}
if ((keyend = strstr(keystart, ENDKEY1)) != NULL)
- keyend += strlen(ENDKEY1);
+ keyend += strlen(ENDKEY1);
else if ((keyend = strstr(keystart, ENDKEY2)) != NULL)
- keyend += strlen(ENDKEY2);
+ keyend += strlen(ENDKEY2);
else if ((keyend = strstr(keystart, ENDKEY3)) != NULL)
- keyend += strlen(ENDKEY3);
+ keyend += strlen(ENDKEY3);
else {
- fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor %s.\n", keyfile, ENDKEY1,
- ENDKEY2, ENDKEY3);
- goto cleanup;
+ fprintf(stderr, "%s doesn't contain '%s' nor '%s' nor %s.\n", keyfile, ENDKEY1,
+ ENDKEY2, ENDKEY3);
+ goto cleanup;
}
size = keyend-keystart;
@@ -595,8 +595,8 @@ makecertfile(const char certfile[],
certend += strlen(ENDCERT);
size = certend-certstart;
- strncat( *credbuf, certstart, size );
- strcat( *credbuf, "\n" );
+ strncat( *credbuf, certstart, size );
+ strcat( *credbuf, "\n" );
certstart += size;
}
diff --git a/myproxy/source/plugin_common.c b/myproxy/source/plugin_common.c
index d744c0d46d..8c0f96976d 100644
--- a/myproxy/source/plugin_common.c
+++ b/myproxy/source/plugin_common.c
@@ -731,7 +731,7 @@ int _plug_parseuser(const sasl_utils_t *utils,
return SASL_BADPARAM;
}
- r = strchr(input, '@');
+ r = (char *) strchr(input, '@');
if (!r) {
/* hmmm, the user didn't specify a realm */
if(user_realm && user_realm[0]) {
diff --git a/myproxy/source/ssl_utils.c b/myproxy/source/ssl_utils.c
index e36134e2cf..c838487842 100644
--- a/myproxy/source/ssl_utils.c
+++ b/myproxy/source/ssl_utils.c
@@ -79,18 +79,27 @@ void
ssl_error_to_verror()
{
unsigned long error;
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
ERR_STATE *error_state;
- const char *error_data;
int error_number;
+#else
+ int flags;
+#endif
+ const char *error_data;
while ((error = ERR_peek_error()) != 0)
{
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
/* Find data for last error */
error_state = ERR_get_state();
error_number = (error_state->bottom + 1) % ERR_NUM_ERRORS;
error_data = error_state->err_data[error_number];
+#else
+ ERR_peek_error_data(&error_data, &flags);
+ if (!(flags & ERR_TXT_STRING)) error_data = NULL;
+#endif
/* Now add to verror state */
verror_put_string("%s", ERR_error_string(error, NULL));
diff --git a/myproxy/source/vomsclient.c b/myproxy/source/vomsclient.c
index b441f9880d..7f41e4174f 100644
--- a/myproxy/source/vomsclient.c
+++ b/myproxy/source/vomsclient.c
@@ -14,7 +14,7 @@ int voms_init_delegation(myproxy_socket_attrs_t *attrs,
char *voname, char *vomses, char *voms_userconf);
-int voms_contact(SSL_CREDENTIALS *creds, int lifetime,
+int voms_contact(SSL_CREDENTIALS *creds, int lifetime,
char *voname, char *vomses, char *voms_userconf,
unsigned char **aclist, int *aclist_length);
@@ -35,7 +35,7 @@ voms_put_error_message(struct vomsdata *vd, int err)
* get the user info for specified vo
*/
static int
-voms_get_user_info(struct vomsdata *vd,
+voms_get_user_info(struct vomsdata *vd,
voms_command_t *command,
char *vomses_path)
{
@@ -60,7 +60,7 @@ voms_get_user_info(struct vomsdata *vd,
info->contact,
command->command,
vd,
- &err);
+ &err);
if (result) {
/* if contact succeded jumps to other VOs */
return_code = 0;
@@ -164,7 +164,7 @@ vomses_write_to_temporary(char *vomses, char *template)
done:
- return return_status;
+ return return_status;
}
static int
@@ -198,8 +198,8 @@ static char *
voms_get_role_command(const char *str)
{
char *buf = NULL;
- char *p_role = NULL;
- size_t buf_len, role_len;;
+ const char *p_role = NULL;
+ size_t buf_len, role_len;;
int i = 0;
if ((str == NULL) || (str[0] == '\0')) {
@@ -232,7 +232,7 @@ static char *
voms_get_mapping_command(const char *str)
{
char *buf = NULL;
- char *p_role = NULL;
+ const char *p_role = NULL;
size_t buf_len = 0, group_len = 0, role_len = 0;
int i = 0;
@@ -280,7 +280,7 @@ static char *
voms_get_group_command(const char *str)
{
char *buf = NULL;
- size_t buf_len = 0, str_len = 0;
+ size_t buf_len = 0, str_len = 0;
int i = 0;
if ((str == NULL) || (str[0] == '\0')) {
@@ -315,7 +315,7 @@ voms_get_group_command(const char *str)
static char *
voms_convert_command(const char *str)
{
- char *p = NULL;
+ const char *p = NULL;
char *result = NULL;
if (str == NULL) {
@@ -341,11 +341,11 @@ voms_convert_command(const char *str)
return result;
}
-static int
+static int
voms_parse_command(const char *voms, char **vo, char **command)
{
int result = 1;
- char *p_colon = NULL;
+ const char *p_colon = NULL;
p_colon = strchr(voms, ':');
if (p_colon == NULL) {
*vo = strdup(voms);
@@ -448,12 +448,12 @@ voms_command_list_add(voms_command_t **headRef, const char *vo, const char *cmd)
result = 0;
}
} else {
- node = voms_command_list_find(current, vo);
+ node = voms_command_list_find(current, vo);
if (node != NULL) {
/* Append command to the node */
my_append(&(node->command), ",", cmd, NULL);
result = 0;
- } else {
+ } else {
/* Create and Add a new node to last */
node = voms_command_new(vo, cmd);
if (node != NULL) {
@@ -575,13 +575,13 @@ get_AC_SEQ(struct vomsdata *vd, unsigned char **aclist, int *aclist_length)
/*
* Get VOMS User info
- *
+ *
* @param aclist DER-encoded AC-sequence
* @param aclist_length length of aclist
* Returns 0 on success or 1 on error.
*/
-int
-voms_contact(SSL_CREDENTIALS *creds, int lifetime,
+int
+voms_contact(SSL_CREDENTIALS *creds, int lifetime,
char *voname, char *vomses, char *voms_userconf,
unsigned char **aclist, int *aclist_length)
@@ -589,7 +589,7 @@ voms_contact(SSL_CREDENTIALS *creds, int lifetime,
int return_code = 1;
int verify_ac = 0;
- struct vomsdata *vd = NULL;
+ struct vomsdata *vd = NULL;
int err;
int result = 1;
int is_write_temp_vomses = 0;
@@ -642,7 +642,7 @@ voms_contact(SSL_CREDENTIALS *creds, int lifetime,
}
is_write_temp_vomses = 1;
} else {
- if (voms_userconf == NULL) {
+ if (voms_userconf == NULL) {
verror_put_string("No VOMS Server Information");
goto error;
}
@@ -661,8 +661,8 @@ voms_contact(SSL_CREDENTIALS *creds, int lifetime,
/* Set X509_USER_CERT, X509_USER_KEY */
old_ucert = getenv("X509_USER_CERT");
old_ukey = getenv("X509_USER_KEY");
- /*
- Save credential (cert & private key) to cred_path
+ /*
+ Save credential (cert & private key) to cred_path
cred_path is modified on success.
*/
if ( credential_write_to_temporary(creds, cred_path) != SSL_SUCCESS ) {
@@ -755,7 +755,7 @@ void get_voms_proxy(myproxy_socket_attrs_t *attrs,
lifetime,
request->passphrase,
request->voname,
- request->vomses,
+ request->vomses,
config->voms_userconf) < 0) {
response->response_type = MYPROXY_ERROR_RESPONSE;
response->error_string = strdup( verror_get_string() );
@@ -779,13 +779,11 @@ voms_create_AC_SEQ_X509_EXTENSION(unsigned char *acseq, int acseq_length)
goto error;
}
- ac_DER_string->data = (unsigned char*)malloc(acseq_length);
- if (ac_DER_string->data == NULL) {
+ if (ASN1_OCTET_STRING_set(ac_DER_string, acseq, acseq_length) == 0) {
verror_put_string("Couldn't allocate ASN1_OCTET");
goto error;
}
- memcpy(ac_DER_string->data, acseq, acseq_length);
- ac_DER_string->length = acseq_length;
+
ext = X509_EXTENSION_create_by_NID(NULL, OBJ_txt2nid("acseq"),
0, ac_DER_string);
if (ext == NULL) {
@@ -803,11 +801,11 @@ voms_create_AC_SEQ_X509_EXTENSION(unsigned char *acseq, int acseq_length)
static int
voms_contact_ext(const char *source_credentials, const int lifetime,
- char *passphrase,
+ char *passphrase,
char *voname, char *vomses, char *voms_userconf)
-{
+{
int result = 1;
- SSL_CREDENTIALS *creds = NULL;
+ SSL_CREDENTIALS *creds = NULL;
unsigned char *acseq= NULL;
int acseq_length = 0;
X509_EXTENSION *ext = NULL;
@@ -817,7 +815,7 @@ voms_contact_ext(const char *source_credentials, const int lifetime,
if (creds == NULL) {
goto done;
}
- if (ssl_proxy_load_from_file(creds, source_credentials,
+ if (ssl_proxy_load_from_file(creds, source_credentials,
passphrase) == SSL_ERROR) {
goto done;
}
@@ -862,7 +860,7 @@ voms_init_delegation(myproxy_socket_attrs_t *attrs,
const char *delegfile,
const int lifetime,
char *passphrase,
- char *voname, char *vomses,
+ char *voname, char *vomses,
char *voms_userconf)
{
@@ -874,7 +872,7 @@ voms_init_delegation(myproxy_socket_attrs_t *attrs,
return -1;
- if (voms_contact_ext(delegfile, lifetime, passphrase,
+ if (voms_contact_ext(delegfile, lifetime, passphrase,
voname, vomses, voms_userconf))
{
verror_put_string("Couldn't get VOMS User Information.");
diff --git a/packaging/debian/globus-callout/debian/changelog.in b/packaging/debian/globus-callout/debian/changelog.in
index de9d07310b..3bf9d4cacb 100644
--- a/packaging/debian/globus-callout/debian/changelog.in
+++ b/packaging/debian/globus-callout/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-callout (4.4-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 13:45:16 +0200
+
globus-callout (4.3-1+gct.@distro@) @distro@; urgency=medium
* Make makefiles exit sooner on errors
diff --git a/packaging/debian/globus-common/debian/changelog.in b/packaging/debian/globus-common/debian/changelog.in
index 8bdb6e17e9..01acb16277 100644
--- a/packaging/debian/globus-common/debian/changelog.in
+++ b/packaging/debian/globus-common/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-common (18.16-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 11:07:18 +0200
+
globus-common (18.15-1+gct.@distro@) @distro@; urgency=medium
* Compatibility with autoconf 2.72
diff --git a/packaging/debian/globus-ftp-client/debian/changelog.in b/packaging/debian/globus-ftp-client/debian/changelog.in
index f9bd3a1f70..7a89bc2759 100644
--- a/packaging/debian/globus-ftp-client/debian/changelog.in
+++ b/packaging/debian/globus-ftp-client/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-ftp-client (9.10-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 17:56:39 +0200
+
globus-ftp-client (9.9-1+gct.@distro@) @distro@; urgency=medium
* Fix format warnings on 32 bit systems
diff --git a/packaging/debian/globus-ftp-control/debian/changelog.in b/packaging/debian/globus-ftp-control/debian/changelog.in
index 4376646d5c..57f5478302 100644
--- a/packaging/debian/globus-ftp-control/debian/changelog.in
+++ b/packaging/debian/globus-ftp-control/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-ftp-control (9.11-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:52:14 +0200
+
globus-ftp-control (9.10-1+gct.@distro@) @distro@; urgency=medium
* Fix cut-and-paste error in Makefile
diff --git a/packaging/debian/globus-gass-cache/debian/changelog.in b/packaging/debian/globus-gass-cache/debian/changelog.in
index f5b1578cbb..a0bd12c320 100644
--- a/packaging/debian/globus-gass-cache/debian/changelog.in
+++ b/packaging/debian/globus-gass-cache/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gass-cache (10.4-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 18:57:52 +0200
+
globus-gass-cache (10.3-1+gct.@distro@) @distro@; urgency=medium
* Typo fixes
diff --git a/packaging/debian/globus-gass-copy/debian/changelog.in b/packaging/debian/globus-gass-copy/debian/changelog.in
index 490c5c8ba2..23a465d6bd 100644
--- a/packaging/debian/globus-gass-copy/debian/changelog.in
+++ b/packaging/debian/globus-gass-copy/debian/changelog.in
@@ -1,3 +1,10 @@
+globus-gass-copy (10.14-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 18:03:13 +0200
+
globus-gass-copy (10.13-1+gct.@distro@) @distro@; urgency=medium
* Detect checksum calculation errors due to file read errors
diff --git a/packaging/debian/globus-gass-transfer/debian/changelog.in b/packaging/debian/globus-gass-transfer/debian/changelog.in
index d12fad55c8..b989d8d92f 100644
--- a/packaging/debian/globus-gass-transfer/debian/changelog.in
+++ b/packaging/debian/globus-gass-transfer/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gass-transfer (9.6-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:56:46 +0200
+
globus-gass-transfer (9.5-1+gct.@distro@) @distro@; urgency=medium
* Fix format warnings on 32 bit systems
diff --git a/packaging/debian/globus-gatekeeper/debian/changelog.in b/packaging/debian/globus-gatekeeper/debian/changelog.in
index 2995f87794..1d13ad2679 100644
--- a/packaging/debian/globus-gatekeeper/debian/changelog.in
+++ b/packaging/debian/globus-gatekeeper/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gatekeeper (11.5-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:04:14 +0200
+
globus-gatekeeper (11.4-1+gct.@distro@) @distro@; urgency=medium
* Fix some compiler warnings
diff --git a/packaging/debian/globus-gfork/debian/changelog.in b/packaging/debian/globus-gfork/debian/changelog.in
index 825ec23658..1e76cff522 100644
--- a/packaging/debian/globus-gfork/debian/changelog.in
+++ b/packaging/debian/globus-gfork/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gfork (5.1-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 17:04:21 +0200
+
globus-gfork (5.0-1+gct.@distro@) @distro@; urgency=medium
* First Grid Community Toolkit release
diff --git a/packaging/debian/globus-gram-client/debian/changelog.in b/packaging/debian/globus-gram-client/debian/changelog.in
index fd3967330c..353d147519 100644
--- a/packaging/debian/globus-gram-client/debian/changelog.in
+++ b/packaging/debian/globus-gram-client/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gram-client (14.8-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 18:49:48 +0200
+
globus-gram-client (14.7-1+gct.@distro@) @distro@; urgency=medium
* Correct spelling error found by lintian
diff --git a/packaging/debian/globus-gram-job-manager-lsf/debian/changelog.in b/packaging/debian/globus-gram-job-manager-lsf/debian/changelog.in
index 7c2af416dd..1f5479ed90 100644
--- a/packaging/debian/globus-gram-job-manager-lsf/debian/changelog.in
+++ b/packaging/debian/globus-gram-job-manager-lsf/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gram-job-manager-lsf (3.2-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:13:43 +0200
+
globus-gram-job-manager-lsf (3.1-1+gct.@distro@) @distro@; urgency=medium
* Handle 64 bit time_t on 32 bit systems
diff --git a/packaging/debian/globus-gram-job-manager-sge/debian/changelog.in b/packaging/debian/globus-gram-job-manager-sge/debian/changelog.in
index fe37fa22b2..b1fa41a4b7 100644
--- a/packaging/debian/globus-gram-job-manager-sge/debian/changelog.in
+++ b/packaging/debian/globus-gram-job-manager-sge/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gram-job-manager-sge (3.4-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:12:15 +0200
+
globus-gram-job-manager-sge (3.3-1+gct.@distro@) @distro@; urgency=medium
* Fix some compiler warnings
diff --git a/packaging/debian/globus-gram-job-manager/debian/changelog.in b/packaging/debian/globus-gram-job-manager/debian/changelog.in
index 2e6a855307..d96634eb2c 100644
--- a/packaging/debian/globus-gram-job-manager/debian/changelog.in
+++ b/packaging/debian/globus-gram-job-manager/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gram-job-manager (15.11-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:08:49 +0200
+
globus-gram-job-manager (15.10-1+gct.@distro@) @distro@; urgency=medium
* Only check write permission for stdout/stderr if path is absolute
diff --git a/packaging/debian/globus-gram-protocol/debian/changelog.in b/packaging/debian/globus-gram-protocol/debian/changelog.in
index 1b135d4aff..72bffcb6b4 100644
--- a/packaging/debian/globus-gram-protocol/debian/changelog.in
+++ b/packaging/debian/globus-gram-protocol/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gram-protocol (13.7-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 18:22:13 +0200
+
globus-gram-protocol (13.6-1+gct.@distro@) @distro@; urgency=medium
* Use sha256 hash when generating test certificates
diff --git a/packaging/debian/globus-gridftp-server-control/debian/changelog.in b/packaging/debian/globus-gridftp-server-control/debian/changelog.in
index a1bdfea3e9..5100f7faab 100644
--- a/packaging/debian/globus-gridftp-server-control/debian/changelog.in
+++ b/packaging/debian/globus-gridftp-server-control/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gridftp-server-control (9.6-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 17:07:47 +0200
+
globus-gridftp-server-control (9.5-1+gct.@distro@) @distro@; urgency=medium
* Passing argument from incompatible pointer type
diff --git a/packaging/debian/globus-gridftp-server/debian/changelog.in b/packaging/debian/globus-gridftp-server/debian/changelog.in
index 0da5221d43..a0e4098d7b 100644
--- a/packaging/debian/globus-gridftp-server/debian/changelog.in
+++ b/packaging/debian/globus-gridftp-server/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gridftp-server (13.29-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 17:18:24 +0200
+
globus-gridftp-server (13.28-1+gct.@distro@) @distro@; urgency=medium
* Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/debian/globus-gridmap-eppn-callout/debian/changelog.in b/packaging/debian/globus-gridmap-eppn-callout/debian/changelog.in
index d932234013..f7ee3dcf05 100644
--- a/packaging/debian/globus-gridmap-eppn-callout/debian/changelog.in
+++ b/packaging/debian/globus-gridmap-eppn-callout/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gridmap-eppn-callout (2.3-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+
+ -- Mattias Ellert Tue, 19 May 2026 19:23:57 +0200
+
globus-gridmap-eppn-callout (2.2-1+gct.@distro@) @distro@; urgency=medium
* Add environment variable GLOBUS_EPPN_FORCE_GRIDMAP to return mapped
diff --git a/packaging/debian/globus-gsi-callback/debian/changelog.in b/packaging/debian/globus-gsi-callback/debian/changelog.in
index bcd7d5c9db..fbfab0c6bd 100644
--- a/packaging/debian/globus-gsi-callback/debian/changelog.in
+++ b/packaging/debian/globus-gsi-callback/debian/changelog.in
@@ -1,3 +1,10 @@
+globus-gsi-callback (6.3-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 13:14:31 +0200
+
globus-gsi-callback (6.2-1+gct.@distro@) @distro@; urgency=medium
* Make makefiles exit sooner on errors
diff --git a/packaging/debian/globus-gsi-cert-utils/debian/changelog.in b/packaging/debian/globus-gsi-cert-utils/debian/changelog.in
index ed14cdf2ad..c42a160047 100644
--- a/packaging/debian/globus-gsi-cert-utils/debian/changelog.in
+++ b/packaging/debian/globus-gsi-cert-utils/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gsi-cert-utils (10.12-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+
+ -- Mattias Ellert Tue, 19 May 2026 11:41:35 +0200
+
globus-gsi-cert-utils (10.11-1+gct.@distro@) @distro@; urgency=medium
* Fix parsing of ASN1 timestamps
diff --git a/packaging/debian/globus-gsi-credential/debian/changelog.in b/packaging/debian/globus-gsi-credential/debian/changelog.in
index ab7d5c13c4..8f20d25b5b 100644
--- a/packaging/debian/globus-gsi-credential/debian/changelog.in
+++ b/packaging/debian/globus-gsi-credential/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gsi-credential (8.6-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+
+ -- Mattias Ellert Tue, 19 May 2026 13:24:49 +0200
+
globus-gsi-credential (8.5-1+gct.@distro@) @distro@; urgency=medium
* Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/debian/globus-gsi-proxy-core/debian/changelog.in b/packaging/debian/globus-gsi-proxy-core/debian/changelog.in
index 01f88c2a08..826468c881 100644
--- a/packaging/debian/globus-gsi-proxy-core/debian/changelog.in
+++ b/packaging/debian/globus-gsi-proxy-core/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gsi-proxy-core (9.10-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+
+ -- Mattias Ellert Tue, 19 May 2026 13:35:03 +0200
+
globus-gsi-proxy-core (9.9-1+gct.@distro@) @distro@; urgency=medium
* Fix linking error with gcc 16
diff --git a/packaging/debian/globus-gsi-proxy-ssl/debian/changelog.in b/packaging/debian/globus-gsi-proxy-ssl/debian/changelog.in
index a1639d858d..1cea4764cf 100644
--- a/packaging/debian/globus-gsi-proxy-ssl/debian/changelog.in
+++ b/packaging/debian/globus-gsi-proxy-ssl/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gsi-proxy-ssl (6.7-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+
+ -- Mattias Ellert Tue, 19 May 2026 11:17:38 +0200
+
globus-gsi-proxy-ssl (6.6-1+gct.@distro@) @distro@; urgency=medium
* Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/debian/globus-gsi-sysconfig/debian/changelog.in b/packaging/debian/globus-gsi-sysconfig/debian/changelog.in
index a9b7a03566..fe8b0b9c1a 100644
--- a/packaging/debian/globus-gsi-sysconfig/debian/changelog.in
+++ b/packaging/debian/globus-gsi-sysconfig/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gsi-sysconfig (9.7-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+
+ -- Mattias Ellert Tue, 19 May 2026 11:47:45 +0200
+
globus-gsi-sysconfig (9.6-1+gct.@distro@) @distro@; urgency=medium
* Remove extra comma
diff --git a/packaging/debian/globus-gss-assist/debian/changelog.in b/packaging/debian/globus-gss-assist/debian/changelog.in
index fabfcc8dac..cd49a16cee 100644
--- a/packaging/debian/globus-gss-assist/debian/changelog.in
+++ b/packaging/debian/globus-gss-assist/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-gss-assist (12.8-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:04:59 +0200
+
globus-gss-assist (12.7-1+gct.@distro@) @distro@; urgency=medium
* Use sha256 hash when generating test certificates
diff --git a/packaging/debian/globus-gssapi-gsi/debian/changelog.in b/packaging/debian/globus-gssapi-gsi/debian/changelog.in
index 105522a25e..c25fa4609e 100644
--- a/packaging/debian/globus-gssapi-gsi/debian/changelog.in
+++ b/packaging/debian/globus-gssapi-gsi/debian/changelog.in
@@ -1,3 +1,10 @@
+globus-gssapi-gsi (14.21-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 15:59:55 +0200
+
globus-gssapi-gsi (14.20-1+gct.@distro@) @distro@; urgency=medium
* Disable sending session tickets after the TLS 1.3 handshake
diff --git a/packaging/debian/globus-io/debian/changelog.in b/packaging/debian/globus-io/debian/changelog.in
index 4f7b187c42..476ed92ba0 100644
--- a/packaging/debian/globus-io/debian/changelog.in
+++ b/packaging/debian/globus-io/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-io (12.5-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:48:24 +0200
+
globus-io (12.4-1+gct.@distro@) @distro@; urgency=medium
* Use sha256 hash when generating test certificates
diff --git a/packaging/debian/globus-openssl-module/debian/changelog.in b/packaging/debian/globus-openssl-module/debian/changelog.in
index db6e8512b4..98c9cb80e9 100644
--- a/packaging/debian/globus-openssl-module/debian/changelog.in
+++ b/packaging/debian/globus-openssl-module/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-openssl-module (5.3-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 11:31:43 +0200
+
globus-openssl-module (5.2-1+gct.@distro@) @distro@; urgency=medium
* Make makefiles exit sooner on errors
diff --git a/packaging/debian/globus-proxy-utils/debian/changelog.in b/packaging/debian/globus-proxy-utils/debian/changelog.in
index bf643c2541..13b8973649 100644
--- a/packaging/debian/globus-proxy-utils/debian/changelog.in
+++ b/packaging/debian/globus-proxy-utils/debian/changelog.in
@@ -1,3 +1,10 @@
+globus-proxy-utils (7.5-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:10:19 +0200
+
globus-proxy-utils (7.4-1+gct.@distro@) @distro@; urgency=medium
* Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/debian/globus-rsl/debian/changelog.in b/packaging/debian/globus-rsl/debian/changelog.in
index 7d5e53b60f..bf73074f03 100644
--- a/packaging/debian/globus-rsl/debian/changelog.in
+++ b/packaging/debian/globus-rsl/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-rsl (11.5-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 18:17:40 +0200
+
globus-rsl (11.4-1+gct.@distro@) @distro@; urgency=medium
* Make library linking survive -Wl,--as-needed
diff --git a/packaging/debian/globus-scheduler-event-generator/debian/changelog.in b/packaging/debian/globus-scheduler-event-generator/debian/changelog.in
index 1dc15e9c68..f7535c7ebf 100644
--- a/packaging/debian/globus-scheduler-event-generator/debian/changelog.in
+++ b/packaging/debian/globus-scheduler-event-generator/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-scheduler-event-generator (6.7-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:01:42 +0200
+
globus-scheduler-event-generator (6.6-1+gct.@distro@) @distro@; urgency=medium
* Handle 64 bit time_t on 32 bit systems
diff --git a/packaging/debian/globus-xio-gridftp-driver/debian/changelog.in b/packaging/debian/globus-xio-gridftp-driver/debian/changelog.in
index 76b83f06d7..58d8d2839a 100644
--- a/packaging/debian/globus-xio-gridftp-driver/debian/changelog.in
+++ b/packaging/debian/globus-xio-gridftp-driver/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-xio-gridftp-driver (3.7-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:19:49 +0200
+
globus-xio-gridftp-driver (3.6-1+gct.@distro@) @distro@; urgency=medium
* Fix some compiler warnings
diff --git a/packaging/debian/globus-xio-gridftp-multicast/debian/changelog.in b/packaging/debian/globus-xio-gridftp-multicast/debian/changelog.in
index 5f450b768e..0f8c4faa77 100644
--- a/packaging/debian/globus-xio-gridftp-multicast/debian/changelog.in
+++ b/packaging/debian/globus-xio-gridftp-multicast/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-xio-gridftp-multicast (2.3-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:27:07 +0200
+
globus-xio-gridftp-multicast (2.2-1+gct.@distro@) @distro@; urgency=medium
* Fix some compiler warnings
diff --git a/packaging/debian/globus-xio-pipe-driver/debian/changelog.in b/packaging/debian/globus-xio-pipe-driver/debian/changelog.in
index ecad8a4458..3b1d279e6c 100644
--- a/packaging/debian/globus-xio-pipe-driver/debian/changelog.in
+++ b/packaging/debian/globus-xio-pipe-driver/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-xio-pipe-driver (4.2-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:35:06 +0200
+
globus-xio-pipe-driver (4.1-1+gct.@distro@) @distro@; urgency=medium
* Add AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS
diff --git a/packaging/debian/globus-xio/debian/changelog.in b/packaging/debian/globus-xio/debian/changelog.in
index beaaa707f7..fc2da68173 100644
--- a/packaging/debian/globus-xio/debian/changelog.in
+++ b/packaging/debian/globus-xio/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-xio (6.7-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler and doxygen warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 16:19:26 +0200
+
globus-xio (6.6-1+gct.@distro@) @distro@; urgency=medium
* Fix some compiler and doxygen warnings
diff --git a/packaging/debian/globus-xioperf/debian/changelog.in b/packaging/debian/globus-xioperf/debian/changelog.in
index 14ade1c37a..fd04011353 100644
--- a/packaging/debian/globus-xioperf/debian/changelog.in
+++ b/packaging/debian/globus-xioperf/debian/changelog.in
@@ -1,3 +1,9 @@
+globus-xioperf (5.2-1+gct.@distro@) @distro@; urgency=medium
+
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 23:22:44 +0200
+
globus-xioperf (5.1-1+gct.@distro@) @distro@; urgency=medium
* Add AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS
diff --git a/packaging/debian/myproxy/debian/changelog.in b/packaging/debian/myproxy/debian/changelog.in
index 72eb7277d0..f8687345c5 100644
--- a/packaging/debian/myproxy/debian/changelog.in
+++ b/packaging/debian/myproxy/debian/changelog.in
@@ -1,3 +1,10 @@
+myproxy (6.2.21-1+gct.@distro@) @distro@; urgency=medium
+
+ * Compile with OpenSSL 4
+ * Fix compiler warnings
+
+ -- Mattias Ellert Tue, 19 May 2026 19:33:03 +0200
+
myproxy (6.2.20-1+gct.@distro@) @distro@; urgency=medium
* Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/fedora/globus-callout.spec b/packaging/fedora/globus-callout.spec
index 11b0903f29..82ef6694fe 100644
--- a/packaging/fedora/globus-callout.spec
+++ b/packaging/fedora/globus-callout.spec
@@ -3,7 +3,7 @@
Name: globus-callout
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 4.3
+Version: 4.4
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus Callout Library
@@ -137,6 +137,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 4.4-1
+- Fix compiler warnings
+
* Tue Mar 10 2020 Mattias Ellert - 4.3-1
- Make makefiles exit sooner on errors
diff --git a/packaging/fedora/globus-common.spec b/packaging/fedora/globus-common.spec
index 516704e8e6..d6267aa075 100644
--- a/packaging/fedora/globus-common.spec
+++ b/packaging/fedora/globus-common.spec
@@ -3,7 +3,7 @@
Name: globus-common
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 18.15
+Version: 18.16
Release: 1%{?dist}
Summary: Grid Community Toolkit - Common Library
@@ -239,6 +239,9 @@ make %{?_smp_mflags} check VERBOSE=1 NO_EXTERNAL_NET=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 18.16-1
+- Fix compiler and doxygen warnings
+
* Wed Oct 30 2024 Mattias Ellert - 18.15-1
- Compatibility with autoconf 2.72
diff --git a/packaging/fedora/globus-ftp-client.spec b/packaging/fedora/globus-ftp-client.spec
index b56a93c6dc..ed303c46d8 100644
--- a/packaging/fedora/globus-ftp-client.spec
+++ b/packaging/fedora/globus-ftp-client.spec
@@ -3,7 +3,7 @@
Name: globus-ftp-client
%global soname 2
%global _name %(echo %{name} | tr - _)
-Version: 9.9
+Version: 9.10
Release: 1%{?dist}
Summary: Grid Community Toolkit - GridFTP Client Library
@@ -169,6 +169,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 9.10-1
+- Fix compiler and doxygen warnings
+
* Fri Mar 01 2024 Mattias Ellert - 9.9-1
- Fix format warnings on 32 bit systems
- Handle 64 bit time_t on 32 bit systems
diff --git a/packaging/fedora/globus-ftp-control.spec b/packaging/fedora/globus-ftp-control.spec
index c9051c012d..0bce52ab3d 100644
--- a/packaging/fedora/globus-ftp-control.spec
+++ b/packaging/fedora/globus-ftp-control.spec
@@ -3,7 +3,7 @@
Name: globus-ftp-control
%global soname 1
%global _name %(echo %{name} | tr - _)
-Version: 9.10
+Version: 9.11
Release: 1%{?dist}
Summary: Grid Community Toolkit - GridFTP Control Library
@@ -144,6 +144,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 9.11-1
+- Fix compiler warnings
+
* Thu Apr 21 2022 Mattias Ellert - 9.10-1
- Fix cut-and-paste error in Makefile
diff --git a/packaging/fedora/globus-gass-cache.spec b/packaging/fedora/globus-gass-cache.spec
index 6f27a1da7e..11acc4d2e3 100644
--- a/packaging/fedora/globus-gass-cache.spec
+++ b/packaging/fedora/globus-gass-cache.spec
@@ -3,7 +3,7 @@
Name: globus-gass-cache
%global soname 5
%global _name %(echo %{name} | tr - _)
-Version: 10.3
+Version: 10.4
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus Gass Cache
@@ -133,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 10.4-1
+- Fix compiler warnings
+
* Fri Aug 20 2021 Mattias Ellert - 10.3-1
- Typo fixes
diff --git a/packaging/fedora/globus-gass-copy.spec b/packaging/fedora/globus-gass-copy.spec
index f4129b44c5..de469fa2e9 100644
--- a/packaging/fedora/globus-gass-copy.spec
+++ b/packaging/fedora/globus-gass-copy.spec
@@ -3,7 +3,7 @@
Name: globus-gass-copy
%global soname 2
%global _name %(echo %{name} | tr - _)
-Version: 10.13
+Version: 10.14
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus Gass Copy
@@ -183,6 +183,10 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 10.14-1
+- Compile with OpenSSL 4
+- Fix compiler and doxygen warnings
+
* Thu Oct 26 2023 Mattias Ellert - 10.13-1
- Detect checksum calculation errors due to file read errors
diff --git a/packaging/fedora/globus-gass-transfer.spec b/packaging/fedora/globus-gass-transfer.spec
index 054c69b3c8..2f6c221a0f 100644
--- a/packaging/fedora/globus-gass-transfer.spec
+++ b/packaging/fedora/globus-gass-transfer.spec
@@ -3,7 +3,7 @@
Name: globus-gass-transfer
%global soname 2
%global _name %(echo %{name} | tr - _)
-Version: 9.5
+Version: 9.6
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus Gass Transfer
@@ -131,6 +131,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 9.6-1
+- Fix compiler and doxygen warnings
+
* Fri Mar 01 2024 Mattias Ellert - 9.5-1
- Fix format warnings on 32 bit systems
diff --git a/packaging/fedora/globus-gatekeeper.spec b/packaging/fedora/globus-gatekeeper.spec
index e2613a8046..288f90ba0a 100644
--- a/packaging/fedora/globus-gatekeeper.spec
+++ b/packaging/fedora/globus-gatekeeper.spec
@@ -2,7 +2,7 @@
Name: globus-gatekeeper
%global _name %(echo %{name} | tr - _)
-Version: 11.4
+Version: 11.5
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus Gatekeeper
@@ -129,6 +129,9 @@ fi
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 11.5-1
+- Fix compiler warnings
+
* Thu Mar 10 2022 Mattias Ellert - 11.4-1
- Fix some compiler warnings
diff --git a/packaging/fedora/globus-gfork.spec b/packaging/fedora/globus-gfork.spec
index 7540e08214..169c2f3fe1 100644
--- a/packaging/fedora/globus-gfork.spec
+++ b/packaging/fedora/globus-gfork.spec
@@ -3,7 +3,7 @@
Name: globus-gfork
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 5.0
+Version: 5.1
Release: 1%{?dist}
Summary: Grid Community Toolkit - GFork
@@ -132,6 +132,9 @@ echo "# This is the default gfork configuration file" > \
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Tue May 19 2026 Mattias Ellert - 5.1-1
+- Fix compiler warnings
+
* Sat Mar 31 2018 Mattias Ellert - 5.0-1
- First Grid Community Toolkit release
diff --git a/packaging/fedora/globus-gram-client.spec b/packaging/fedora/globus-gram-client.spec
index 56764f6f76..801227dba1 100644
--- a/packaging/fedora/globus-gram-client.spec
+++ b/packaging/fedora/globus-gram-client.spec
@@ -3,7 +3,7 @@
Name: globus-gram-client
%global soname 3
%global _name %(echo %{name} | tr - _)
-Version: 14.7
+Version: 14.8
Release: 1%{?dist}
Summary: Grid Community Toolkit - GRAM Client Library
@@ -137,6 +137,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 14.8-1
+- Fix compiler warnings
+
* Fri Mar 08 2024 Mattias Ellert - 14.7-1
- Correct spelling error found by lintian
diff --git a/packaging/fedora/globus-gram-job-manager-lsf.spec b/packaging/fedora/globus-gram-job-manager-lsf.spec
index d60a6ec2c3..60abc0a81a 100644
--- a/packaging/fedora/globus-gram-job-manager-lsf.spec
+++ b/packaging/fedora/globus-gram-job-manager-lsf.spec
@@ -2,7 +2,7 @@
Name: globus-gram-job-manager-lsf
%global _name %(echo %{name} | tr - _)
-Version: 3.1
+Version: 3.2
Release: 1%{?dist}
Summary: Grid Community Toolkit - LSF Job Manager Support
@@ -170,6 +170,9 @@ fi
%config(noreplace) %{_sysconfdir}/globus/scheduler-event-generator/available/lsf
%changelog
+* Tue May 19 2026 Mattias Ellert - 3.2-1
+- Fix compiler warnings
+
* Sun Mar 10 2024 Mattias Ellert - 3.1-1
- Handle 64 bit time_t on 32 bit systems
diff --git a/packaging/fedora/globus-gram-job-manager-sge.spec b/packaging/fedora/globus-gram-job-manager-sge.spec
index 9cc1b373ae..b4fb2ee012 100644
--- a/packaging/fedora/globus-gram-job-manager-sge.spec
+++ b/packaging/fedora/globus-gram-job-manager-sge.spec
@@ -2,7 +2,7 @@
Name: globus-gram-job-manager-sge
%global _name %(echo %{name} | tr - _)
-Version: 3.3
+Version: 3.4
Release: 1%{?dist}
Summary: Grid Community Toolkit - Grid Engine Job Manager Support
@@ -177,6 +177,9 @@ fi
%config(noreplace) %{_sysconfdir}/globus/scheduler-event-generator/available/sge
%changelog
+* Tue May 19 2026 Mattias Ellert - 3.4-1
+- Fix compiler warnings
+
* Fri Mar 11 2022 Mattias Ellert - 3.3-1
- Fix some compiler warnings
diff --git a/packaging/fedora/globus-gram-job-manager.spec b/packaging/fedora/globus-gram-job-manager.spec
index 8560ab60d0..4875e6f370 100644
--- a/packaging/fedora/globus-gram-job-manager.spec
+++ b/packaging/fedora/globus-gram-job-manager.spec
@@ -2,7 +2,7 @@
Name: globus-gram-job-manager
%global _name %(echo %{name} | tr - _)
-Version: 15.10
+Version: 15.11
Release: 1%{?dist}
Summary: Grid Community Toolkit - GRAM Jobmanager
@@ -169,6 +169,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%{_libdir}/libglobus_seg_job_manager.so
%changelog
+* Tue May 19 2026 Mattias Ellert - 15.11-1
+- Fix compiler warnings
+
* Sat Apr 26 2025 Mattias Ellert - 15.10-1
- Only check write permission for stdout/stderr if path is absolute
diff --git a/packaging/fedora/globus-gram-protocol.spec b/packaging/fedora/globus-gram-protocol.spec
index 55d182e53e..f63c8b7321 100644
--- a/packaging/fedora/globus-gram-protocol.spec
+++ b/packaging/fedora/globus-gram-protocol.spec
@@ -3,7 +3,7 @@
Name: globus-gram-protocol
%global soname 3
%global _name %(echo %{name} | tr - _)
-Version: 13.6
+Version: 13.7
Release: 1%{?dist}
Summary: Grid Community Toolkit - GRAM Protocol Library
@@ -158,6 +158,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 13.7-1
+- Fix compiler and doxygen warnings
+
* Sun Mar 06 2022 Mattias Ellert - 13.6-1
- Use sha256 hash when generating test certificates
diff --git a/packaging/fedora/globus-gridftp-server-control.spec b/packaging/fedora/globus-gridftp-server-control.spec
index e4e732554e..46d6f880b8 100644
--- a/packaging/fedora/globus-gridftp-server-control.spec
+++ b/packaging/fedora/globus-gridftp-server-control.spec
@@ -3,7 +3,7 @@
Name: globus-gridftp-server-control
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 9.5
+Version: 9.6
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GridFTP Server Library
@@ -112,6 +112,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Tue May 19 2026 Mattias Ellert - 9.6-1
+- Fix compiler warnings
+
* Thu Jul 11 2024 Mattias Ellert - 9.5-1
- Passing argument from incompatible pointer type
diff --git a/packaging/fedora/globus-gridftp-server.spec b/packaging/fedora/globus-gridftp-server.spec
index d569ad40a4..69b0dc4fba 100644
--- a/packaging/fedora/globus-gridftp-server.spec
+++ b/packaging/fedora/globus-gridftp-server.spec
@@ -3,7 +3,7 @@
Name: globus-gridftp-server
%global soname 6
%global _name %(echo %{name} | tr - _)
-Version: 13.28
+Version: 13.29
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GridFTP Server
@@ -223,6 +223,9 @@ fi
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Tue May 19 2026 Mattias Ellert - 13.29-1
+- Fix compiler warnings
+
* Fri Jan 17 2025 Mattias Ellert - 13.28-1
- Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/fedora/globus-gridmap-eppn-callout.spec b/packaging/fedora/globus-gridmap-eppn-callout.spec
index 19f685dbbb..3526d2669f 100644
--- a/packaging/fedora/globus-gridmap-eppn-callout.spec
+++ b/packaging/fedora/globus-gridmap-eppn-callout.spec
@@ -2,7 +2,7 @@
Name: globus-gridmap-eppn-callout
%global _name %(echo %{name} | tr - _)
-Version: 2.2
+Version: 2.3
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus gridmap ePPN callout
@@ -95,6 +95,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 2.3-1
+- Compile with OpenSSL 4
+
* Wed Aug 21 2019 Mattias Ellert - 2.2-1
- Add environment variable GLOBUS_EPPN_FORCE_GRIDMAP to return mapped
identity from gridmap lookup based on the ePPN
diff --git a/packaging/fedora/globus-gsi-callback.spec b/packaging/fedora/globus-gsi-callback.spec
index 3eee496012..adb9adc3de 100644
--- a/packaging/fedora/globus-gsi-callback.spec
+++ b/packaging/fedora/globus-gsi-callback.spec
@@ -3,7 +3,7 @@
Name: globus-gsi-callback
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 6.2
+Version: 6.3
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI Callback Library
@@ -139,6 +139,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 6.3-1
+- Compile with OpenSSL 4
+- Fix compiler warnings
+
* Tue Mar 10 2020 Mattias Ellert - 6.2-1
- Make makefiles exit sooner on errors
diff --git a/packaging/fedora/globus-gsi-cert-utils.spec b/packaging/fedora/globus-gsi-cert-utils.spec
index 8fdc573683..e6e4b6cf4d 100644
--- a/packaging/fedora/globus-gsi-cert-utils.spec
+++ b/packaging/fedora/globus-gsi-cert-utils.spec
@@ -3,7 +3,7 @@
Name: globus-gsi-cert-utils
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 10.11
+Version: 10.12
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI Cert Utils Library
@@ -180,6 +180,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 10.12-1
+- Compile with OpenSSL 4
+
* Thu Jan 19 2023 Mischa Salle - 10.11-1
- Fix parsing of ASN1 timestamps
diff --git a/packaging/fedora/globus-gsi-credential.spec b/packaging/fedora/globus-gsi-credential.spec
index 2b9b3c9169..966c2da08a 100644
--- a/packaging/fedora/globus-gsi-credential.spec
+++ b/packaging/fedora/globus-gsi-credential.spec
@@ -3,7 +3,7 @@
Name: globus-gsi-credential
%global soname 1
%global _name %(echo %{name} | tr - _)
-Version: 8.5
+Version: 8.6
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI Credential Library
@@ -137,6 +137,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 8.6-1
+- Compile with OpenSSL 4
+
* Fri Jan 17 2025 Mattias Ellert - 8.5-1
- Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/fedora/globus-gsi-proxy-core.spec b/packaging/fedora/globus-gsi-proxy-core.spec
index d6ed217397..6a88445924 100644
--- a/packaging/fedora/globus-gsi-proxy-core.spec
+++ b/packaging/fedora/globus-gsi-proxy-core.spec
@@ -3,7 +3,7 @@
Name: globus-gsi-proxy-core
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 9.9
+Version: 9.10
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI Proxy Core Library
@@ -143,6 +143,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 9.10-1
+- Compile with OpenSSL 4
+
* Thu Jan 08 2026 Mattias Ellert - 9.9-1
- Fix linking error with gcc 16
diff --git a/packaging/fedora/globus-gsi-proxy-ssl.spec b/packaging/fedora/globus-gsi-proxy-ssl.spec
index 9af66e1936..4ba5f88b3d 100644
--- a/packaging/fedora/globus-gsi-proxy-ssl.spec
+++ b/packaging/fedora/globus-gsi-proxy-ssl.spec
@@ -3,7 +3,7 @@
Name: globus-gsi-proxy-ssl
%global soname 1
%global _name %(echo %{name} | tr - _)
-Version: 6.6
+Version: 6.7
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI Proxy SSL Library
@@ -142,6 +142,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 6.7-1
+- Compile with OpenSSL 4
+
* Fri Jan 17 2025 Mattias Ellert - 6.6-1
- Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/fedora/globus-gsi-sysconfig.spec b/packaging/fedora/globus-gsi-sysconfig.spec
index 17fd1d7493..51a2e364f9 100644
--- a/packaging/fedora/globus-gsi-sysconfig.spec
+++ b/packaging/fedora/globus-gsi-sysconfig.spec
@@ -3,7 +3,7 @@
Name: globus-gsi-sysconfig
%global soname 1
%global _name %(echo %{name} | tr - _)
-Version: 9.6
+Version: 9.7
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI System Config Library
@@ -150,6 +150,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 9.7-1
+- Compile with OpenSSL 4
+
* Fri Nov 10 2023 Mattias Ellert - 9.6-1
- Remove extra comma
diff --git a/packaging/fedora/globus-gss-assist.spec b/packaging/fedora/globus-gss-assist.spec
index de31ec26aa..4473dd403f 100644
--- a/packaging/fedora/globus-gss-assist.spec
+++ b/packaging/fedora/globus-gss-assist.spec
@@ -3,7 +3,7 @@
Name: globus-gss-assist
%global soname 3
%global _name %(echo %{name} | tr - _)
-Version: 12.7
+Version: 12.8
Release: 1%{?dist}
Summary: Grid Community Toolkit - GSSAPI Assist library
@@ -185,6 +185,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 12.8-1
+- Fix compiler and doxygen warnings
+
* Sun Mar 06 2022 Mattias Ellert - 12.7-1
- Use sha256 hash when generating test certificates
diff --git a/packaging/fedora/globus-gssapi-gsi.spec b/packaging/fedora/globus-gssapi-gsi.spec
index a26b1e8b99..ca17c03213 100644
--- a/packaging/fedora/globus-gssapi-gsi.spec
+++ b/packaging/fedora/globus-gssapi-gsi.spec
@@ -3,7 +3,7 @@
Name: globus-gssapi-gsi
%global soname 4
%global _name %(echo %{name} | tr - _)
-Version: 14.20
+Version: 14.21
Release: 1%{?dist}
Summary: Grid Community Toolkit - GSSAPI library
@@ -158,6 +158,10 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 14.21-1
+- Compile with OpenSSL 4
+- Fix compiler warnings
+
* Fri May 20 2022 Mattias Ellert - 14.20-1
- Disable sending session tickets after the TLS 1.3 handshake
diff --git a/packaging/fedora/globus-io.spec b/packaging/fedora/globus-io.spec
index 7aae98d1ec..fc7ee01e89 100644
--- a/packaging/fedora/globus-io.spec
+++ b/packaging/fedora/globus-io.spec
@@ -3,7 +3,7 @@
Name: globus-io
%global soname 3
%global _name %(echo %{name} | tr - _)
-Version: 12.4
+Version: 12.5
Release: 1%{?dist}
Summary: Grid Community Toolkit - uniform I/O interface
@@ -121,6 +121,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Tue May 19 2026 Mattias Ellert - 12.5-1
+- Fix compiler warnings
+
* Sun Mar 06 2022 Mattias Ellert - 12.4-1
- Use sha256 hash when generating test certificates
diff --git a/packaging/fedora/globus-openssl-module.spec b/packaging/fedora/globus-openssl-module.spec
index 7b3570d56c..2d28182ad6 100644
--- a/packaging/fedora/globus-openssl-module.spec
+++ b/packaging/fedora/globus-openssl-module.spec
@@ -3,7 +3,7 @@
Name: globus-openssl-module
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 5.2
+Version: 5.3
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus OpenSSL Module Wrapper
@@ -135,6 +135,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 5.3-1
+- Fix compiler warnings
+
* Tue Mar 10 2020 Mattias Ellert - 5.2-1
- Make makefiles exit sooner on errors
diff --git a/packaging/fedora/globus-proxy-utils.spec b/packaging/fedora/globus-proxy-utils.spec
index 891b3fdbf3..0ce5ff2c26 100644
--- a/packaging/fedora/globus-proxy-utils.spec
+++ b/packaging/fedora/globus-proxy-utils.spec
@@ -2,7 +2,7 @@
Name: globus-proxy-utils
%global _name %(echo %{name} | tr - _)
-Version: 7.4
+Version: 7.5
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus GSI Proxy Utility Programs
@@ -77,6 +77,10 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 7.5-1
+- Compile with OpenSSL 4
+- Fix compiler warnings
+
* Fri Jan 17 2025 Mattias Ellert - 7.4-1
- Fix incompatible pointer errors (gcc 15)
diff --git a/packaging/fedora/globus-rsl.spec b/packaging/fedora/globus-rsl.spec
index ab7493f0ed..f9dd104de4 100644
--- a/packaging/fedora/globus-rsl.spec
+++ b/packaging/fedora/globus-rsl.spec
@@ -3,7 +3,7 @@
Name: globus-rsl
%global soname 2
%global _name %(echo %{name} | tr - _)
-Version: 11.4
+Version: 11.5
Release: 1%{?dist}
Summary: Grid Community Toolkit - Resource Specification Language Library
@@ -142,6 +142,9 @@ make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 11.5-1
+- Fix doxygen warnings
+
* Tue Aug 29 2023 Mattias Ellert - 11.4-1
- Make library linking survive -Wl,--as-needed
diff --git a/packaging/fedora/globus-scheduler-event-generator.spec b/packaging/fedora/globus-scheduler-event-generator.spec
index e71a331500..178ce25eda 100644
--- a/packaging/fedora/globus-scheduler-event-generator.spec
+++ b/packaging/fedora/globus-scheduler-event-generator.spec
@@ -3,7 +3,7 @@
Name: globus-scheduler-event-generator
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 6.6
+Version: 6.7
Release: 1%{?dist}
Summary: Grid Community Toolkit - Scheduler Event Generator
@@ -239,6 +239,9 @@ fi
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 6.7-1
+- Fix doxygen warnings
+
* Fri Mar 01 2024 Mattias Ellert - 6.6-1
- Handle 64 bit time_t on 32 bit systems
diff --git a/packaging/fedora/globus-xio-gridftp-driver.spec b/packaging/fedora/globus-xio-gridftp-driver.spec
index 34c3b32111..838a11b861 100644
--- a/packaging/fedora/globus-xio-gridftp-driver.spec
+++ b/packaging/fedora/globus-xio-gridftp-driver.spec
@@ -2,7 +2,7 @@
Name: globus-xio-gridftp-driver
%global _name %(echo %{name} | tr - _)
-Version: 3.6
+Version: 3.7
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus XIO GridFTP Driver
@@ -152,6 +152,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 3.7-1
+- Fix compiler and doxygen warnings
+
* Fri Mar 11 2022 Mattias Ellert - 3.6-1
- Fix some compiler warnings
diff --git a/packaging/fedora/globus-xio-gridftp-multicast.spec b/packaging/fedora/globus-xio-gridftp-multicast.spec
index 4a33d498d1..be323ae5f2 100644
--- a/packaging/fedora/globus-xio-gridftp-multicast.spec
+++ b/packaging/fedora/globus-xio-gridftp-multicast.spec
@@ -2,7 +2,7 @@
Name: globus-xio-gridftp-multicast
%global _name %(echo %{name} | tr - _)
-Version: 2.2
+Version: 2.3
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus XIO GridFTP Multicast Driver
@@ -103,6 +103,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Tue May 19 2026 Mattias Ellert - 2.3-1
+- Fix compiler warnings
+
* Fri Mar 11 2022 Mattias Ellert - 2.2-1
- Fix some compiler warnings
diff --git a/packaging/fedora/globus-xio-pipe-driver.spec b/packaging/fedora/globus-xio-pipe-driver.spec
index 6822b12fd1..c8a1f753cf 100644
--- a/packaging/fedora/globus-xio-pipe-driver.spec
+++ b/packaging/fedora/globus-xio-pipe-driver.spec
@@ -2,7 +2,7 @@
Name: globus-xio-pipe-driver
%global _name %(echo %{name} | tr - _)
-Version: 4.1
+Version: 4.2
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus Pipe Driver
@@ -102,6 +102,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/pkgconfig/%{name}.pc
%changelog
+* Tue May 19 2026 Mattias Ellert - 4.2-1
+- Fix compiler warnings
+
* Thu Jul 18 2019 Mattias Ellert - 4.1-1
- Add AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS
diff --git a/packaging/fedora/globus-xio.spec b/packaging/fedora/globus-xio.spec
index ea5eda902e..8591875e45 100644
--- a/packaging/fedora/globus-xio.spec
+++ b/packaging/fedora/globus-xio.spec
@@ -3,7 +3,7 @@
Name: globus-xio
%global soname 0
%global _name %(echo %{name} | tr - _)
-Version: 6.6
+Version: 6.7
Release: 1%{?dist}
Summary: Grid Community Toolkit - Globus XIO Framework
@@ -140,6 +140,9 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 6.7-1
+- Fix compiler and doxygen warnings
+
* Fri Mar 11 2022 Mattias Ellert - 6.6-1
- Fix some compiler and doxygen warnings
diff --git a/packaging/fedora/globus-xioperf.spec b/packaging/fedora/globus-xioperf.spec
index a907654d12..24555591ad 100644
--- a/packaging/fedora/globus-xioperf.spec
+++ b/packaging/fedora/globus-xioperf.spec
@@ -2,7 +2,7 @@
Name: globus-xioperf
%global _name %(echo %{name} | tr - _)
-Version: 5.1
+Version: 5.2
Release: 1%{?dist}
Summary: Grid Community Toolkit - XIO Performance Tool
@@ -47,6 +47,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
%doc %{_pkgdocdir}/GLOBUS_LICENSE
%changelog
+* Tue May 19 2026 Mattias Ellert - 5.2-1
+- Fix compiler warnings
+
* Thu Jul 18 2019 Mattias Ellert - 5.1-1
- Add AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS
diff --git a/packaging/fedora/myproxy.spec b/packaging/fedora/myproxy.spec
index 852aa9e483..8eaa83ebd7 100644
--- a/packaging/fedora/myproxy.spec
+++ b/packaging/fedora/myproxy.spec
@@ -2,7 +2,7 @@
Name: myproxy
%global soname 6
-Version: 6.2.20
+Version: 6.2.21
Release: 1%{?dist}
Summary: Manage X.509 Public Key Infrastructure (PKI) security credentials
@@ -391,6 +391,10 @@ fi
%doc %{_pkgdocdir}/LICENSE*
%changelog
+* Tue May 19 2026 Mattias Ellert - 6.2.21-1
+- Compile with OpenSSL 4
+- Fix compiler warnings
+
* Fri Jan 17 2025 Mattias Ellert - 6.2.20-1
- Fix incompatible pointer errors (gcc 15)
diff --git a/xio/drivers/pipe/source/configure.ac b/xio/drivers/pipe/source/configure.ac
index 69d036f9cd..c004ec7ec8 100644
--- a/xio/drivers/pipe/source/configure.ac
+++ b/xio/drivers/pipe/source/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_xio_pipe_driver], [4.1],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_xio_pipe_driver], [4.2],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}])
AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}])
diff --git a/xio/drivers/pipe/source/globus_xio_pipe_driver.c b/xio/drivers/pipe/source/globus_xio_pipe_driver.c
index 8f476a4f08..b0f8c71b1c 100644
--- a/xio/drivers/pipe/source/globus_xio_pipe_driver.c
+++ b/xio/drivers/pipe/source/globus_xio_pipe_driver.c
@@ -28,7 +28,7 @@ GlobusDebugDefine(GLOBUS_XIO_PIPE);
GlobusXIOPipeDebugPrintf( \
GLOBUS_L_XIO_PIPE_DEBUG_TRACE, \
(_XIOSL("[%s] Entering\n"), _xio_name))
-
+
#define GlobusXIOPipeDebugExit() \
GlobusXIOPipeDebugPrintf( \
GLOBUS_L_XIO_PIPE_DEBUG_TRACE, \
@@ -70,7 +70,7 @@ typedef struct xio_l_pipe_attr_s
{
globus_bool_t use_blocking_io;
globus_xio_system_file_t infd;
- globus_xio_system_file_t outfd;
+ globus_xio_system_file_t outfd;
} xio_l_pipe_attr_t;
/* default attr */
@@ -194,7 +194,7 @@ globus_l_xio_pipe_attr_cntl(
case GLOBUS_XIO_PIPE_SET_OUT_HANDLE:
attr->outfd = va_arg(ap, globus_xio_system_file_t);
break;
-
+
default:
break;
}
@@ -208,13 +208,10 @@ globus_result_t
globus_l_xio_pipe_attr_destroy(
void * driver_attr)
{
- xio_l_pipe_attr_t * attr;
GlobusXIOName(globus_l_xio_pipe_attr_destroy);
GlobusXIOPipeDebugEnter();
- attr = (xio_l_pipe_attr_t *) driver_attr;
-
globus_free(driver_attr);
GlobusXIOPipeDebugExit();
@@ -232,9 +229,9 @@ globus_l_xio_pipe_handle_init(
{
globus_result_t result;
GlobusXIOName(globus_l_xio_pipe_handle_init);
-
+
GlobusXIOPipeDebugEnter();
-
+
*handle = (xio_l_pipe_handle_t *)
globus_calloc(1, sizeof(xio_l_pipe_handle_t));
if(!*handle)
@@ -242,7 +239,7 @@ globus_l_xio_pipe_handle_init(
result = GlobusXIOErrorMemory("handle");
goto error_handle;
}
-
+
globus_mutex_init(&(*handle)->lock, NULL);
(*handle)->use_blocking_io = attr->use_blocking_io;
(*handle)->infd = attr->infd;
@@ -253,7 +250,7 @@ globus_l_xio_pipe_handle_init(
error_handle:
GlobusXIOPipeDebugExitWithError();
- return result;
+ return result;
}
static
@@ -262,12 +259,12 @@ globus_l_xio_pipe_handle_destroy(
xio_l_pipe_handle_t * handle)
{
GlobusXIOName(globus_l_xio_pipe_handle_destroy);
-
+
GlobusXIOPipeDebugEnter();
-
+
globus_mutex_destroy(&handle->lock);
globus_free(handle);
-
+
GlobusXIOPipeDebugExit();
}
@@ -287,9 +284,9 @@ globus_l_xio_pipe_open(
xio_l_pipe_attr_t * attr;
globus_result_t result;
GlobusXIOName(globus_l_xio_pipe_open);
-
+
GlobusXIOPipeDebugEnter();
-
+
attr = (xio_l_pipe_attr_t *)
(driver_attr ? driver_attr : &xio_l_pipe_attr_default);
result = globus_l_xio_pipe_handle_init(&handle, attr);
@@ -314,9 +311,9 @@ globus_l_xio_pipe_open(
"globus_xio_system_file_init", result);
goto error_init;
}
-
+
globus_xio_driver_finished_open(handle, op, GLOBUS_SUCCESS);
-
+
GlobusXIOPipeDebugExit();
return GLOBUS_SUCCESS;
@@ -341,18 +338,18 @@ globus_l_xio_pipe_close(
GlobusXIOName(globus_l_xio_pipe_close);
GlobusXIOPipeDebugEnter();
-
+
handle = (xio_l_pipe_handle_t *) driver_specific_handle;
-
+
globus_xio_system_file_destroy(handle->in_system);
globus_xio_system_file_destroy(handle->out_system);
-
+
globus_xio_system_file_close(handle->infd);
globus_xio_system_file_close(handle->outfd);
-
+
globus_xio_driver_finished_close(op, GLOBUS_SUCCESS);
globus_l_xio_pipe_handle_destroy(handle);
-
+
GlobusXIOPipeDebugExit();
return GLOBUS_SUCCESS;
}
@@ -366,13 +363,13 @@ globus_l_xio_pipe_system_read_cb(
{
globus_xio_operation_t op;
GlobusXIOName(globus_l_xio_pipe_system_read_cb);
-
+
GlobusXIOPipeDebugEnter();
-
+
op = (globus_xio_operation_t) user_arg;
-
+
globus_xio_driver_finished_read(op, result, nbytes);
-
+
GlobusXIOPipeDebugExit();
}
@@ -393,9 +390,9 @@ globus_l_xio_pipe_read(
GlobusXIOName(globus_l_xio_pipe_read);
GlobusXIOPipeDebugEnter();
-
+
handle = (xio_l_pipe_handle_t *) driver_specific_handle;
-
+
/* if buflen and waitfor are both 0, we behave like register select */
if((globus_xio_operation_get_wait_for(op) == 0 &&
(iovec_count > 1 || iovec[0].iov_len > 0)) ||
@@ -409,7 +406,7 @@ globus_l_xio_pipe_read(
iovec_count,
globus_xio_operation_get_wait_for(op),
&nbytes);
-
+
globus_xio_driver_finished_read(op, result, nbytes);
result = GLOBUS_SUCCESS;
}
@@ -425,7 +422,7 @@ globus_l_xio_pipe_read(
globus_l_xio_pipe_system_read_cb,
op);
}
-
+
GlobusXIOPipeDebugExit();
return result;
}
@@ -439,13 +436,13 @@ globus_l_xio_pipe_system_write_cb(
{
globus_xio_operation_t op;
GlobusXIOName(globus_l_xio_pipe_system_write_cb);
-
+
GlobusXIOPipeDebugEnter();
-
+
op = (globus_xio_operation_t) user_arg;
-
+
globus_xio_driver_finished_write(op, result, nbytes);
-
+
GlobusXIOPipeDebugExit();
}
@@ -464,11 +461,11 @@ globus_l_xio_pipe_write(
globus_size_t nbytes;
globus_result_t result;
GlobusXIOName(globus_l_xio_pipe_write);
-
+
GlobusXIOPipeDebugEnter();
-
+
handle = (xio_l_pipe_handle_t *) driver_specific_handle;
-
+
/* if buflen and waitfor are both 0, we behave like register select */
if((globus_xio_operation_get_wait_for(op) == 0 &&
(iovec_count > 1 || iovec[0].iov_len > 0)) ||
@@ -482,7 +479,7 @@ globus_l_xio_pipe_write(
iovec_count,
globus_xio_operation_get_wait_for(op),
&nbytes);
-
+
globus_xio_driver_finished_write(op, result, nbytes);
result = GLOBUS_SUCCESS;
}
@@ -498,7 +495,7 @@ globus_l_xio_pipe_write(
globus_l_xio_pipe_system_write_cb,
op);
}
-
+
GlobusXIOPipeDebugExit();
return result;
}
@@ -520,11 +517,11 @@ globus_l_xio_pipe_init(
globus_xio_driver_t driver;
globus_result_t result;
GlobusXIOName(globus_l_xio_pipe_init);
-
+
GlobusXIOPipeDebugEnter();
-
+
/* I dont support any driver options, so I'll ignore the ap */
-
+
result = globus_xio_driver_init(&driver, "file", GLOBUS_NULL);
if(result != GLOBUS_SUCCESS)
{
@@ -553,7 +550,7 @@ globus_l_xio_pipe_init(
pipe_l_string_opts_table);
*out_driver = driver;
-
+
GlobusXIOPipeDebugExit();
return GLOBUS_SUCCESS;
@@ -568,11 +565,11 @@ globus_l_xio_pipe_destroy(
globus_xio_driver_t driver)
{
GlobusXIOName(globus_l_xio_pipe_destroy);
-
+
GlobusXIOPipeDebugEnter();
-
+
globus_xio_driver_destroy(driver);
-
+
GlobusXIOPipeDebugExit();
}
@@ -586,13 +583,13 @@ int
globus_l_xio_pipe_activate(void)
{
int rc;
-
+
GlobusXIOName(globus_l_xio_pipe_activate);
-
+
GlobusDebugInit(GLOBUS_XIO_PIPE, TRACE INFO);
-
+
GlobusXIOPipeDebugEnter();
-
+
rc = globus_module_activate(GLOBUS_XIO_SYSTEM_MODULE);
if(rc != GLOBUS_SUCCESS)
{
@@ -602,9 +599,9 @@ globus_l_xio_pipe_activate(void)
xio_l_pipe_attr_default.infd = GetStdHandle(STD_INPUT_HANDLE);
xio_l_pipe_attr_default.outfd = GetStdHandle(STD_OUTPUT_HANDLE);
# endif
-
+
GlobusXIORegisterDriver(pipe);
-
+
GlobusXIOPipeDebugExit();
return GLOBUS_SUCCESS;
@@ -619,14 +616,14 @@ int
globus_l_xio_pipe_deactivate(void)
{
GlobusXIOName(globus_l_xio_pipe_deactivate);
-
+
GlobusXIOPipeDebugEnter();
-
+
GlobusXIOUnRegisterDriver(pipe);
globus_module_deactivate(GLOBUS_XIO_SYSTEM_MODULE);
-
+
GlobusXIOPipeDebugExit();
GlobusDebugDestroy(GLOBUS_XIO_PIPE);
-
+
return GLOBUS_SUCCESS;
}
diff --git a/xio/src/builtins/http/globus_i_xio_http.h b/xio/src/builtins/http/globus_i_xio_http.h
index b4e3968190..c8b93f28b6 100644
--- a/xio/src/builtins/http/globus_i_xio_http.h
+++ b/xio/src/builtins/http/globus_i_xio_http.h
@@ -102,7 +102,7 @@ typedef struct
/**
* buffer to hold the chunk size line
*/
- globus_byte_t chunk_size_buffer[64];
+ globus_byte_t chunk_size_buffer[64];
}
globus_i_xio_http_operation_info_t;
@@ -335,12 +335,12 @@ typedef struct globus_i_xio_http_handle_s
* contain unparsed data
*/
globus_size_t read_buffer_valid;
-
+
/**
* Operation used for closing, when an error occurs at open time.
*/
globus_xio_operation_t close_operation;
-
+
/**
* Remaining-to-be-read chunk.
*/
@@ -372,7 +372,7 @@ typedef struct globus_i_xio_http_handle_s
*/
globus_xio_operation_t response_read_operation;
-
+
globus_i_xio_http_operation_info_t read_operation;
globus_i_xio_http_operation_info_t write_operation;
@@ -402,7 +402,7 @@ typedef struct globus_i_xio_http_handle_s
* drops us
*/
globus_bool_t reopen_in_progress;
-
+
/* error from internal response read, usually with a broken persistent
* connection
*/
@@ -437,7 +437,7 @@ globus_i_xio_http_copy_blob(
extern
char *
globus_i_xio_http_find_eol(
- const char * blob,
+ char * blob,
globus_size_t blob_length);
extern
@@ -662,7 +662,7 @@ globus_result_t
globus_i_xio_http_server_read_next_request(
globus_i_xio_http_handle_t * http_handle);
-/* globus_xio_http_target.c */
+/* globus_xio_http_target.c */
extern
globus_result_t
globus_i_xio_http_target_init(
@@ -711,7 +711,7 @@ globus_result_t
globus_l_xio_http_client_parse_response(
globus_i_xio_http_handle_t * http_handle,
globus_bool_t * done);
-
+
void
globus_l_xio_http_client_read_response_callback(
globus_xio_operation_t op,
@@ -748,7 +748,7 @@ globus_i_xio_http_close(
void * attr,
globus_xio_operation_t op);
-extern
+extern
globus_result_t
globus_i_xio_http_close_internal(
globus_i_xio_http_handle_t * http_handle);
diff --git a/xio/src/builtins/http/globus_xio_http.c b/xio/src/builtins/http/globus_xio_http.c
index 1b7d71a240..14841c526d 100644
--- a/xio/src/builtins/http/globus_xio_http.c
+++ b/xio/src/builtins/http/globus_xio_http.c
@@ -71,7 +71,7 @@ globus_l_xio_http_init(
globus_i_xio_http_read,
globus_i_xio_http_write,
globus_i_xio_http_handle_cntl,
- NULL);
+ NULL);
globus_xio_driver_set_server(
driver,
@@ -171,6 +171,8 @@ globus_i_xio_http_copy_blob(
}
/* globus_l_xio_http_copy_blob() */
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Determine whether an HTTP method should contain an entity.
* @ingroup globus_i_xio_http_util
@@ -274,13 +276,13 @@ globus_i_xio_http_guess_version(
*/
char *
globus_i_xio_http_find_eol(
- const char * blob,
+ char * blob,
globus_size_t blob_length)
{
char * result;
globus_size_t skip = 0;
- while (((skip + 1) < blob_length) &&
+ while (((skip + 1) < blob_length) &&
(result = memchr(blob + skip, '\r', blob_length-skip)) != NULL)
{
if (result+1 == (blob + skip + blob_length))
@@ -291,7 +293,7 @@ globus_i_xio_http_find_eol(
{
return result;
}
- else
+ else
{
skip += (result - blob + 1);
}
@@ -368,7 +370,7 @@ globus_i_xio_http_clean_read_buffer(
+ http_handle->read_buffer_offset
+ http_handle->read_buffer_valid;
- http_handle->read_iovec.iov_len =
+ http_handle->read_iovec.iov_len =
http_handle->read_buffer.iov_len
- http_handle->read_buffer_offset
- http_handle->read_buffer_valid;
@@ -379,6 +381,8 @@ globus_i_xio_http_clean_read_buffer(
}
/* globus_i_xio_http_cleanup_read_buffer() */
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
+
GlobusXIODefineDriver(
http,
globus_l_xio_http_init,
@@ -409,9 +413,9 @@ globus_l_xio_http_deactivate(void)
{
globus_i_xio_http_handle_t * http_handle;
globus_result_t result;
-
+
GlobusXIOUnRegisterDriver(http);
-
+
globus_mutex_lock(&globus_i_xio_http_cached_handle_mutex);
while (!globus_list_empty(globus_i_xio_http_cached_handles))
{
diff --git a/xio/src/builtins/http/globus_xio_http_attr.c b/xio/src/builtins/http/globus_xio_http_attr.c
index e58a8db750..94de4ee2db 100644
--- a/xio/src/builtins/http/globus_xio_http_attr.c
+++ b/xio/src/builtins/http/globus_xio_http_attr.c
@@ -23,6 +23,8 @@
*/
#endif
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Allocate and initialize an HTTP attribute
* @ingroup globus_i_xio_http_attr
@@ -31,7 +33,7 @@
* driver via globus_xio_attr_init().
*
* @param out_attr
- * Pointer value will be set to point to a
+ * Pointer value will be set to point to a
* newly allocated and initilized #globus_i_xio_http_attr_t
* structure.
*
@@ -355,3 +357,5 @@ globus_i_xio_http_attr_destroy(
return GLOBUS_SUCCESS;
}
/* globus_i_xio_http_attr_destroy() */
+
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
diff --git a/xio/src/builtins/http/globus_xio_http_client.c b/xio/src/builtins/http/globus_xio_http_client.c
index da6fa218b6..225083a20f 100644
--- a/xio/src/builtins/http/globus_xio_http_client.c
+++ b/xio/src/builtins/http/globus_xio_http_client.c
@@ -36,6 +36,8 @@ globus_result_t
globus_l_xio_http_cleanup_cancel(
globus_i_xio_http_handle_t * http_handle);
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Client-side connection open callback
* @ingroup globus_i_xio_http_client
@@ -47,15 +49,13 @@ globus_l_xio_http_cleanup_cancel(
* If this function succeeds, the open will remain unfinished until that
* write completes. If an error happens, this function will close the handle
* internally and call globus_xio_driver_finished_open() before returning.
- *
+ *
* @param op
* operation associated with the open call.
* @param result
* Lower-level protocol result from open.
* @param user_arg
- * A void pointer pointing to a #globus_i_xio_http_driver_t
- *
- * @return void
+ * A void pointer pointing to a #globus_i_xio_http_driver_t
*/
void
globus_i_xio_http_client_open_callback(
@@ -291,7 +291,7 @@ globus_i_xio_http_client_write_request(
strlen(http_handle->target_info.host),
free_iovecs_exit);
- if (http_handle->target_info.port != 0 &&
+ if (http_handle->target_info.port != 0 &&
http_handle->target_info.port != 80)
{
char port_buffer[7];
@@ -316,7 +316,7 @@ globus_i_xio_http_client_write_request(
&http_handle->request_info.headers))
{
if ((http_handle->request_info.http_version ==
- GLOBUS_XIO_HTTP_VERSION_1_0) ||
+ GLOBUS_XIO_HTTP_VERSION_1_0) ||
((http_handle->request_info.headers.transfer_encoding ==
GLOBUS_XIO_HTTP_TRANSFER_ENCODING_IDENTITY) &&
GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(
@@ -339,7 +339,7 @@ globus_i_xio_http_client_write_request(
size_buffer = globus_common_create_string(
"%"GLOBUS_OFF_T_FORMAT"\r\n",
http_handle->request_info.headers.content_length);
-
+
if (size_buffer == NULL)
{
result = GlobusXIOErrorMemory("iovec.iov_base");
@@ -457,7 +457,7 @@ globus_i_xio_http_client_write_request(
/* globus_i_xio_http_client_write_request() */
/**
- * Request Written Callback
+ * Request Written Callback
* @ingroup globus_i_xio_http_write_request_callback
*
* Called when the response has been completely written by the transport.
@@ -476,8 +476,6 @@ globus_i_xio_http_client_write_request(
* Number of bytes in the message that were written.
* @param user_arg
* Void pointer containing the #globus_i_xio_http_handle_t.
- *
- * @return void
*/
static
void
@@ -660,10 +658,7 @@ globus_l_xio_http_client_write_request_callback(
* @param user_arg
* Void * pointing to the #globus_i_xio_http_handle_t associated
* with this response.
- *
- * @return void
*/
-
void
globus_l_xio_http_client_read_response_callback(
globus_xio_operation_t op,
@@ -694,7 +689,7 @@ globus_l_xio_http_client_read_response_callback(
response_error = globus_error_get(result);
http_handle->response_info.status_code = 500;
- http_handle->response_info.reason_phrase =
+ http_handle->response_info.reason_phrase =
globus_error_print_friendly(response_error);
if (http_handle->write_operation.operation != NULL)
@@ -716,7 +711,7 @@ globus_l_xio_http_client_read_response_callback(
http_handle->pending_error = globus_object_copy(response_error);
http_handle->parse_state = GLOBUS_XIO_HTTP_EOF;
http_handle->send_state = GLOBUS_XIO_HTTP_EOF;
-
+
/* Set metadata on this read to contain the response info */
descriptor = globus_xio_operation_get_data_descriptor(op, GLOBUS_TRUE);
if (descriptor != NULL)
@@ -726,7 +721,7 @@ globus_l_xio_http_client_read_response_callback(
&descriptor->response,
&http_handle->response_info);
}
-
+
/* don't go to error exit yet because we may need to clean up
* the cancel info
*/
@@ -823,13 +818,13 @@ globus_l_xio_http_client_read_response_callback(
}
}
- if(http_handle->response_info.status_code > 199 ||
+ if(http_handle->response_info.status_code > 199 ||
http_handle->response_info.status_code < 100)
{
globus_xio_driver_operation_destroy(http_handle->response_read_operation);
http_handle->response_read_operation = NULL;
}
-
+
globus_mutex_unlock(&http_handle->mutex);
if (finish_read)
@@ -938,7 +933,7 @@ globus_l_xio_http_client_read_response_callback(
* @ingroup globus_i_xio_http_client
*
* Parses the response line and then uses globus_i_xio_http_header_parse() to
- * parse the header block. If the entire response header section is read,
+ * parse the header block. If the entire response header section is read,
* the boolean pointed to by @a done will be modified to be GLOBUS_TRUE.
*
* Called with mutex locked.
@@ -951,7 +946,7 @@ globus_l_xio_http_client_read_response_callback(
* globus_i_xio_http_header_parse().
* @retval GLOBUS_SUCCESS
* No parsing errors occurred while parsing the status line or headers.
- * Parsing may still be incomplete, depending on the final value of
+ * Parsing may still be incomplete, depending on the final value of
* @a done.
* @retval ::GLOBUS_XIO_HTTP_ERROR_PARSE
* Parse error reading the HTTP Status line
@@ -1005,7 +1000,7 @@ globus_l_xio_http_client_parse_response(
goto error_exit;
}
- http_handle->response_info.http_version =
+ http_handle->response_info.http_version =
globus_i_xio_http_guess_version(http_major, http_minor);
current_offset += parsed;
@@ -1023,7 +1018,7 @@ globus_l_xio_http_client_parse_response(
goto error_exit;
}
-
+
current_offset += parsed;
/* Reason Phrase */
@@ -1054,7 +1049,7 @@ globus_l_xio_http_client_parse_response(
{
http_handle->parse_state = GLOBUS_XIO_HTTP_STATUS_LINE;
}
-
+
return result;
error_exit:
@@ -1120,7 +1115,7 @@ globus_l_xio_http_cleanup_cancel(
else
{
/* Cancel callback occurred in another thread. That thread will
- * try to cancel this operation. We are obliged to free the
+ * try to cancel this operation. We are obliged to free the
* cancel info.
*/
@@ -1133,3 +1128,5 @@ globus_l_xio_http_cleanup_cancel(
return result;
}
+
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
diff --git a/xio/src/builtins/http/globus_xio_http_handle.c b/xio/src/builtins/http/globus_xio_http_handle.c
index 1111ad278f..6261e5c829 100644
--- a/xio/src/builtins/http/globus_xio_http_handle.c
+++ b/xio/src/builtins/http/globus_xio_http_handle.c
@@ -31,6 +31,8 @@ globus_l_xio_http_write_eof_callback(
globus_size_t nbytes,
void * user_arg);
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Allocate and initialize an HTTP handle
* @ingroup globus_i_xio_http_handle
@@ -227,8 +229,6 @@ globus_i_xio_http_handle_reinit(
*
* @param http_handle
* Handle to be destroyed.
- *
- * @return void
*/
void
globus_i_xio_http_handle_destroy(
@@ -282,7 +282,7 @@ globus_i_xio_http_handle_destroy(
* @retval GLOBUS_XIO_ERROR_MEMORY
* The command failed due to memory constraints.
* @retval GLOBUS_XIO_ERROR_PARAMETER
- * Invalid @a cmd parameter or invlaid value of cmd-specific parameters
+ * Invalid @a cmd parameter or invlaid value of cmd-specific parameters
* in @a ap
*/
globus_result_t
@@ -438,6 +438,8 @@ globus_i_xio_http_handle_cntl(
}
/* globus_i_xio_http_handle_cntl() */
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
+
/**
* Called with mutex locked
*/
@@ -446,9 +448,8 @@ globus_i_xio_http_set_end_of_entity(
globus_i_xio_http_handle_t * http_handle)
{
globus_result_t result = GLOBUS_SUCCESS;
- globus_i_xio_http_header_info_t * headers;
static globus_xio_iovec_t end_of_body_iovec = {
- .iov_base = "0\r\n\r\n",
+ .iov_base = "0\r\n\r\n",
.iov_len = 5
};
GlobusXIOName(globus_i_xio_http_set_end_of_entity);
@@ -459,15 +460,7 @@ globus_i_xio_http_set_end_of_entity(
goto error_exit;
}
- else if (http_handle->target_info.is_client)
- {
- headers = &http_handle->request_info.headers;
- }
- else
- {
- headers = &http_handle->response_info.headers;
- }
-
+
if (http_handle->send_state == GLOBUS_XIO_HTTP_STATUS_LINE)
{
/* To send an empty response from server */
diff --git a/xio/src/builtins/http/globus_xio_http_header.c b/xio/src/builtins/http/globus_xio_http_header.c
index f5819e7839..5b53e2725d 100644
--- a/xio/src/builtins/http/globus_xio_http_header.c
+++ b/xio/src/builtins/http/globus_xio_http_header.c
@@ -23,6 +23,8 @@
*/
#endif
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Destroy an HTTP Header
* @ingroup globus_i_xio_http_header
@@ -33,8 +35,6 @@
*
* @param header
* A void * pointing to the header to be freed.
- *
- * @return void
*/
extern
void
@@ -76,8 +76,6 @@ globus_i_xio_http_header_destroy(
* @param src_datum
* A void * pointing to the HTTP header structure in the
* original hashtable to copy.
- *
- * @return void
*/
extern
void
@@ -264,7 +262,7 @@ globus_i_xio_http_header_parse(
{
http_handle->parse_state = GLOBUS_XIO_HTTP_CHUNK_LINE;
}
- else if ((http_handle->target_info.is_client &&
+ else if ((http_handle->target_info.is_client &&
http_handle->response_info.http_version
== GLOBUS_XIO_HTTP_VERSION_1_0) ||
GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(headers))
@@ -295,3 +293,5 @@ globus_i_xio_http_header_parse(
return result;
}
/* globus_i_xio_http_header_parse() */
+
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
diff --git a/xio/src/builtins/http/globus_xio_http_header_info.c b/xio/src/builtins/http/globus_xio_http_header_info.c
index 64ca01e973..af1189260e 100644
--- a/xio/src/builtins/http/globus_xio_http_header_info.c
+++ b/xio/src/builtins/http/globus_xio_http_header_info.c
@@ -23,6 +23,8 @@
*/
#endif
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Initialize an HTTP header info structure
* @ingroup globus_i_xio_http_header_info
@@ -71,8 +73,6 @@ globus_i_xio_http_header_info_init(
*
* @param header_info
* Header information structure to destroy.
- *
- * @return void
*/
void
globus_i_xio_http_header_info_destroy(
@@ -142,7 +142,7 @@ globus_i_xio_http_header_info_copy(
* Adds a new header to a header info structure, or updates the value of an
* existing header. Copies of the name and value will be stored in a
* #globus_xio_http_header_t in a hashtable in the header info structure.
- *
+ *
* @param headers
* Pointer to the header info structure.
* @param header_name
@@ -229,7 +229,7 @@ globus_i_xio_http_header_info_set_header(
{
store = GLOBUS_TRUE;
}
-
+
if(store)
{
/*
@@ -308,3 +308,5 @@ globus_i_xio_http_header_info_set_header(
return result;
}
/* globus_l_xio_http_header_info_set_header() */
+
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
diff --git a/xio/src/builtins/http/globus_xio_http_request.c b/xio/src/builtins/http/globus_xio_http_request.c
index 067875940b..d4a1e8f235 100644
--- a/xio/src/builtins/http/globus_xio_http_request.c
+++ b/xio/src/builtins/http/globus_xio_http_request.c
@@ -23,6 +23,8 @@
*/
#endif
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Initialize an HTTP request
* @ingroup globus_i_xio_http_request
@@ -57,8 +59,6 @@ globus_i_xio_http_request_init(
*
* @param request
* Request structure to destroy.
- *
- * @return void
*/
void
globus_i_xio_http_request_destroy(
@@ -168,3 +168,5 @@ globus_i_xio_http_request_copy(
return res;
}
/* globus_i_xio_http_request_copy() */
+
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
diff --git a/xio/src/builtins/http/globus_xio_http_response.c b/xio/src/builtins/http/globus_xio_http_response.c
index ec477477ad..0951ae16af 100644
--- a/xio/src/builtins/http/globus_xio_http_response.c
+++ b/xio/src/builtins/http/globus_xio_http_response.c
@@ -23,6 +23,8 @@
*/
#endif
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Initialize an HTTP response
* @ingroup globus_i_xio_http_response
@@ -65,8 +67,6 @@ globus_i_xio_http_response_init(
*
* @param response
* Response structure to destroy.
- *
- * @return void
*/
void
globus_i_xio_http_response_destroy(
@@ -153,3 +153,5 @@ globus_i_xio_http_response_copy(
return res;
}
/* globus_i_xio_http_response_copy() */
+
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
diff --git a/xio/src/builtins/http/globus_xio_http_server.c b/xio/src/builtins/http/globus_xio_http_server.c
index 99736b3b50..41db9f877a 100644
--- a/xio/src/builtins/http/globus_xio_http_server.c
+++ b/xio/src/builtins/http/globus_xio_http_server.c
@@ -44,11 +44,13 @@ globus_l_xio_http_server_write_response_callback(
globus_size_t nbytes,
void * user_arg);
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Accept an HTTP request
* @ingroup globus_i_xio_http_server
*
- * Passes the request to the transport driver. In the callback,
+ * Passes the request to the transport driver. In the callback,
* the request target information will be generated.
*
* @param driver_server
@@ -87,8 +89,6 @@ globus_i_xio_http_accept(
* @param user_arg
* Not used.
*
- * @return void
- *
* @todo When implemented in the XIO driver framework, parse the request
* header before returning from this, so the target is populated with
* meaningful information for the user. This will help enable persistent
@@ -103,7 +103,7 @@ globus_l_xio_http_accept_callback(
{
globus_i_xio_http_target_t * target_info = NULL;
GlobusXIOName(globus_l_xio_http_accept_callback);
-
+
if (result == GLOBUS_SUCCESS)
{
target_info = globus_i_xio_http_target_new();
@@ -134,8 +134,6 @@ globus_l_xio_http_accept_callback(
* @param user_arg
* Void * pointing to a #globus_i_xio_http_handle_t associated with
* this open.
- *
- * @return void
*/
void
globus_i_xio_http_server_open_callback(
@@ -194,7 +192,7 @@ globus_i_xio_http_server_open_callback(
*
* @retval GLOBUS_SUCCESS
* Response was passed to the transport for writing. If this was generated
- * by a user writing data, then the write will occur after the
+ * by a user writing data, then the write will occur after the
* globus_l_xio_http_server_write_response_callback() has been called.
* @retval GLOBUS_XIO_ERROR_MEMORY
* Unable to compose the response due to memory constraints.
@@ -299,7 +297,7 @@ globus_i_xio_http_server_write_response(
GLOBUS_I_XIO_HTTP_HEADER_IS_CONTENT_LENGTH_SET(
&http_handle->response_info.headers)))
{
- http_handle->response_info.headers.flags |=
+ http_handle->response_info.headers.flags |=
GLOBUS_I_XIO_HTTP_HEADER_CONNECTION_CLOSE;
GLOBUS_XIO_HTTP_COPY_BLOB(&iovecs,
@@ -498,8 +496,6 @@ globus_i_xio_http_server_write_response(
* finished. If the response was triggered by the
* GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY control, then the operation
* is simply destroyed.
- *
- * @return void
*/
static
void
@@ -683,7 +679,7 @@ globus_l_xio_http_server_parse_request(
globus_assert(rc == 1);
current_offset += parsed;
-
+
rc = sscanf(current_offset, "%*s %n", &parsed);
if (rc < 0)
{
@@ -740,6 +736,8 @@ globus_l_xio_http_server_parse_request(
}
/* globus_l_xio_http_server_parse_request() */
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
+
void
globus_i_xio_http_server_read_request_callback(
globus_xio_operation_t op,
@@ -809,7 +807,7 @@ globus_i_xio_http_server_read_request_callback(
if (descriptor == NULL)
{
result = GlobusXIOErrorMemory("descriptor");
-
+
goto error_exit;
}
globus_i_xio_http_request_destroy(&descriptor->request);
@@ -848,7 +846,7 @@ globus_i_xio_http_server_read_request_callback(
http_handle->read_operation.nbytes = 0;
globus_mutex_unlock(&http_handle->mutex);
-
+
globus_xio_driver_finished_read(op, result, nbytes);
return;
diff --git a/xio/src/builtins/http/globus_xio_http_target.c b/xio/src/builtins/http/globus_xio_http_target.c
index 58732ae780..c87486efd9 100644
--- a/xio/src/builtins/http/globus_xio_http_target.c
+++ b/xio/src/builtins/http/globus_xio_http_target.c
@@ -23,6 +23,8 @@
*/
#endif
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Allocate a new target
* @ingroup globus_i_xio_http_target
@@ -108,7 +110,7 @@ globus_i_xio_http_target_init(
else
{
res = GlobusXIOErrorParameter("port");
-
+
goto free_target_exit;
}
}
@@ -219,6 +221,8 @@ globus_i_xio_http_target_destroy(
}
/* globus_i_xio_http_target_destroy() */
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
+
extern
void
globus_i_xio_http_target_destroy_internal(
diff --git a/xio/src/builtins/http/globus_xio_http_transform.c b/xio/src/builtins/http/globus_xio_http_transform.c
index 6a31a3e903..cc1162e777 100644
--- a/xio/src/builtins/http/globus_xio_http_transform.c
+++ b/xio/src/builtins/http/globus_xio_http_transform.c
@@ -94,9 +94,11 @@ void
globus_l_xio_http_read_timeout_callback(
void * user_arg);
+#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+
/**
* Open an HTTP URI
- * @ingroup globus_i_xio_http_transform
+ * @ingroup globus_i_xio_http_transform
*
* Opens a new connection to handle an HTTP request. Allocates a handle
* and then passes the open on to the transport. In the callback called
@@ -131,7 +133,7 @@ globus_i_xio_http_open(
globus_i_xio_http_target_t * target = NULL;
globus_i_xio_http_handle_t * http_handle;
GlobusXIOName(globus_i_xio_http_open);
-
+
if(link)
{
target = (globus_i_xio_http_target_t *) link;
@@ -144,7 +146,7 @@ globus_i_xio_http_open(
goto error;
}
}
-
+
http_handle = globus_l_xio_http_find_cached_handle(target, attr);
if (http_handle != NULL)
@@ -155,7 +157,7 @@ globus_i_xio_http_open(
{
result = globus_l_xio_http_open(contact_info, target, attr, op);
}
-
+
if(!link && target)
{
globus_i_xio_http_target_destroy(target);
@@ -279,11 +281,11 @@ globus_l_xio_http_open(
open_callback = globus_i_xio_http_server_open_callback;
http_handle->send_state = GLOBUS_XIO_HTTP_STATUS_LINE;
}
-
+
memcpy(&new_contact_info, contact_info, sizeof(new_contact_info));
snprintf(port_buf, sizeof(port_buf), "%hu", http_handle->target_info.port);
new_contact_info.port = port_buf;
-
+
http_handle->handle = globus_xio_operation_get_driver_handle(op);
result = globus_xio_driver_pass_open(
@@ -377,7 +379,7 @@ globus_l_xio_http_find_cached_handle(
* Operation associated with the read.
*
* @return
- * This function returns GLOBUS_SUCCESS,
+ * This function returns GLOBUS_SUCCESS,
* GLOBUS_XIO_ERROR_ALREADY_REGISTERED, and GLOBUS_XIO_ERROR_EOF
* errors directly.
*
@@ -425,7 +427,7 @@ globus_i_xio_http_read(
globus_object_copy(http_handle->pending_error));
goto error_exit;
}
-
+
if (http_handle->read_operation.operation != NULL)
{
/* Only one read in progress per handle, sorry */
@@ -447,7 +449,7 @@ globus_i_xio_http_read(
for (i = 0; i < iovec_count; i++)
{
- http_handle->read_operation.iov[i].iov_base =
+ http_handle->read_operation.iov[i].iov_base =
iovec[i].iov_base;
http_handle->read_operation.iov[i].iov_len =
iovec[i].iov_len;
@@ -475,7 +477,7 @@ globus_i_xio_http_read(
}
http_handle->cancellation->user_read_op = op;
- http_handle->cancellation->internal_op =
+ http_handle->cancellation->internal_op =
http_handle->response_read_operation;
http_handle->cancellation->http_handle = http_handle;
http_handle->cancellation->driver_handle =
@@ -523,7 +525,7 @@ globus_i_xio_http_read(
if (http_handle->read_buffer.iov_base == NULL)
{
result = GlobusXIOErrorMemory("read_buffer");
-
+
goto error_exit;
}
}
@@ -537,7 +539,7 @@ globus_i_xio_http_read(
}
http_handle->parse_state = GLOBUS_XIO_HTTP_REQUEST_LINE;
}
-
+
result = globus_xio_driver_pass_read(
op,
&http_handle->read_buffer,
@@ -578,7 +580,7 @@ globus_i_xio_http_read(
}
/*
* Either we've read enough, hit end of chunk, no entity was present,
- * or pass to transport failed. Call finished_read
+ * or pass to transport failed. Call finished_read
*/
op = http_handle->read_operation.operation;
@@ -645,8 +647,6 @@ globus_i_xio_http_read(
* @param registered_again
* Set to GLOBUS_TRUE by this function if the read operation was passed
* down again as a result of a partial read of data.
- *
- * @return void
*/
globus_result_t
globus_i_xio_http_parse_residue(
@@ -672,10 +672,10 @@ globus_i_xio_http_parse_residue(
headers = &http_handle->request_info.headers;
}
- if (http_handle->read_operation.iovcnt == 0 ||
+ if (http_handle->read_operation.iovcnt == 0 ||
http_handle->parse_state == GLOBUS_XIO_HTTP_EOF)
{
- http_handle->read_operation.wait_for = 0;
+ http_handle->read_operation.wait_for = 0;
goto finish;
}
@@ -779,7 +779,7 @@ globus_i_xio_http_parse_residue(
{
nbytes = http_handle->read_operation.wait_for;
}
-
+
result = globus_xio_driver_pass_read(
http_handle->read_operation.operation,
http_handle->read_operation.iov,
@@ -790,8 +790,8 @@ globus_i_xio_http_parse_residue(
if (result == GLOBUS_SUCCESS)
{
*registered_again = GLOBUS_TRUE;
- }
-
+ }
+
}
break;
case GLOBUS_XIO_HTTP_STATUS_LINE:
@@ -808,7 +808,7 @@ globus_i_xio_http_parse_residue(
{
goto finish;
}
-
+
result = globus_xio_driver_pass_read(
http_handle->response_read_operation,
&http_handle->read_iovec,
@@ -816,7 +816,7 @@ globus_i_xio_http_parse_residue(
1,
globus_l_xio_http_client_read_response_callback,
http_handle);
-
+
if (result != GLOBUS_SUCCESS)
{
goto finish;
@@ -969,8 +969,6 @@ globus_l_xio_http_copy_residue(
* Number of bytes read by the transport.
* @param user_arg
* Void pointer pointing to an HTTP handle.
- *
- * @return void
*/
static
void
@@ -1057,8 +1055,6 @@ globus_l_xio_http_read_callback(
* Number of bytes read by the transport.
* @param user_arg
* Void pointer pointing to an HTTP handle.
- *
- * @return void
*/
static
void
@@ -1111,7 +1107,7 @@ globus_l_xio_http_read_chunk_header_callback(
}
/*
* Either we've read enough, hit end of chunk, no entity was present,
- * or pass to transport failed. Call finished_read
+ * or pass to transport failed. Call finished_read
*/
op = http_handle->read_operation.operation;
@@ -1138,7 +1134,7 @@ globus_l_xio_http_read_chunk_header_callback(
* @ingroup globus_i_xio_http_transform
*
* Parse the chunk size, end-of-chunk CRLF, or chunk footers, out of the
- * handle's read buffer, depending on the current parse state.
+ * handle's read buffer, depending on the current parse state.
*
* @param http_handle
* Handle associated with this parsing.
@@ -1211,7 +1207,7 @@ globus_l_xio_http_parse_chunk_header(
break;
}
-
+
/* FALLSTHROUGH */
case GLOBUS_XIO_HTTP_CHUNK_LINE:
*eol = '\0';
@@ -1367,7 +1363,7 @@ globus_l_xio_http_parse_chunk_header(
* Operation associated with the write.
*
* @return
- * This function returns GLOBUS_SUCCESS,
+ * This function returns GLOBUS_SUCCESS,
* GLOBUS_XIO_ERROR_ALREADY_REGISTERED, and GLOBUS_XIO_ERROR_EOF
* errors directly. Other errors may be returned from
* globus_i_xio_http_server_write_response(),
@@ -1393,18 +1389,8 @@ globus_i_xio_http_write(
{
globus_i_xio_http_handle_t * http_handle = handle;
globus_result_t result = GLOBUS_SUCCESS;
- globus_i_xio_http_header_info_t * headers;
GlobusXIOName(globus_i_xio_http_write);
- if (http_handle->target_info.is_client)
- {
- headers = &http_handle->request_info.headers;
- }
- else
- {
- headers = &http_handle->response_info.headers;
- }
-
globus_mutex_lock(&http_handle->mutex);
if (http_handle->pending_error)
@@ -1414,7 +1400,7 @@ globus_i_xio_http_write(
}
else
{
-
+
switch (http_handle->send_state)
{
case GLOBUS_XIO_HTTP_STATUS_LINE:
@@ -1428,7 +1414,7 @@ globus_i_xio_http_write(
case GLOBUS_XIO_HTTP_CLOSE:
result = GlobusXIOHttpErrorNoEntity();
break;
-
+
case GLOBUS_XIO_HTTP_CHUNK_BODY:
if (http_handle->write_operation.operation != NULL)
{
@@ -1455,13 +1441,13 @@ globus_i_xio_http_write(
globus_i_xio_http_write_callback,
http_handle);
break;
-
+
case GLOBUS_XIO_HTTP_PRE_REQUEST_LINE:
if(http_handle->delay_write_header)
{
http_handle->first_write_iovec = iovec;
http_handle->first_write_iovec_count = iovec_count;
-
+
result = globus_i_xio_http_client_write_request(
op,
http_handle);
@@ -1552,7 +1538,7 @@ globus_i_xio_http_write_chunk(
}
http_handle->write_operation.operation = op;
http_handle->write_operation.driver_handle = globus_xio_operation_get_driver_handle(op);
- http_handle->write_operation.iov = globus_libc_malloc((iovec_count + 2) *
+ http_handle->write_operation.iov = globus_libc_malloc((iovec_count + 2) *
sizeof(globus_xio_iovec_t));
if (http_handle->write_operation.iov == NULL)
@@ -1615,7 +1601,7 @@ globus_i_xio_http_write_chunk(
* In chunked mode, we will adjust the nbytes to remove the size of the
* chunk framing, otherwise we will finish the write with the value passed
* to this callback.
- *
+ *
* @param op
* Operation associated with the write.
* @param result
@@ -1624,8 +1610,6 @@ globus_i_xio_http_write_chunk(
* Number of bytes written by the transport.
* @param user_arg
* Void pointer to a globus_i_xio_http_handle_t.
- *
- * @return void
*/
void
globus_i_xio_http_write_callback(
@@ -1692,10 +1676,10 @@ globus_i_xio_http_write_callback(
globus_object_t * err;
err = globus_error_get(result);
-
+
if(http_handle->reopen_in_progress)
{
- http_handle->pending_error =
+ http_handle->pending_error =
GlobusXIOHTTPErrorObjPersistentConnectionDropped(err);
}
else
@@ -1851,19 +1835,9 @@ globus_result_t
globus_i_xio_http_close_internal(
globus_i_xio_http_handle_t * http_handle)
{
- globus_i_xio_http_header_info_t * headers;
globus_result_t result;
globus_reltime_t delay;
- if (http_handle->target_info.is_client)
- {
- headers = &http_handle->request_info.headers;
- }
- else
- {
- headers = &http_handle->response_info.headers;
- }
-
http_handle->send_state = GLOBUS_XIO_HTTP_CLOSE;
if (http_handle->target_info.is_client &&
@@ -1900,6 +1874,8 @@ globus_i_xio_http_close_internal(
}
/* globus_i_xio_http_close_internal() */
+#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
+
void
globus_i_xio_http_close_callback(
globus_xio_operation_t op,
diff --git a/xio/src/builtins/mode_e/globus_xio_mode_e_driver.c b/xio/src/builtins/mode_e/globus_xio_mode_e_driver.c
index 7f4baa419e..a8ce5994f5 100644
--- a/xio/src/builtins/mode_e/globus_xio_mode_e_driver.c
+++ b/xio/src/builtins/mode_e/globus_xio_mode_e_driver.c
@@ -78,7 +78,7 @@ typedef struct
globus_xio_stack_t stack;
int max_connection_count;
int eod_count;
- globus_xio_attr_t xio_attr;
+ globus_xio_attr_t xio_attr;
globus_bool_t send_eod;
globus_bool_t manual_eodc;
globus_off_t offset;
@@ -89,7 +89,7 @@ static globus_l_xio_mode_e_attr_t globus_l_xio_mode_e_attr_default =
{
GLOBUS_NULL,
1,
- 0,
+ 0,
GLOBUS_NULL,
GLOBUS_FALSE,
GLOBUS_FALSE,
@@ -109,7 +109,7 @@ typedef struct
globus_xio_server_t server;
globus_xio_handle_t accepted_handle;
globus_l_xio_mode_e_attr_t * attr;
- globus_i_xio_mode_e_state_t state;
+ globus_i_xio_mode_e_state_t state;
globus_memory_t requestor_memory;
globus_memory_t header_memory;
char * cs;
@@ -137,7 +137,7 @@ typedef struct
globus_object_t * error;
} globus_l_xio_mode_e_handle_t;
-typedef struct
+typedef struct
{
globus_xio_operation_t op;
globus_xio_iovec_t * iovec;
@@ -154,11 +154,11 @@ typedef struct
globus_i_xio_mode_e_requestor_t * requestor;
int iovec_index;
globus_size_t iovec_index_len;
- globus_off_t outstanding_data_len;
- globus_off_t outstanding_data_offset;
+ globus_off_t outstanding_data_len;
+ globus_off_t outstanding_data_offset;
globus_bool_t eod;
globus_bool_t close;
-} globus_l_xio_mode_e_connection_handle_t;
+} globus_l_xio_mode_e_connection_handle_t;
static
int
@@ -302,18 +302,18 @@ globus_l_xio_mode_e_activate(void)
static
int
globus_l_xio_mode_e_deactivate(void)
-{
+{
int rc;
GlobusXIOName(globus_l_xio_mode_e_deactivate);
-
+
GlobusXIOModeEDebugEnter();
GlobusXIOUnRegisterDriver(mode_e);
rc = globus_module_deactivate(GLOBUS_XIO_MODULE);
if (rc != GLOBUS_SUCCESS)
- {
+ {
goto error_deactivate;
}
-
+
GlobusXIOModeEDebugExit();
GlobusDebugDestroy(GLOBUS_XIO_MODE_E);
return GLOBUS_SUCCESS;
@@ -336,7 +336,7 @@ globus_l_xio_mode_e_hashtable_offset_hash(
int i;
globus_size_t size;
GlobusXIOName(globus_l_xio_mode_e_hashtable_offset_hash);
-
+
GlobusXIOModeEDebugEnter();
key = (char *) offsetp;
size = sizeof(globus_off_t);
@@ -347,8 +347,8 @@ globus_l_xio_mode_e_hashtable_offset_hash(
{
h ^= g >> 24;
h ^= g;
- }
- }
+ }
+ }
GlobusXIOModeEDebugExit();
return h % limit;
}
@@ -438,7 +438,7 @@ globus_i_xio_mode_e_header_encode(
GlobusXIOModeEDebugEnter();
offset_size = sizeof(globus_off_t);
/*
- * buf[0] contains most significant byte and buf[7] contains the
+ * buf[0] contains most significant byte and buf[7] contains the
* least significant byte
*/
globus_assert(GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE >= offset_size);
@@ -470,12 +470,12 @@ globus_i_xio_mode_e_header_decode(
GlobusXIOModeEDebugEnter();
offset_size = sizeof(globus_off_t);
for (i = GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE; i > offset_size; i--)
- {
- /*
+ {
+ /*
* if offset_size < MAX_OFFSET_SIZE; then the most significant
* (MAX_OFFSET_SIZE - offset_size) number of bytes should be zero;
* otherwise there is an overflow
- */
+ */
if (buf[GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE - i] != 0)
{
result = GlobusXIOModeEHeaderError("offset overflow");
@@ -485,7 +485,7 @@ globus_i_xio_mode_e_header_decode(
if (offset_size > GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE)
{
offset_size = GLOBUS_XIO_MODE_E_MAX_OFFSET_SIZE;
- }
+ }
for (i = 0; i < offset_size; i++)
{
x += ((globus_off_t) buf[i]) << (offset_size - i - 1) * 8;
@@ -503,7 +503,7 @@ globus_i_xio_mode_e_header_decode(
/*
* allocate the memory for and initialize an internal handle
*/
-static
+static
globus_result_t
globus_l_xio_mode_e_handle_create(
globus_l_xio_mode_e_handle_t ** out_handle,
@@ -526,7 +526,7 @@ globus_l_xio_mode_e_handle_create(
memset(handle, 0, sizeof(globus_l_xio_mode_e_handle_t));
if (!attr)
{
- result = globus_l_xio_mode_e_attr_init((void**)(void*)&handle->attr);
+ result = globus_l_xio_mode_e_attr_init((void**)(void*)&handle->attr);
if (result != GLOBUS_SUCCESS)
{
result = GlobusXIOErrorWrapFailed(
@@ -577,23 +577,23 @@ globus_l_xio_mode_e_handle_create(
if (result != GLOBUS_SUCCESS)
{
goto error_eod_q_init;
- }
+ }
result = globus_fifo_init(&handle->io_q);
if (result != GLOBUS_SUCCESS)
{
goto error_io_q_init;
}
- node_size = sizeof(globus_i_xio_mode_e_requestor_t);
- node_count = GLOBUS_XIO_MODE_E_IO_Q_SIZE;
+ node_size = sizeof(globus_i_xio_mode_e_requestor_t);
+ node_count = GLOBUS_XIO_MODE_E_IO_Q_SIZE;
globus_memory_init(&handle->requestor_memory, node_size, node_count);
node_size = sizeof(globus_l_xio_mode_e_header_t);
- node_count = GLOBUS_XIO_MODE_E_HEADER_COUNT;
+ node_count = GLOBUS_XIO_MODE_E_HEADER_COUNT;
globus_memory_init(&handle->header_memory, node_size, node_count);
globus_mutex_init(&handle->mutex, NULL);
- /*
+ /*
* As I did memset(handle, 0) in the beginning, here i initialize only the
* fields that has to initialized with a non-zero value
- */
+ */
handle->eod_count = -1;
handle->ref_count = 1;
*out_handle = handle;
@@ -608,7 +608,7 @@ globus_l_xio_mode_e_handle_create(
error_push_driver:
if (!handle->attr->stack)
{
- globus_xio_stack_destroy(handle->stack);
+ globus_xio_stack_destroy(handle->stack);
}
error_stack_init:
if (!handle->attr->stack)
@@ -635,7 +635,7 @@ globus_l_xio_mode_e_server_init(
globus_l_xio_mode_e_handle_t * handle;
globus_l_xio_mode_e_attr_t * attr;
globus_xio_contact_t my_contact_info;
- char * cs;
+ char * cs;
globus_result_t result;
GlobusXIOName(globus_l_xio_mode_e_server_init);
@@ -645,7 +645,7 @@ globus_l_xio_mode_e_server_init(
if (result != GLOBUS_SUCCESS)
{
goto error_handle_create;
- }
+ }
if (!attr)
{
attr = handle->attr;
@@ -657,19 +657,19 @@ globus_l_xio_mode_e_server_init(
{
goto error_attr_init;
}
- }
+ }
result = globus_xio_server_create(
&handle->server, attr->xio_attr, handle->stack);
if (result != GLOBUS_SUCCESS)
{
goto error_server_create;
- }
+ }
result = globus_xio_server_get_contact_string(handle->server, &cs);
if (result != GLOBUS_SUCCESS)
{
goto error_get_cs;
}
- result = globus_xio_contact_parse(&my_contact_info, cs);
+ result = globus_xio_contact_parse(&my_contact_info, cs);
if (result != GLOBUS_SUCCESS)
{
goto error_parse_cs;
@@ -692,7 +692,7 @@ globus_l_xio_mode_e_server_init(
globus_l_xio_mode_e_handle_destroy(handle);
error_handle_create:
GlobusXIOModeEDebugExitWithError();
- return result;
+ return result;
}
@@ -703,12 +703,12 @@ globus_l_xio_mode_e_save_error(
globus_result_t result)
{
GlobusXIOName(globus_l_xio_mode_e_save_error);
-
+
GlobusXIOModeEDebugEnter();
handle->state = GLOBUS_XIO_MODE_E_ERROR;
if (handle->error == GLOBUS_NULL)
{
- handle->error = globus_object_copy(globus_error_peek(result));
+ handle->error = globus_object_copy(globus_error_peek(result));
}
GlobusXIOModeEDebugExit();
}
@@ -722,14 +722,14 @@ globus_l_xio_mode_e_server_accept_cb(
globus_result_t result,
void * user_arg)
{
- globus_l_xio_mode_e_handle_t * handle;
+ globus_l_xio_mode_e_handle_t * handle;
globus_xio_operation_t op;
GlobusXIOName(globus_l_xio_mode_e_server_accept_cb);
GlobusXIOModeEDebugEnter();
handle = (globus_l_xio_mode_e_handle_t *)user_arg;
globus_xio_operation_disable_cancel(handle->outstanding_op);
- globus_mutex_lock(&handle->mutex);
+ globus_mutex_lock(&handle->mutex);
op = handle->outstanding_op;
if (result == GLOBUS_SUCCESS)
{
@@ -740,13 +740,13 @@ globus_l_xio_mode_e_server_accept_cb(
{
goto error_accept;
}
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_xio_driver_finished_accept(op, handle, result);
GlobusXIOModeEDebugExit();
return;
error_accept:
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_xio_driver_finished_accept(op, handle, result);
GlobusXIOModeEDebugExitWithError();
return;
@@ -754,9 +754,9 @@ globus_l_xio_mode_e_server_accept_cb(
/*
- * At any instance, there would be a globus_xio_server_register_accept
+ * At any instance, there would be a globus_xio_server_register_accept
* outstanding to accept any new incoming connection. For the very first
- * register accept (done in globus_l_xio_mode_e_server_accept),
+ * register accept (done in globus_l_xio_mode_e_server_accept),
* globus_l_xio_mode_e_server_accept_cb is used. For the subsequent
* register accpets, this function is used
*/
@@ -768,39 +768,39 @@ globus_i_xio_mode_e_server_accept_cb(
globus_result_t result,
void * user_arg)
{
- globus_l_xio_mode_e_handle_t * handle;
+ globus_l_xio_mode_e_handle_t * handle;
globus_result_t res;
GlobusXIOName(globus_i_xio_mode_e_server_accept_cb);
GlobusXIOModeEDebugEnter();
handle = (globus_l_xio_mode_e_handle_t *)user_arg;
- globus_mutex_lock(&handle->mutex);
+ globus_mutex_lock(&handle->mutex);
if (result != GLOBUS_SUCCESS)
- {
+ {
res = result;
goto error_accept;
- }
+ }
switch (handle->state)
{
case GLOBUS_XIO_MODE_E_OPEN:
{
res = globus_xio_register_open(
- xio_handle,
- NULL,
+ xio_handle,
+ NULL,
handle->attr->xio_attr,
globus_i_xio_mode_e_server_open_cb,
handle);
if (res != GLOBUS_SUCCESS)
{
globus_xio_register_close(
- xio_handle,
- NULL,
+ xio_handle,
+ NULL,
NULL,
NULL);
goto error_register_open;
}
res = globus_xio_server_register_accept(
- server,
+ server,
globus_i_xio_mode_e_server_accept_cb,
handle);
if (res != GLOBUS_SUCCESS)
@@ -812,8 +812,8 @@ globus_i_xio_mode_e_server_accept_cb(
default:
res = GlobusXIOErrorInvalidState(handle->state);
goto error_invalid_state;
- }
- globus_mutex_unlock(&handle->mutex);
+ }
+ globus_mutex_unlock(&handle->mutex);
GlobusXIOModeEDebugExit();
return;
@@ -822,7 +822,7 @@ globus_i_xio_mode_e_server_accept_cb(
error_invalid_state:
error_accept:
globus_l_xio_mode_e_save_error(handle, res);
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
GlobusXIOModeEDebugExitWithError();
return;
}
@@ -840,8 +840,8 @@ globus_i_xio_mode_e_cancel_operations(
GlobusXIOName(globus_i_xio_mode_e_cancel_operations);
GlobusXIOModeEDebugEnter();
- /*
- * If user cancels close on the client side, both register_write (eods)
+ /*
+ * If user cancels close on the client side, both register_write (eods)
* and register_close can be outstanding
*/
mask = GLOBUS_XIO_CANCEL_WRITE;
@@ -851,9 +851,9 @@ globus_i_xio_mode_e_cancel_operations(
globus_list_remove(&handle->eod_list, handle->eod_list);
result = globus_xio_handle_cancel_operations(xio_handle, mask);
if (result != GLOBUS_SUCCESS)
- {
+ {
goto error;
- }
+ }
}
mask = GLOBUS_XIO_CANCEL_CLOSE;
while (!globus_list_empty(handle->close_list))
@@ -862,9 +862,9 @@ globus_i_xio_mode_e_cancel_operations(
globus_list_remove(&handle->close_list, handle->close_list);
result = globus_xio_handle_cancel_operations(xio_handle, mask);
if (result != GLOBUS_SUCCESS)
- {
+ {
goto error;
- }
+ }
}
GlobusXIOModeEDebugExit();
return GLOBUS_SUCCESS;
@@ -924,11 +924,11 @@ globus_l_xio_mode_e_cancel_cb(
if (globus_fifo_empty(&handle->io_q) ||
!globus_fifo_remove(&handle->io_q, requestor))
{
- /*
- * requestor->xio_handle would be NULL if cancel was called
- * after enable_cancel is called in read/write and before the
- * lock is required in read/write. In that case an xio
- * operation would not have been initiated. So I don't do
+ /*
+ * requestor->xio_handle would be NULL if cancel was called
+ * after enable_cancel is called in read/write and before the
+ * lock is required in read/write. In that case an xio
+ * operation would not have been initiated. So I don't do
* anything here.
*/
if (requestor->xio_handle)
@@ -969,7 +969,7 @@ globus_l_xio_mode_e_cancel_cb(
default:
result = GlobusXIOErrorInvalidState(handle->state);
goto error;
-
+
}
globus_mutex_unlock(&handle->mutex);
if (finish)
@@ -1025,13 +1025,13 @@ globus_l_xio_mode_e_server_accept(
goto error_operation_canceled;
}
result = globus_xio_server_register_accept(
- handle->server,
+ handle->server,
globus_l_xio_mode_e_server_accept_cb,
handle);
if (result != GLOBUS_SUCCESS)
{
goto error_register_accept;
- }
+ }
globus_mutex_unlock(&handle->mutex);
GlobusXIOModeEDebugExit();
return GLOBUS_SUCCESS;
@@ -1054,19 +1054,19 @@ globus_l_xio_mode_e_server_destroy(
{
globus_l_xio_mode_e_handle_t * handle;
GlobusXIOName(globus_l_xio_mode_e_server_destroy);
-
+
GlobusXIOModeEDebugEnter();
handle = (globus_l_xio_mode_e_handle_t *)driver_server;
- globus_mutex_lock(&handle->mutex);
+ globus_mutex_lock(&handle->mutex);
--handle->ref_count;
if (handle->ref_count == 0)
{
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_l_xio_mode_e_handle_destroy(handle);
}
else
{
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
}
GlobusXIOModeEDebugExit();
return GLOBUS_SUCCESS;
@@ -1114,7 +1114,7 @@ globus_l_xio_mode_e_link_destroy(
--handle->ref_count;
if (handle->ref_count == 0)
{
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_l_xio_mode_e_handle_destroy(handle);
}
else
@@ -1148,7 +1148,7 @@ static
globus_result_t
globus_l_xio_mode_e_process_header(
globus_l_xio_mode_e_header_t * header,
- globus_l_xio_mode_e_connection_handle_t *
+ globus_l_xio_mode_e_connection_handle_t *
connection_handle)
{
globus_result_t result;
@@ -1161,7 +1161,7 @@ globus_l_xio_mode_e_process_header(
}
if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE)
{
- /* sending CLOSE before EOD is a protocol violation */
+ /* sending CLOSE before EOD is a protocol violation */
globus_assert(connection_handle->eod);
connection_handle->close = GLOBUS_TRUE;
}
@@ -1216,15 +1216,15 @@ globus_l_xio_mode_e_process_outstanding_data(
if (!globus_fifo_empty(&handle->io_q))
{
requestor = (globus_i_xio_mode_e_requestor_t *)
- globus_fifo_dequeue(&handle->io_q);
+ globus_fifo_dequeue(&handle->io_q);
if (handle->attr->offset_reads)
{
/* wait_for of this requestor should be zero */
- requestor->dd->offset =
+ requestor->dd->offset =
connection_handle->outstanding_data_offset;
globus_hashtable_insert(
- &handle->offset_ht,
- (void *) &connection_handle->outstanding_data_offset,
+ &handle->offset_ht,
+ (void *) &connection_handle->outstanding_data_offset,
(void *) connection_handle);
}
else
@@ -1265,7 +1265,7 @@ globus_l_xio_mode_e_process_eod(
NULL,
globus_l_xio_mode_e_close_cb,
handle);
- globus_list_remove(&handle->connection_list,
+ globus_list_remove(&handle->connection_list,
globus_list_search(handle->connection_list, connection_handle));
globus_free(connection_handle);
}
@@ -1320,7 +1320,7 @@ globus_l_xio_mode_e_read_header_cb(
offset = connection_handle->outstanding_data_offset;
globus_mutex_lock(&handle->mutex);
if (result == GLOBUS_SUCCESS)
- {
+ {
header = (globus_l_xio_mode_e_header_t *) buffer;
result = globus_l_xio_mode_e_process_header(header, connection_handle);
if (result != GLOBUS_SUCCESS)
@@ -1337,16 +1337,16 @@ globus_l_xio_mode_e_read_header_cb(
* If EOF is set in header, data len will be zero. If EOD alone is
* set, there can be data present. If EOD is set on header and also
* there is data present, i process EOD in read_cb. If I process it
- * here and if it so happens that eods_received == eod_count,
+ * here and if it so happens that eods_received == eod_count,
* process_eod will return true (eof) and the state would be set to
* GLOBUS_XIO_MODE_E_EOF_RECEIVED or DELIVERED and there would be no
- * way for the user to read the data that had EOD set on the header.
+ * way for the user to read the data that had EOD set on the header.
*/
else if (connection_handle->eod)
{
eof = globus_l_xio_mode_e_process_eod(
connection_handle, &requestor_q);
- if (eof)
+ if (eof)
{
if (globus_fifo_empty(&requestor_q))
{
@@ -1357,12 +1357,12 @@ globus_l_xio_mode_e_read_header_cb(
}
else
{
- requestor = (globus_i_xio_mode_e_requestor_t *)
+ requestor = (globus_i_xio_mode_e_requestor_t *)
globus_fifo_peek(&requestor_q);
globus_xio_driver_set_eof_received(requestor->op);
/*
* If this part of the code is executed, finished_read
- * happen only in if (finish) {} block below. The
+ * happen only in if (finish) {} block below. The
* finished_read in if (requestor) {} block below should
* happen only if process_outstanding_data called above
* returns a non NULL requestor value. Thats why requestor
@@ -1388,13 +1388,13 @@ globus_l_xio_mode_e_read_header_cb(
}
}
else if(globus_error_match(
- globus_error_peek(result),
- GLOBUS_XIO_MODULE,
+ globus_error_peek(result),
+ GLOBUS_XIO_MODULE,
GLOBUS_XIO_ERROR_CANCELED))
{
- /*
- * if there are outstanding header reads and user calls close, the
- * header reads are canceled in close
+ /*
+ * if there are outstanding header reads and user calls close, the
+ * header reads are canceled in close
*/
if (!handle->close_canceled)
{
@@ -1445,12 +1445,12 @@ globus_l_xio_mode_e_read_header_cb(
op = requestor->op;
/*
* Earlier I had this push_node inside process_eod but then i moved
- * here to avoid a race. process_eod is called with lock held and
+ * here to avoid a race. process_eod is called with lock held and
* when lock is released above, sometimes cancel_cb gets called and
* it tries to access the requestor which is no more. To get rid
* of that, I moved the push_node to here after disable_cancel.
- * Since requestor is removed from the handle->io_q and put in
- * requestor_q by process_eod function, cancel_cb will not do
+ * Since requestor is removed from the handle->io_q and put in
+ * requestor_q by process_eod function, cancel_cb will not do
* finished_read on requestor->op. Similar thing is done in read_cb
* too
*/
@@ -1460,7 +1460,7 @@ globus_l_xio_mode_e_read_header_cb(
NULL,
GLOBUS_XIO_DD_SET_OFFSET,
offset);
- res = GlobusXIOErrorEOF();
+ res = GlobusXIOErrorEOF();
globus_xio_driver_finished_read(op, res, 0);
}
}
@@ -1531,7 +1531,7 @@ globus_l_xio_mode_e_open_cb(
globus_mutex_unlock(&handle->mutex);
globus_xio_driver_finished_open(handle, op, res);
GlobusXIOModeEDebugExit();
- return;
+ return;
error_connection_handle:
globus_xio_register_close(xio_handle, NULL, NULL, NULL);
@@ -1540,7 +1540,7 @@ globus_l_xio_mode_e_open_cb(
globus_xio_attr_destroy(handle->attr->xio_attr);
if (--handle->ref_count == 0)
{
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_l_xio_mode_e_handle_destroy(handle);
}
else
@@ -1550,7 +1550,7 @@ globus_l_xio_mode_e_open_cb(
}
globus_xio_driver_finished_open(handle, op, res);
GlobusXIOModeEDebugExitWithError();
- return;
+ return;
}
@@ -1573,12 +1573,12 @@ globus_i_xio_mode_e_open_cb(
handle = (globus_l_xio_mode_e_handle_t *)user_arg;
globus_mutex_lock(&handle->mutex);
if (result == GLOBUS_SUCCESS)
- {
+ {
globus_size_t connection_handle_size;
- connection_handle_size =
+ connection_handle_size =
sizeof(globus_l_xio_mode_e_connection_handle_t);
connection_handle = (globus_l_xio_mode_e_connection_handle_t *)
- globus_malloc(connection_handle_size);
+ globus_malloc(connection_handle_size);
if (!connection_handle)
{
res = GlobusXIOErrorMemory("connection_handle");
@@ -1614,7 +1614,7 @@ globus_i_xio_mode_e_open_cb(
}
globus_mutex_unlock(&handle->mutex);
GlobusXIOModeEDebugExit();
- return;
+ return;
error_register_write:
error_connection_handle:
@@ -1634,7 +1634,7 @@ globus_i_xio_mode_e_open_cb(
globus_xio_driver_finished_write(write_op, res, 0);
}
GlobusXIOModeEDebugExitWithError();
- return;
+ return;
}
@@ -1717,7 +1717,7 @@ globus_l_xio_mode_e_server_open_cb(
error:
if (--handle->ref_count == 0)
{
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_l_xio_mode_e_handle_destroy(handle);
}
else
@@ -1733,15 +1733,15 @@ globus_l_xio_mode_e_server_open_cb(
/* called locked (if handle->state == GLOBUS_XIO_MODE_E_OPEN) */
static
-globus_result_t
+globus_result_t
globus_l_xio_mode_e_open_new_stream(
globus_l_xio_mode_e_handle_t * handle,
globus_xio_callback_t open_cb)
{
- globus_xio_handle_t xio_handle;
+ globus_xio_handle_t xio_handle;
globus_l_xio_mode_e_attr_t * attr;
- globus_i_xio_mode_e_requestor_t * requestor;
- globus_xio_operation_t op;
+ globus_i_xio_mode_e_requestor_t * requestor = GLOBUS_NULL;
+ globus_xio_operation_t op = GLOBUS_XIO_OPERATION_TYPE_NONE;
globus_result_t result;
GlobusXIOName(globus_l_xio_mode_e_open_new_stream);
@@ -1781,8 +1781,8 @@ globus_l_xio_mode_e_open_new_stream(
}
}
result = globus_xio_register_open(
- xio_handle,
- handle->cs,
+ xio_handle,
+ handle->cs,
handle->attr->xio_attr,
open_cb,
handle);
@@ -1833,10 +1833,10 @@ globus_l_xio_mode_e_server_open(
GlobusXIOModeEDebugEnter();
globus_mutex_lock(&handle->mutex);
handle->outstanding_op = op;
- if (handle->attr->offset_reads)
+ if (handle->attr->offset_reads)
{
result = globus_hashtable_init(
- &handle->offset_ht,
+ &handle->offset_ht,
GLOBUS_XIO_MODE_E_OFFSET_HT_SIZE,
globus_l_xio_mode_e_hashtable_offset_hash,
globus_l_xio_mode_e_hashtable_offset_keyeq);
@@ -1953,7 +1953,7 @@ globus_l_xio_mode_e_open(
if (result != GLOBUS_SUCCESS)
{
globus_l_xio_mode_e_save_error(handle, result);
- goto error_server_open;
+ goto error_server_open;
}
}
GlobusXIOModeEDebugExit();
@@ -1961,7 +1961,7 @@ globus_l_xio_mode_e_open(
error_open_new_stream:
error_contact_info_to_string:
- globus_l_xio_mode_e_handle_destroy(handle);
+ globus_l_xio_mode_e_handle_destroy(handle);
error_handle_create:
error_server_open:
GlobusXIOModeEDebugExitWithError();
@@ -2011,7 +2011,7 @@ globus_l_xio_mode_e_read_cb(
void * user_arg)
{
globus_result_t res = result;
- globus_l_xio_mode_e_connection_handle_t *
+ globus_l_xio_mode_e_connection_handle_t *
connection_handle;
globus_l_xio_mode_e_handle_t * handle;
globus_bool_t eof;
@@ -2025,20 +2025,20 @@ globus_l_xio_mode_e_read_cb(
connection_handle = (globus_l_xio_mode_e_connection_handle_t *) user_arg;
op = connection_handle->requestor->op;
globus_xio_operation_disable_cancel(op);
- handle = connection_handle->mode_e_handle;
+ handle = connection_handle->mode_e_handle;
globus_fifo_init(&requestor_q);
offset = connection_handle->outstanding_data_offset;
if (connection_handle->iovec_index != -1)
{
- iovec[connection_handle->iovec_index].iov_len =
+ iovec[connection_handle->iovec_index].iov_len =
connection_handle->iovec_index_len;
connection_handle->iovec_index = -1;
}
- globus_mutex_lock(&handle->mutex);
+ globus_mutex_lock(&handle->mutex);
globus_memory_push_node(
&handle->requestor_memory, (void*)connection_handle->requestor);
if (result == GLOBUS_SUCCESS)
- {
+ {
connection_handle->outstanding_data_len -= nbytes;
if (connection_handle->outstanding_data_len > 0)
{
@@ -2046,7 +2046,7 @@ globus_l_xio_mode_e_read_cb(
requestor = globus_l_xio_mode_e_process_outstanding_data(
connection_handle);
}
- else if (connection_handle->eod)
+ else if (connection_handle->eod)
{
eof = globus_l_xio_mode_e_process_eod(
connection_handle, &requestor_q);
@@ -2080,7 +2080,7 @@ globus_l_xio_mode_e_read_cb(
}
goto error;
}
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
globus_xio_driver_data_descriptor_cntl(
op,
NULL,
@@ -2109,7 +2109,7 @@ globus_l_xio_mode_e_read_cb(
error:
globus_l_xio_mode_e_save_error(handle, result);
- globus_mutex_unlock(&handle->mutex);
+ globus_mutex_unlock(&handle->mutex);
while (!globus_fifo_empty(&requestor_q))
{
requestor = (globus_i_xio_mode_e_requestor_t*)
@@ -2131,7 +2131,7 @@ globus_i_xio_mode_e_register_read(
globus_l_xio_mode_e_connection_handle_t *
connection_handle)
{
- globus_size_t iovec_len;
+ globus_size_t iovec_len;
globus_result_t result;
globus_xio_iovec_t * iovec;
int iovec_count;
@@ -2141,14 +2141,14 @@ globus_i_xio_mode_e_register_read(
iovec = connection_handle->requestor->iovec;
iovec_count = connection_handle->requestor->iovec_count;
GlobusXIOUtilIovTotalLength(iovec_len, iovec, iovec_count);
- /*
- * Upto iovec_len amount of data would be read from the channel. If
+ /*
+ * Upto iovec_len amount of data would be read from the channel. If
* iovec_len > outstanding_data_len, this read might possibly get the next
* header that has arrived on this channel. So I modify iovec (and later
* restore in the read_cb) such that the amount of data read would be
* min(outstanding_data_len, iovec_len)
*/
- if (connection_handle->outstanding_data_len < iovec_len)
+ if (connection_handle->outstanding_data_len < iovec_len)
{
globus_size_t size = 0;
int i;
@@ -2168,7 +2168,7 @@ globus_i_xio_mode_e_register_read(
}
result = globus_xio_register_readv(
connection_handle->xio_handle,
- (globus_xio_iovec_t*)iovec,
+ (globus_xio_iovec_t*)iovec,
iovec_count,
iovec_len,
NULL,
@@ -2176,7 +2176,7 @@ globus_i_xio_mode_e_register_read(
connection_handle);
GlobusXIOModeEDebugExit();
return result;
-}
+}
/* called locked */
@@ -2187,7 +2187,7 @@ globus_l_xio_mode_e_reset_connections(
{
globus_l_xio_mode_e_connection_handle_t *
connection_handle;
- globus_result_t result;
+ globus_result_t result;
GlobusXIOName(globus_l_xio_mode_e_reset_connections);
GlobusXIOModeEDebugEnter();
handle->eod_count = -1;
@@ -2278,17 +2278,17 @@ globus_l_xio_mode_e_read(
case GLOBUS_XIO_MODE_E_EOF_RECEIVED:
globus_xio_driver_set_eof_received(op);
handle->state = GLOBUS_XIO_MODE_E_EOF_DELIVERED;
- globus_memory_push_node(
- &handle->requestor_memory, (void*)requestor);
+ globus_memory_push_node(
+ &handle->requestor_memory, (void*)requestor);
result = GlobusXIOErrorEOF();
finish = GLOBUS_TRUE;
break;
case GLOBUS_XIO_MODE_E_EOF_DELIVERED:
- if (globus_xio_driver_eof_received(op) ||
+ if (globus_xio_driver_eof_received(op) ||
handle->connection_count == 0)
{
- globus_memory_push_node(
- &handle->requestor_memory, (void*)requestor);
+ globus_memory_push_node(
+ &handle->requestor_memory, (void*)requestor);
result = GlobusXIOErrorEOF();
finish = GLOBUS_TRUE;
break;
@@ -2296,7 +2296,7 @@ globus_l_xio_mode_e_read(
else
{
globus_l_xio_mode_e_reset_connections(handle);
- /*
+ /*
* connection_q will be empty at this point. I let this
* fall through to enqueue the request in the io_q
*/
@@ -2309,29 +2309,29 @@ globus_l_xio_mode_e_read(
}
else
{
- globus_l_xio_mode_e_connection_handle_t *
+ globus_l_xio_mode_e_connection_handle_t *
connection_handle;
if (wait_for == 0)
{
globus_memory_push_node(
&handle->requestor_memory, (void*)requestor);
- connection_handle =
- (globus_l_xio_mode_e_connection_handle_t*)
+ connection_handle =
+ (globus_l_xio_mode_e_connection_handle_t*)
globus_fifo_dequeue(&handle->connection_q);
globus_hashtable_insert(
- &handle->offset_ht,
- (void *)&connection_handle->outstanding_data_offset,
+ &handle->offset_ht,
+ (void *)&connection_handle->outstanding_data_offset,
(void *)connection_handle);
dd->offset = connection_handle->outstanding_data_offset;
result = GLOBUS_SUCCESS;
finish = GLOBUS_TRUE;
}
- else
+ else
{
if (handle->attr->offset_reads)
{
- connection_handle =
- (globus_l_xio_mode_e_connection_handle_t*)
+ connection_handle =
+ (globus_l_xio_mode_e_connection_handle_t*)
globus_hashtable_remove(
&handle->offset_ht, &dd->offset);
if (!connection_handle)
@@ -2342,8 +2342,8 @@ globus_l_xio_mode_e_read(
}
else
{
- connection_handle =
- (globus_l_xio_mode_e_connection_handle_t*)
+ connection_handle =
+ (globus_l_xio_mode_e_connection_handle_t*)
globus_fifo_dequeue(&handle->connection_q);
}
connection_handle->requestor = requestor;
@@ -2428,8 +2428,8 @@ globus_l_xio_mode_e_write_cb(
requestor_result = globus_i_xio_mode_e_register_write(
connection_handle);
if (requestor_result != GLOBUS_SUCCESS)
- {
- requestor_op = requestor->op;
+ {
+ requestor_op = requestor->op;
requestor_offset = connection_handle->outstanding_data_offset;
finish_next = GLOBUS_TRUE;
globus_memory_push_node(
@@ -2442,10 +2442,10 @@ globus_l_xio_mode_e_write_cb(
if (handle->state == GLOBUS_XIO_MODE_E_SENDING_EOD)
{
globus_byte_t descriptor;
- /*
+ /*
* I'll get this cb with eod_sent == TRUE for one connection alone
* and I send EOF (if need be) on this connection alone. If I don't
- * need to send EOF and eods_sent == connection_count, I need to
+ * need to send EOF and eods_sent == connection_count, I need to
* finish the write (that had SEND_EOD set on dd)
*/
if (!connection_handle->eod)
@@ -2458,7 +2458,7 @@ globus_l_xio_mode_e_write_cb(
goto error_register_eod;
}
}
- else
+ else
{
connection_handle->eod = GLOBUS_FALSE;
if (handle->eod_count > -1)
@@ -2558,13 +2558,13 @@ globus_l_xio_mode_e_write_header_cb(
globus_mutex_lock(&handle->mutex);
if (result == GLOBUS_SUCCESS)
{
- /*
+ /*
* if handle->eod_count != -1, then register_eod will be called (either
- * in here or in write_cb) to send EOF and eods_sent will be
+ * in here or in write_cb) to send EOF and eods_sent will be
* incremented in eod_cb
*/
if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD &&
- handle->eod_count == -1)
+ handle->eod_count == -1)
{
++handle->eods_sent;
}
@@ -2590,7 +2590,7 @@ globus_l_xio_mode_e_write_header_cb(
else if (handle->eod_count > -1)
{
globus_byte_t descriptor;
- /*
+ /*
* handle->iovec can be NULL only when the user sets SEND_EOD
* on the dd. So I just wrote EOD on this channel and now i check
* to see if i need to send EOF
@@ -2603,13 +2603,13 @@ globus_l_xio_mode_e_write_header_cb(
goto error;
}
}
- else
+ else
{
globus_fifo_enqueue(&handle->connection_q, connection_handle);
if (handle->eods_sent == handle->connection_count)
{
- /*
- * user is allowed to do a write with buffer = NULL and
+ /*
+ * user is allowed to do a write with buffer = NULL and
* SEND_EOD set on dd
*/
handle->state = GLOBUS_XIO_MODE_E_OPEN;
@@ -2617,17 +2617,17 @@ globus_l_xio_mode_e_write_header_cb(
handle->attr->eod_count = -1;
handle->offset = 0;
finish = GLOBUS_TRUE;
- /*
+ /*
* handle->eod_offset also has same value. if i have to finish
* in eod_cb, connection_handle->outstanding_data_offset cant
- * be used coz i don't know which connection_handle is
+ * be used coz i don't know which connection_handle is
* associated with the user_write (that had SEND_EOD set).
*/
offset = connection_handle->outstanding_data_offset;
/* the op is stored in handle->outstanding_op too */
op = connection_handle->requestor->op;
globus_memory_push_node(
- &handle->requestor_memory,
+ &handle->requestor_memory,
(void*)connection_handle->requestor);
}
}
@@ -2668,7 +2668,7 @@ globus_l_xio_mode_e_write_header_cb(
static
globus_result_t
globus_i_xio_mode_e_register_write(
- globus_l_xio_mode_e_connection_handle_t *
+ globus_l_xio_mode_e_connection_handle_t *
connection_handle)
{
globus_l_xio_mode_e_handle_t * handle;
@@ -2686,8 +2686,8 @@ globus_i_xio_mode_e_register_write(
header_size = sizeof(globus_l_xio_mode_e_header_t);
memset(header, 0, header_size);
GlobusXIOUtilIovTotalLength(
- size,
- connection_handle->requestor->iovec,
+ size,
+ connection_handle->requestor->iovec,
connection_handle->requestor->iovec_count);
globus_i_xio_mode_e_header_encode(header->count, size);
result = globus_xio_driver_data_descriptor_cntl(
@@ -2699,7 +2699,7 @@ globus_i_xio_mode_e_register_write(
{
offset = handle->offset;
}
- if (handle->state == GLOBUS_XIO_MODE_E_SENDING_EOD &&
+ if (handle->state == GLOBUS_XIO_MODE_E_SENDING_EOD &&
globus_fifo_empty(&handle->io_q))
{
header->descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD;
@@ -2713,8 +2713,8 @@ globus_i_xio_mode_e_register_write(
handle->offset = offset;
}
result = globus_xio_register_write(
- connection_handle->xio_handle,
- (globus_byte_t*)header,
+ connection_handle->xio_handle,
+ (globus_byte_t*)header,
header_size,
header_size,
GLOBUS_NULL,
@@ -2723,7 +2723,7 @@ globus_i_xio_mode_e_register_write(
if (result != GLOBUS_SUCCESS)
{
goto error;
- }
+ }
if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD)
{
connection_handle->eod = GLOBUS_TRUE;
@@ -2753,10 +2753,10 @@ globus_l_xio_mode_e_write(
GlobusXIOModeEDebugEnter();
handle = (globus_l_xio_mode_e_handle_t *) driver_specific_handle;
- /*
+ /*
* Mode E is unidirectional. Server can only read and client can only write
*/
- globus_assert(handle->server == GLOBUS_NULL);
+ globus_assert(handle->server == GLOBUS_NULL);
dd = (globus_l_xio_mode_e_attr_t *)
globus_xio_operation_get_data_descriptor(op, GLOBUS_FALSE);
requestor = (globus_i_xio_mode_e_requestor_t *)
@@ -2782,9 +2782,9 @@ globus_l_xio_mode_e_write(
switch (handle->state)
{
case GLOBUS_XIO_MODE_E_OPEN:
- /*
+ /*
* I reset eods_sent here (and not right after i send all the eods)
- * coz i use 'eods_sent == connection_count' in close to check if
+ * coz i use 'eods_sent == connection_count' in close to check if
* eods have been sent or not
*/
if (handle->eods_sent == handle->connection_count)
@@ -2811,7 +2811,7 @@ globus_l_xio_mode_e_write(
if (!globus_fifo_empty(&handle->connection_q))
{
globus_l_xio_mode_e_connection_handle_t *
- connection_handle;
+ connection_handle;
connection_handle = (globus_l_xio_mode_e_connection_handle_t *)
globus_fifo_dequeue(&handle->connection_q);
connection_handle->requestor = requestor;
@@ -2827,7 +2827,7 @@ globus_l_xio_mode_e_write(
descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD;
while (!globus_fifo_empty(&handle->connection_q))
{
- connection_handle =
+ connection_handle =
(globus_l_xio_mode_e_connection_handle_t *)
globus_fifo_dequeue(&handle->connection_q);
globus_l_xio_mode_e_register_eod(
@@ -2837,7 +2837,7 @@ globus_l_xio_mode_e_write(
}
else
{
- if (handle->connection_count <
+ if (handle->connection_count <
handle->attr->max_connection_count)
{
result = globus_l_xio_mode_e_open_new_stream(
@@ -2897,8 +2897,8 @@ globus_l_xio_mode_e_close_cb(
goto error;
}
if(globus_error_match(
- globus_error_peek(result),
- GLOBUS_XIO_MODULE,
+ globus_error_peek(result),
+ GLOBUS_XIO_MODULE,
GLOBUS_XIO_ERROR_CANCELED))
{
++handle->close_count;
@@ -2914,7 +2914,7 @@ globus_l_xio_mode_e_close_cb(
if (!globus_list_empty(handle->close_list))
{
globus_list_remove(
- &handle->close_list,
+ &handle->close_list,
globus_list_search(handle->close_list, xio_handle));
}
}
@@ -2973,7 +2973,7 @@ globus_l_xio_mode_e_write_eod_cb(
globus_l_xio_mode_e_connection_handle_t *
connection_handle;
globus_l_xio_mode_e_handle_t * handle;
- globus_l_xio_mode_e_header_t * header;
+ globus_l_xio_mode_e_header_t * header;
globus_xio_operation_t op;
globus_off_t offset;
globus_bool_t finish = GLOBUS_FALSE;
@@ -2991,18 +2991,18 @@ globus_l_xio_mode_e_write_eod_cb(
res = result;
goto error;
}
- ++handle->eods_sent;
- /*
- * If CLOSE is set on header, then it implies that user has called
- * close and I allow users to cancel close until all the channels are
+ ++handle->eods_sent;
+ /*
+ * If CLOSE is set on header, then it implies that user has called
+ * close and I allow users to cancel close until all the channels are
* closed
*/
if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE)
{
/* I don't register_close, if user has canceled the close already */
if (!globus_error_match(
- globus_error_peek(result),
- GLOBUS_XIO_MODULE,
+ globus_error_peek(result),
+ GLOBUS_XIO_MODULE,
GLOBUS_XIO_ERROR_CANCELED))
{
res = globus_xio_register_close(
@@ -3016,13 +3016,13 @@ globus_l_xio_mode_e_write_eod_cb(
}
globus_list_insert(
&handle->close_list, connection_handle->xio_handle);
- /*
+ /*
* If it was canceled, then the xio_handle would have been removed
* from the eod_list before the canceling the write eod. So I do
- * not have to this removal in the else below.
+ * not have to this removal in the else below.
*/
globus_list_remove(
- &handle->eod_list,
+ &handle->eod_list,
globus_list_search(
handle->eod_list, connection_handle->xio_handle));
}
@@ -3039,10 +3039,10 @@ globus_l_xio_mode_e_write_eod_cb(
}
else
{
- /*
+ /*
* getting here implies that register_eod (associated with this cb) is
* called in response to the dd 'SEND_EOD' on write
- */
+ */
if (header->descriptor & GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOF)
{
handle->eof_sent = GLOBUS_TRUE;
@@ -3059,17 +3059,17 @@ globus_l_xio_mode_e_write_eod_cb(
finish = GLOBUS_TRUE;
}
if (!globus_error_match(
- globus_error_peek(result),
- GLOBUS_XIO_MODULE,
+ globus_error_peek(result),
+ GLOBUS_XIO_MODULE,
GLOBUS_XIO_ERROR_CANCELED))
{
globus_list_remove(
- &handle->eod_list,
+ &handle->eod_list,
globus_list_search(
handle->eod_list, connection_handle->xio_handle));
}
-
- }
+
+ }
globus_memory_push_node(&handle->header_memory, (void*)header);
globus_mutex_unlock(&handle->mutex);
if (finish)
@@ -3143,7 +3143,7 @@ globus_l_xio_mode_e_register_eod(
return GLOBUS_SUCCESS;
error:
- globus_memory_push_node(&handle->header_memory, (void*)header);
+ globus_memory_push_node(&handle->header_memory, (void*)header);
GlobusXIOModeEDebugExitWithError();
return result;
}
@@ -3161,7 +3161,7 @@ globus_l_xio_mode_e_close_connections(
GlobusXIOName(globus_l_xio_mode_e_close_connections);
GlobusXIOModeEDebugEnter();
- /*
+ /*
* handle->connection_list contains all the connections whereas the q's
* (connection_q, eod_q contain only those connections that are free (idle)
*/
@@ -3173,17 +3173,17 @@ globus_l_xio_mode_e_close_connections(
globus_fifo_remove(&handle->connection_q, connection_handle);
if (!idle_connection_handle)
{
- idle_connection_handle =
+ idle_connection_handle =
(globus_l_xio_mode_e_connection_handle_t *)
globus_fifo_remove(&handle->eod_q, connection_handle);
-
+
}
if (idle_connection_handle)
{
/* connection_handle and idle_connection_handle are same here */
globus_xio_register_close(
- connection_handle->xio_handle,
- NULL,
+ connection_handle->xio_handle,
+ NULL,
globus_l_xio_mode_e_close_cb,
connection_handle->mode_e_handle);
globus_list_insert(
@@ -3219,7 +3219,7 @@ globus_l_xio_mode_e_close(
GlobusXIOModeEDebugEnter();
handle = (globus_l_xio_mode_e_handle_t *) driver_specific_handle;
- attr = (globus_l_xio_mode_e_attr_t *)
+ attr = (globus_l_xio_mode_e_attr_t *)
driver_attr ? driver_attr : handle->attr;
requestor = (globus_i_xio_mode_e_requestor_t *)
globus_memory_pop_node(&handle->requestor_memory);
@@ -3244,7 +3244,7 @@ globus_l_xio_mode_e_close(
descriptor = GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_CLOSE;
handle->state = GLOBUS_XIO_MODE_E_CLOSING;
- /* this implies eods are not sent yet */
+ /* this implies eods are not sent yet */
if (handle->eods_sent != handle->connection_count)
{
descriptor |= GLOBUS_XIO_MODE_E_DATA_DESCRIPTOR_EOD;
@@ -3308,7 +3308,7 @@ globus_l_xio_mode_e_close(
globus_xio_driver_finished_close(op, GLOBUS_SUCCESS);
}
GlobusXIOModeEDebugExit();
- return GLOBUS_SUCCESS;
+ return GLOBUS_SUCCESS;
error_register_eod:
error_operation_canceled:
@@ -3317,7 +3317,7 @@ globus_l_xio_mode_e_close(
error_cancel_enable:
globus_memory_push_node(&handle->requestor_memory, (void*)requestor);
GlobusXIOModeEDebugExitWithError();
- return result;
+ return result;
}
@@ -3359,8 +3359,8 @@ globus_l_xio_mode_e_cntl(
goto error;
default:
result = GlobusXIOErrorInvalidCommand(cmd);
- goto error;
- }
+ goto error;
+ }
GlobusXIOModeEDebugExit();
return GLOBUS_SUCCESS;
@@ -3383,14 +3383,14 @@ globus_l_xio_mode_e_attr_init(
/*
* create a mode_e attr structure and intialize its values
*/
- attr = (globus_l_xio_mode_e_attr_t *)
+ attr = (globus_l_xio_mode_e_attr_t *)
globus_malloc(sizeof(globus_l_xio_mode_e_attr_t));
if(!attr)
{
result = GlobusXIOErrorMemory("attr");
goto error_attr;
}
- memcpy(attr, &globus_l_xio_mode_e_attr_default,
+ memcpy(attr, &globus_l_xio_mode_e_attr_default,
sizeof(globus_l_xio_mode_e_attr_t));
*out_attr = attr;
GlobusXIOModeEDebugExit();
@@ -3451,7 +3451,7 @@ globus_l_xio_mode_e_attr_cntl(
}
case GLOBUS_XIO_MODE_E_SET_MANUAL_EODC:
attr->manual_eodc = va_arg(ap, globus_bool_t);
- break;
+ break;
case GLOBUS_XIO_MODE_E_GET_MANUAL_EODC:
{
globus_bool_t * manual_eodc_out = va_arg(ap, globus_bool_t*);
@@ -3496,11 +3496,11 @@ globus_l_xio_mode_e_attr_cntl(
default:
result = GlobusXIOErrorInvalidCommand(cmd);
goto error;
- }
+ }
GlobusXIOModeEDebugExit();
return GLOBUS_SUCCESS;
-error:
+error:
GlobusXIOModeEDebugExitWithError();
return result;
}
@@ -3518,7 +3518,7 @@ globus_l_xio_mode_e_attr_copy(
GlobusXIOName(globus_l_xio_mode_e_attr_copy);
GlobusXIOModeEDebugEnter();
- dst_attr = (globus_l_xio_mode_e_attr_t *)
+ dst_attr = (globus_l_xio_mode_e_attr_t *)
globus_malloc(sizeof(globus_l_xio_mode_e_attr_t));
if(!dst_attr)
{
@@ -3526,7 +3526,7 @@ globus_l_xio_mode_e_attr_copy(
goto error_dst_attr;
}
src_attr = (globus_l_xio_mode_e_attr_t *) src;
- memcpy(dst_attr, src_attr, sizeof(globus_l_xio_mode_e_attr_t));
+ memcpy(dst_attr, src_attr, sizeof(globus_l_xio_mode_e_attr_t));
if(src_attr->stack != NULL)
{
globus_xio_stack_copy(&dst_attr->stack, src_attr->stack);
diff --git a/xio/src/configure.ac b/xio/src/configure.ac
index 9b24677843..f6bdb3bdb6 100644
--- a/xio/src/configure.ac
+++ b/xio/src/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.60])
-AC_INIT([globus_xio], [6.6], [https://github.com/gridcf/gct/issues])
+AC_INIT([globus_xio], [6.7], [https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(MAJOR_VERSION, [${PACKAGE_VERSION%%.*}])
AC_SUBST(MINOR_VERSION, [${PACKAGE_VERSION##*.}])
diff --git a/xio/src/globus_xio_driver.c b/xio/src/globus_xio_driver.c
index a267b0806e..3504792de9 100644
--- a/xio/src/globus_xio_driver.c
+++ b/xio/src/globus_xio_driver.c
@@ -64,7 +64,7 @@ globus_l_xio_op_restarted(
{
globus_i_xio_handle_destroy(handle);
}
-
+
GlobusXIODebugInternalExit();
}
@@ -152,7 +152,7 @@ globus_i_xio_repass_read(
return res;
}
-void
+void
globus_i_xio_pass_failed(
globus_i_xio_op_t * op,
globus_i_xio_context_entry_t * my_context,
@@ -244,7 +244,7 @@ globus_i_xio_handle_destroy(
GlobusXIODebugInternalExit();
}
-/*
+/*
* called in the context lock
*/
void
@@ -260,7 +260,7 @@ globus_i_xio_handle_dec(
*destroy_handle = GLOBUS_FALSE;
- handle->ref--;
+ handle->ref--;
GlobusXIODebugPrintf(
GLOBUS_XIO_DEBUG_INFO_VERBOSE,
(_XIOSL("[globus_i_xio_handle_dec] :: handle ref at %d.\n"), handle->ref));
@@ -291,8 +291,8 @@ globus_i_xio_handle_dec(
GlobusXIODebugInternalExit();
}
-/*
- * called locked
+/*
+ * called locked
*/
void
globus_i_xio_op_destroy(
@@ -333,7 +333,7 @@ globus_i_xio_op_destroy(
op->entry[ctr].close_attr = NULL;
}
}
-
+
if(op->user_open_sbj)
{
globus_free(op->user_open_sbj);
@@ -381,7 +381,7 @@ globus_i_xio_driver_resume_op(
case GLOBUS_XIO_OPERATION_TYPE_WRITE:
globus_l_xio_driver_op_write_kickout(op);
break;
-
+
case GLOBUS_XIO_OPERATION_TYPE_CLOSE:
globus_l_xio_driver_op_close_kickout(op);
break;
@@ -456,7 +456,7 @@ globus_i_xio_will_block_cb(
{
GlobusXIOOpInc(op);
deliver_type = *op->entry[ndx].deliver_type;
- *op->entry[ndx].deliver_type =
+ *op->entry[ndx].deliver_type =
GLOBUS_XIO_OPERATION_TYPE_FINISHED;
op->entry[ndx].deliver_type = NULL;
}
@@ -535,7 +535,7 @@ globus_l_xio_driver_op_write_kickout(
GlobusIXIOClearCancel(op);
/*
- * before releasing the op back to the user we can safely set this
+ * before releasing the op back to the user we can safely set this
* outside of a mutex. Once the users callbcak is called the value
* on the local stack may be changed, theus the magic.
*/
@@ -554,20 +554,20 @@ globus_l_xio_driver_op_write_kickout(
my_op->_op_ent_data_cb(op, GlobusXIOObjToResult(op->cached_obj),
my_op->_op_ent_nbytes, my_op->user_arg);
-
+
globus_thread_blocking_callback_pop(&wb_ndx);
}
else
{
if(my_op->_op_ent_data_cb == NULL)
{
- globus_xio_driver_finished_write(op,
- GlobusXIOObjToResult(op->cached_obj),
+ globus_xio_driver_finished_write(op,
+ GlobusXIOObjToResult(op->cached_obj),
my_op->_op_ent_nbytes);
}
else
{
- my_op->_op_ent_data_cb(op,
+ my_op->_op_ent_data_cb(op,
GlobusXIOObjToResult(op->cached_obj),
my_op->_op_ent_nbytes, my_op->user_arg);
}
@@ -576,8 +576,8 @@ globus_l_xio_driver_op_write_kickout(
globus_xio_driver_write_delivered(op, ndx, &deliver_type);
GlobusXIODebugInternalExit();
-}
-
+}
+
void
globus_l_xio_driver_op_read_kickout(
void * user_arg)
@@ -600,9 +600,9 @@ globus_l_xio_driver_op_read_kickout(
handle = op->_op_handle;
GlobusIXIOClearCancel(op);
-
+
/*
- * before releasing the op back to the user we can safely set this
+ * before releasing the op back to the user we can safely set this
* outside of a mutex. Once the users callbcak is called the value
* on the local stack may be changed, theus the magic.
*/
@@ -621,20 +621,20 @@ globus_l_xio_driver_op_read_kickout(
my_op->_op_ent_data_cb(op, GlobusXIOObjToResult(op->cached_obj),
my_op->_op_ent_nbytes, my_op->user_arg);
-
+
globus_thread_blocking_callback_pop(&wb_ndx);
}
else
{
if(my_op->_op_ent_data_cb == NULL)
{
- globus_xio_driver_finished_read(op,
- GlobusXIOObjToResult(op->cached_obj),
+ globus_xio_driver_finished_read(op,
+ GlobusXIOObjToResult(op->cached_obj),
my_op->_op_ent_nbytes);
}
else
{
- my_op->_op_ent_data_cb(op,
+ my_op->_op_ent_data_cb(op,
GlobusXIOObjToResult(op->cached_obj),
my_op->_op_ent_nbytes, my_op->user_arg);
}
@@ -643,8 +643,8 @@ globus_l_xio_driver_op_read_kickout(
globus_xio_driver_read_delivered(op, ndx, &deliver_type);
GlobusXIODebugInternalExit();
-}
-
+}
+
void
globus_l_xio_driver_purge_read_eof(
globus_i_xio_context_entry_t * my_context)
@@ -655,7 +655,7 @@ globus_l_xio_driver_purge_read_eof(
GlobusXIODebugInternalEnter();
while(!globus_list_empty(my_context->eof_op_list))
{
- /* we can only get here if a eof has been received */
+ /* we can only get here if a eof has been received */
globus_assert(my_context->state ==
GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED ||
my_context->state ==
@@ -728,7 +728,7 @@ globus_i_xio_driver_start_close(
globus_xio_driver_finished_close(op, res);
my_op->in_register = GLOBUS_FALSE;
}
-
+
if((res == GLOBUS_SUCCESS || !can_fail) && my_op->prev_ndx == 0)
{
while(op->finished_delayed)
@@ -746,7 +746,7 @@ globus_i_xio_driver_start_close(
{
globus_i_xio_op_destroy(op, &destroy_handle);
}
-
+
context->ref--;
if(context->ref == 0)
{
@@ -761,7 +761,7 @@ globus_i_xio_driver_start_close(
}
if(destroy_context)
{
- /* the only way we'll be destroying the context is if this was a
+ /* the only way we'll be destroying the context is if this was a
* driver op and the handle no longer exists
*/
globus_assert(!destroy_handle);
@@ -820,19 +820,19 @@ globus_l_xio_driver_op_accept_kickout(
globus_i_xio_op_t * op;
globus_i_xio_op_entry_t * my_op;
GlobusXIOName(globus_l_xio_driver_op_accept_kickout);
-
+
GlobusXIODebugInternalEnter();
op = (globus_i_xio_op_t *) user_arg;
-
+
my_op = &op->entry[op->ndx - 1];
op->ndx = my_op->prev_ndx;
-
+
/* driver's can't cancel accept ops yet, dont need this
* this call only works for regular ops, anyway
- *
+ *
GlobusIXIOClearCancel(op);
*/
-
+
if(my_op->cb != NULL)
{
my_op->cb(
@@ -860,7 +860,7 @@ globus_l_xio_driver_open_op_kickout(
globus_i_xio_op_t * op;
globus_xio_operation_type_t deliver_type;
GlobusXIOName(globus_l_xio_driver_open_op_kickout);
-
+
GlobusXIODebugInternalEnter();
op = (globus_i_xio_op_t *) user_arg;
@@ -891,12 +891,12 @@ globus_l_xio_driver_open_op_kickout(
{
if(my_op->cb == NULL)
{
- globus_xio_driver_finished_open(NULL, op,
+ globus_xio_driver_finished_open(NULL, op,
GlobusXIOObjToResult(op->cached_obj));
}
else
{
- my_op->cb(op,
+ my_op->cb(op,
GlobusXIOObjToResult(op->cached_obj), my_op->user_arg);
}
}
@@ -922,15 +922,15 @@ globus_i_xio_context_destroy(
globus_assert(xio_context->ref == 0);
GlobusXIODebugPrintf(
- GLOBUS_XIO_DEBUG_INFO_VERBOSE,
- (_XIOSL(" context @ 0x%x: ref=%d size=%d\n"),
+ GLOBUS_XIO_DEBUG_INFO_VERBOSE,
+ (_XIOSL(" context @ 0x%x: ref=%d size=%d\n"),
xio_context, xio_context->ref, xio_context->stack_size));
-
+
for(ctr = 0; ctr < xio_context->stack_size; ctr++)
{
globus_fifo_destroy(&xio_context->entry[ctr].pending_read_queue);
}
-
+
globus_mutex_destroy(&xio_context->mutex);
globus_mutex_destroy(&xio_context->cancel_mutex);
globus_memory_destroy(&xio_context->op_memory);
@@ -1000,7 +1000,7 @@ globus_i_xio_attr_get_ds(
/*
* read ahead stuff
*/
-void
+void
globus_xio_driver_operation_destroy(
globus_xio_operation_t operation)
{
@@ -1060,16 +1060,16 @@ globus_xio_driver_operation_create(
index++)
{
}
-
+
if(index == context->stack_size)
{
res = GlobusXIOErrorParameter("driver_handle");
goto err;
}
-
+
/* driver_handles are to the drivers below the current one */
index--;
-
+
GlobusXIOOperationCreate(op, context);
if(op == NULL)
{
@@ -1090,7 +1090,7 @@ globus_xio_driver_operation_create(
my_op->_op_ent_wait_for = 0;
my_op->prev_ndx = -1;
my_op->type = GLOBUS_XIO_OPERATION_TYPE_DRIVER;
-
+
globus_mutex_lock(&context->mutex);
context->ref++;
globus_mutex_unlock(&context->mutex);
@@ -1147,12 +1147,12 @@ globus_i_xio_driver_attr_cntl(
attr->ndx++;
}
- /* if the driver is capable of parsing the strings
+ /* if the driver is capable of parsing the strings
and this is the string parser command, if there is
no table defined the SET_STRING command will be passed
to the driver. this is fine. they may want to parse it
in their own way */
- if(driver->string_table != NULL &&
+ if(driver->string_table != NULL &&
cmd == GLOBUS_XIO_SET_STRING_OPTIONS)
{
char * opt_str;
@@ -1174,7 +1174,7 @@ globus_i_xio_driver_attr_cntl(
{
res = driver->attr_cntl_func(ds, cmd, ap);
}
-
+
if(res != GLOBUS_SUCCESS)
{
goto err;
@@ -1295,7 +1295,7 @@ globus_i_xio_driver_attr_cntl(
tmp_str = va_arg(ap, char *);
attr->user_open_pw = globus_libc_strdup(tmp_str);
break;
-
+
default:
res = GlobusXIOErrorInvalidCommand(general_cmd);
goto err;
@@ -1339,7 +1339,7 @@ globus_i_xio_driver_dd_cntl(
{
if(op->entry[ctr].open_attr == NULL)
{
- res =
+ res =
op->_op_server->entry[ctr].driver->attr_init_func(
&op->entry[ctr].open_attr);
}
@@ -1355,7 +1355,7 @@ globus_i_xio_driver_dd_cntl(
case GLOBUS_XIO_OPERATION_TYPE_OPEN:
if(op->entry[ctr].open_attr == NULL)
{
- res =
+ res =
op->_op_context->entry[ctr].driver->attr_init_func(
&op->entry[ctr].open_attr);
}
@@ -1365,7 +1365,7 @@ globus_i_xio_driver_dd_cntl(
case GLOBUS_XIO_OPERATION_TYPE_CLOSE:
if(op->entry[ctr].close_attr == NULL)
{
- res =
+ res =
op->_op_context->entry[ctr].driver->attr_init_func(
&op->entry[ctr].close_attr);
}
@@ -1375,7 +1375,7 @@ globus_i_xio_driver_dd_cntl(
default:
if(op->entry[ctr].dd == NULL)
{
- res =
+ res =
op->_op_context->entry[ctr].driver->attr_init_func(
&op->entry[ctr].dd);
}
@@ -1408,16 +1408,16 @@ globus_i_xio_driver_dd_cntl(
if (attr_cntl_func)
{
- /* if the driver is capable of parsing the strings
+ /* if the driver is capable of parsing the strings
and this is the string parser command, if there is
no table defined the SET_STRING command will be passed
to the driver. this is fine. they may want to parse it
in their own way */
- if(driver->string_table != NULL &&
+ if(driver->string_table != NULL &&
cmd == GLOBUS_XIO_SET_STRING_OPTIONS)
{
char * opt_str;
-
+
opt_str = va_arg(ap, char *);
res = globus_i_xio_string_cntl_parser(
opt_str,
@@ -1453,7 +1453,7 @@ globus_i_xio_driver_dd_cntl(
else
{
globus_off_t * out_offt;
-
+
/* could end up here with non-dd attr cntls... none supported at driver
* level yet, so no biggie
*/
@@ -1462,12 +1462,12 @@ globus_i_xio_driver_dd_cntl(
case GLOBUS_XIO_DD_SET_OFFSET:
op->_op_ent_offset = va_arg(ap, globus_off_t);
break;
-
+
case GLOBUS_XIO_DD_GET_OFFSET:
out_offt = va_arg(ap, globus_off_t *);
*out_offt = op->_op_ent_offset;
break;
-
+
default:
res = GlobusXIOErrorInvalidCommand(cmd);
goto err;
@@ -1593,7 +1593,7 @@ globus_i_xio_driver_handle_cntl(
for(ctr = start_ndx; ctr < context->stack_size; ctr++)
{
called = GLOBUS_FALSE;
-
+
if(driver == context->entry[ctr].driver ||
driver == GLOBUS_XIO_QUERY)
{
@@ -1609,7 +1609,7 @@ globus_i_xio_driver_handle_cntl(
ap);
called = GLOBUS_TRUE;
}
- else if(context->entry[ctr].state !=
+ else if(context->entry[ctr].state !=
GLOBUS_XIO_CONTEXT_STATE_NONE &&
context->entry[ctr].driver->handle_cntl_func)
{
@@ -1619,12 +1619,12 @@ globus_i_xio_driver_handle_cntl(
ap);
called = GLOBUS_TRUE;
}
-
+
if(called && res == GLOBUS_SUCCESS)
{
break;
}
-
+
if(driver == GLOBUS_XIO_QUERY)
{
if(called && res != GLOBUS_SUCCESS &&
@@ -1639,7 +1639,7 @@ globus_i_xio_driver_handle_cntl(
res = GlobusXIOErrorInvalidDriver(
_XIOSL("handle_cntl not supported"));
}
-
+
if(res != GLOBUS_SUCCESS)
{
goto err;
@@ -1723,7 +1723,7 @@ globus_xio_driver_merge_handle(
goto err;
}
dst_context->entry[ctr].whos_my_daddy = dst_context;
- dst_context->entry[ctr].driver_handle =
+ dst_context->entry[ctr].driver_handle =
src_context->entry[ctr].driver_handle;
GlobusXIOContextStateChange(&dst_context->entry[ctr],
@@ -1774,7 +1774,7 @@ globus_xio_driver_handle_cntl(
{
}
}
-
+
res = globus_i_xio_driver_handle_cntl(context, start_ndx, driver, cmd, ap);
va_end(ap);
if(res != GLOBUS_SUCCESS)
@@ -1818,22 +1818,22 @@ globus_xio_driver_operation_cancel(
source_ndx++)
{
}
-
+
if(source_ndx == context->stack_size)
{
res = GlobusXIOErrorParameter("driver_handle");
goto err;
}
-
+
/* driver_handles are to the drivers below the current one */
source_ndx--;
-
+
globus_mutex_lock(&context->cancel_mutex);
{
res = globus_i_xio_operation_cancel(op, source_ndx);
}
globus_mutex_unlock(&context->cancel_mutex);
-
+
GlobusXIODebugExit();
return GLOBUS_SUCCESS;
@@ -1853,10 +1853,10 @@ globus_xio_driver_set_eof_received(
GlobusXIOName(globus_xio_driver_set_eof_received);
GlobusXIODebugEnter();
-
+
context = op->_op_context;
my_context = &context->entry[op->entry[op->ndx - 1].prev_ndx];
-
+
globus_mutex_lock(&context->mutex);
{
globus_assert(
@@ -1865,9 +1865,9 @@ globus_xio_driver_set_eof_received(
globus_assert(
my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN ||
my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED ||
- my_context->state ==
+ my_context->state ==
GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING);
-
+
if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN)
{
GlobusXIOContextStateChange(my_context,
@@ -1875,7 +1875,7 @@ globus_xio_driver_set_eof_received(
}
}
globus_mutex_unlock(&context->mutex);
-
+
GlobusXIODebugExit();
}
@@ -1889,10 +1889,10 @@ globus_xio_driver_eof_received(
GlobusXIOName(globus_xio_driver_eof_received);
GlobusXIODebugEnter();
-
+
context = op->_op_context;
my_context = &context->entry[op->entry[op->ndx - 1].prev_ndx];
-
+
globus_mutex_lock(&context->mutex);
{
globus_assert(
@@ -1901,20 +1901,20 @@ globus_xio_driver_eof_received(
globus_assert(
my_context->state == GLOBUS_XIO_CONTEXT_STATE_OPEN ||
my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED ||
- my_context->state ==
+ my_context->state ==
GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING);
-
+
if(my_context->state == GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED ||
- my_context->state ==
+ my_context->state ==
GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING)
{
received = GLOBUS_TRUE;
}
}
globus_mutex_unlock(&context->mutex);
-
+
GlobusXIODebugExit();
-
+
return received;
}
@@ -1942,7 +1942,7 @@ globus_xio_driver_init(
goto err;
}
memset(driver, '\0', sizeof(globus_i_xio_driver_t));
-
+
driver->name = globus_libc_strdup(driver_name);
if(!driver->name)
{
@@ -1950,7 +1950,7 @@ globus_xio_driver_init(
res = GlobusXIOErrorMemory("driver->name");
goto err;
}
-
+
driver->user_data = user_data;
*out_driver = driver;
@@ -2089,7 +2089,7 @@ globus_xio_driver_set_server(
* @details
* This function adds a callback to a driver that will be called before
* a server handle is created by XIO. This function has the same signature
- * as the server_init_func in the driver, but is always called with a
+ * as the server_init_func in the driver, but is always called with a
* NULL contact string. There is no support for calling a pass() or finished()
* function for this interface. It may inspect and modify its attributes
* and operation, but can not directly return any data or set a driver-specific
@@ -2269,7 +2269,7 @@ globus_xio_operation_enable_cancel(
{
mutex = &op->_op_context->cancel_mutex;
}
-
+
globus_mutex_lock(mutex);
{
already_canceled = op->canceled != 0;
@@ -2280,7 +2280,7 @@ globus_xio_operation_enable_cancel(
}
}
globus_mutex_unlock(mutex);
-
+
return already_canceled;
}
@@ -2298,7 +2298,7 @@ globus_xio_operation_disable_cancel(
{
mutex = &op->_op_context->cancel_mutex;
}
-
+
globus_mutex_lock(mutex);
{
op->cancel_cb = NULL;
@@ -2347,7 +2347,7 @@ globus_xio_operation_get_user_driver(
/**
* @brief Get the XIO transport driver associated with an op
- * @ingroup globus_xio_driver_programming
+ * @ingroup string_globus_xio_driver_programming
*/
globus_xio_driver_t
globus_xio_operation_get_transport_user_driver(
@@ -2400,7 +2400,7 @@ globus_xio_operation_attr_cntl(
gss_cred_id_t * out_cred;
va_list ap;
GlobusXIOName(globus_xio_operation_attr_cntl);
-
+
if(op == NULL)
{
result = GlobusXIOErrorParameter("op");
@@ -2465,7 +2465,7 @@ globus_xio_operation_get_data_descriptor(
op->entry[op->ndx - 1].dd = NULL;
}
}
-
+
return op->entry[op->ndx - 1].dd;
}
@@ -2488,14 +2488,14 @@ globus_xio_operation_copy_stack(
{
goto error_init;
}
-
+
istack = *stack;
-
+
switch(op->type)
{
case GLOBUS_XIO_OPERATION_TYPE_SERVER_INIT:
server = op->_op_server;
-
+
for(ndx = op->stack_size - 1; ndx > op->ndx; ndx--)
{
istack->size++;
@@ -2503,10 +2503,10 @@ globus_xio_operation_copy_stack(
&istack->driver_stack, server->entry[ndx].driver);
}
break;
-
+
case GLOBUS_XIO_OPERATION_TYPE_ACCEPT:
server = op->_op_server;
-
+
for(ndx = op->stack_size - 1; ndx >= op->ndx; ndx--)
{
istack->size++;
@@ -2514,10 +2514,10 @@ globus_xio_operation_copy_stack(
&istack->driver_stack, server->entry[ndx].driver);
}
break;
-
+
default:
context = op->_op_context;
-
+
for(ndx = op->stack_size - 1; ndx >= op->ndx; ndx--)
{
istack->size++;
@@ -2526,10 +2526,10 @@ globus_xio_operation_copy_stack(
}
break;
}
-
+
GlobusXIODebugExit();
return GLOBUS_SUCCESS;
-
+
error_init:
GlobusXIODebugExitWithError();
return result;
diff --git a/xio/src/globus_xio_system_select.c b/xio/src/globus_xio_system_select.c
index dd1d5eff04..f5059535f5 100644
--- a/xio/src/globus_xio_system_select.c
+++ b/xio/src/globus_xio_system_select.c
@@ -157,7 +157,7 @@ globus_l_xio_system_wakeup_handler(
GlobusXIOName(globus_l_xio_system_wakeup_handler);
GlobusXIOSystemDebugEnter();
-
+
if(!globus_l_xio_system_shutdown_called)
{
byte = 0;
@@ -167,7 +167,7 @@ globus_l_xio_system_wakeup_handler(
globus_l_xio_system_wakeup_pipe[1], &byte, sizeof(byte));
} while(rc < 0 && errno == EINTR);
}
-
+
GlobusXIOSystemDebugExit();
}
@@ -180,12 +180,12 @@ globus_l_xio_system_activate(void)
globus_result_t result;
globus_reltime_t period;
GlobusXIOName(globus_l_xio_system_activate);
-
+
if(globus_i_xio_system_common_activate() != GLOBUS_SUCCESS)
{
goto error_activate;
}
-
+
GlobusXIOSystemDebugEnter();
globus_cond_init(&globus_l_xio_system_cond, GLOBUS_NULL);
@@ -245,7 +245,7 @@ globus_l_xio_system_activate(void)
}
fcntl(globus_l_xio_system_wakeup_pipe[0], F_SETFD, FD_CLOEXEC);
fcntl(globus_l_xio_system_wakeup_pipe[1], F_SETFD, FD_CLOEXEC);
-
+
globus_l_xio_system_highest_fd = globus_l_xio_system_wakeup_pipe[0];
FD_SET(globus_l_xio_system_wakeup_pipe[0], globus_l_xio_system_read_fds);
@@ -262,7 +262,7 @@ globus_l_xio_system_activate(void)
"globus_callback_register_periodic", result);
goto error_register;
}
-
+
globus_callback_add_wakeup_handler(
globus_l_xio_system_wakeup_handler, GLOBUS_NULL);
@@ -283,7 +283,7 @@ globus_l_xio_system_activate(void)
globus_mutex_destroy(&globus_l_xio_system_cancel_mutex);
globus_mutex_destroy(&globus_l_xio_system_fdset_mutex);
globus_cond_destroy(&globus_l_xio_system_cond);
-
+
GlobusXIOSystemDebugExitWithError();
globus_i_xio_system_common_deactivate();
error_activate:
@@ -297,9 +297,9 @@ globus_l_xio_system_unregister_periodic_cb(
{
globus_bool_t * signaled;
GlobusXIOName(globus_l_xio_system_unregister_periodic_cb);
-
+
GlobusXIOSystemDebugEnter();
-
+
signaled = (globus_bool_t *) user_args;
globus_mutex_lock(&globus_l_xio_system_fdset_mutex);
{
@@ -322,7 +322,7 @@ globus_l_xio_system_deactivate(void)
globus_mutex_lock(&globus_l_xio_system_fdset_mutex);
{
globus_bool_t signaled;
-
+
globus_l_xio_system_shutdown_called = GLOBUS_TRUE;
signaled = GLOBUS_FALSE;
globus_callback_unregister(
@@ -354,7 +354,7 @@ globus_l_xio_system_deactivate(void)
globus_cond_destroy(&globus_l_xio_system_cond);
GlobusXIOSystemDebugExit();
-
+
globus_i_xio_system_common_deactivate();
return GLOBUS_SUCCESS;
@@ -381,25 +381,25 @@ globus_l_xio_system_handle_init(
result = GlobusXIOErrorMemory("handle");
goto error_alloc;
}
-
+
handle->type = type;
handle->fd = fd;
-
+
handle->file_position = globus_xio_system_file_get_position(fd);
-
+
rc = globus_l_xio_system_add_nonblocking(handle);
if(rc < 0)
{
result = GlobusXIOErrorSystemError("fcntl", errno);
goto error_fcntl;
}
-
+
globus_mutex_init(&handle->lock, NULL);
-
+
*u_handle = handle;
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
-
+
error_fcntl:
globus_free(handle);
error_alloc:
@@ -439,7 +439,7 @@ globus_l_xio_system_handle_destroy(
globus_l_xio_system_remove_nonblocking(handle);
globus_free(handle);
-
+
GlobusXIOSystemDebugExitFD(fd);
}
@@ -473,21 +473,21 @@ globus_l_xio_system_cancel_cb(
globus_mutex_lock(&globus_l_xio_system_cancel_mutex);
{
- if(op_info->state != GLOBUS_I_XIO_SYSTEM_OP_COMPLETE &&
+ if(op_info->state != GLOBUS_I_XIO_SYSTEM_OP_COMPLETE &&
op_info->state != GLOBUS_I_XIO_SYSTEM_OP_CANCELED)
{
op_info->error = reason == GLOBUS_XIO_ERROR_TIMEOUT
? GlobusXIOErrorObjTimeout()
: GlobusXIOErrorObjCanceled();
-
+
globus_mutex_lock(&globus_l_xio_system_fdset_mutex);
{
globus_bool_t pend;
-
+
if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_NEW)
{
op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED;
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] fd=%d, Canceling NEW\n"),
@@ -498,12 +498,12 @@ globus_l_xio_system_cancel_cb(
if(globus_l_xio_system_select_active)
{
op_info->state = GLOBUS_I_XIO_SYSTEM_OP_CANCELED;
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] fd=%d, Canceling Active\n"),
_xio_name, op_info->handle->fd));
-
+
/* pend the cancel for after select wakes up */
if(!globus_l_xio_system_wakeup_pending)
{
@@ -518,12 +518,12 @@ globus_l_xio_system_cancel_cb(
globus_result_t result;
op_info->state = GLOBUS_I_XIO_SYSTEM_OP_COMPLETE;
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] fd=%d, Canceling Pending\n"),
_xio_name, op_info->handle->fd));
-
+
/* unregister and kickout now */
result = globus_callback_register_oneshot(
GLOBUS_NULL,
@@ -621,7 +621,7 @@ globus_l_xio_system_register_read_fd(
result = GlobusXIOErrorNotActivated();
goto error_deactivated;
}
-
+
if(fd >= globus_l_xio_system_max_fds)
{
result = GlobusXIOErrorSystemResource(_XIOSL("too many fds"));
@@ -661,7 +661,7 @@ globus_l_xio_system_register_read_fd(
*/
globus_l_xio_system_select_wakeup();
}
-
+
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -706,13 +706,13 @@ globus_l_xio_system_register_write_fd(
result = globus_error_put(write_info->error);
goto error_canceled;
}
-
+
if(globus_l_xio_system_shutdown_called)
{
result = GlobusXIOErrorNotActivated();
goto error_deactivated;
}
-
+
if(fd >= globus_l_xio_system_max_fds)
{
result = GlobusXIOErrorSystemResource(_XIOSL("too many fds"));
@@ -743,7 +743,7 @@ globus_l_xio_system_register_write_fd(
write_info->state = GLOBUS_I_XIO_SYSTEM_OP_PENDING;
}
globus_mutex_unlock(&globus_l_xio_system_fdset_mutex);
-
+
if(do_wakeup)
{
/* I do this outside the lock because the select thread is likely
@@ -752,7 +752,7 @@ globus_l_xio_system_register_write_fd(
*/
globus_l_xio_system_select_wakeup();
}
-
+
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -885,7 +885,7 @@ globus_l_xio_system_kickout(
op_info->sop.data.start_iov);
break;
}
-
+
GlobusXIOSystemDebugExitFD(fd);
GlobusIXIOSystemFreeOperation(op_info);
}
@@ -899,7 +899,7 @@ globus_l_xio_system_select_wakeup(void)
GlobusXIOName(globus_l_xio_system_select_wakeup);
GlobusXIOSystemDebugEnter();
-
+
byte = 0;
do
@@ -985,15 +985,14 @@ globus_l_xio_system_handle_read(
}
else
{
- int rc;
globus_l_xio_system_t tmp_handle;
*read_info->sop.non_data.out_fd = new_fd;
tmp_handle.fd = new_fd;
tmp_handle.type = GLOBUS_XIO_SYSTEM_TCP;
- rc = globus_l_xio_system_remove_nonblocking(&tmp_handle);
-
+ globus_l_xio_system_remove_nonblocking(&tmp_handle);
+
read_info->nbytes++;
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
@@ -1026,12 +1025,12 @@ globus_l_xio_system_handle_read(
return GLOBUS_FALSE;
break;
}
-
+
if(result != GLOBUS_SUCCESS)
{
read_info->error = globus_error_get(result);
}
-
+
/* always true for accept operations */
if(read_info->nbytes >= read_info->waitforbytes ||
result != GLOBUS_SUCCESS)
@@ -1133,12 +1132,12 @@ globus_l_xio_system_handle_write(
return GLOBUS_FALSE;
break;
}
-
+
if(result != GLOBUS_SUCCESS)
{
write_info->error = globus_error_get(result);
}
-
+
/* always true for connect operations */
if(write_info->nbytes >= write_info->waitforbytes ||
result != GLOBUS_SUCCESS)
@@ -1186,7 +1185,7 @@ globus_l_xio_system_bad_apple(void)
GlobusXIOName(globus_l_xio_system_bad_apple);
GlobusXIOSystemDebugEnter();
-
+
globus_mutex_lock(&globus_l_xio_system_fdset_mutex);
{
for(fd = 0; fd <= globus_l_xio_system_highest_fd; fd++)
@@ -1199,9 +1198,9 @@ globus_l_xio_system_bad_apple(void)
{
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
- (_XIOSL("[%s] fd=%d, Canceling read bad apple\n"),
+ (_XIOSL("[%s] fd=%d, Canceling read bad apple\n"),
_xio_name, fd));
-
+
op_info = globus_l_xio_system_read_operations[fd];
if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_PENDING)
{
@@ -1213,7 +1212,7 @@ globus_l_xio_system_bad_apple(void)
}
}
}
-
+
if(FD_ISSET(fd, globus_l_xio_system_write_fds))
{
rc = fstat(fd, &stat_buf);
@@ -1224,7 +1223,7 @@ globus_l_xio_system_bad_apple(void)
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] fd=%d, Canceling write bad apple\n"),
_xio_name, fd));
-
+
op_info = globus_l_xio_system_write_operations[fd];
if(op_info->state == GLOBUS_I_XIO_SYSTEM_OP_PENDING)
{
@@ -1239,7 +1238,7 @@ globus_l_xio_system_bad_apple(void)
}
}
globus_mutex_unlock(&globus_l_xio_system_fdset_mutex);
-
+
GlobusXIOSystemDebugExit();
}
@@ -1264,7 +1263,7 @@ globus_l_xio_system_poll(
int nready;
int fd;
int save_errno;
-
+
time_left_is_zero = GLOBUS_FALSE;
time_left_is_infinity = GLOBUS_FALSE;
@@ -1294,11 +1293,11 @@ globus_l_xio_system_poll(
globus_l_xio_system_select_active = GLOBUS_TRUE;
}
globus_mutex_unlock(&globus_l_xio_system_fdset_mutex);
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] Before select\n"), _xio_name));
-
+
nready = select(
num,
globus_l_xio_system_ready_reads,
@@ -1308,7 +1307,7 @@ globus_l_xio_system_poll(
GlobusXIOSystemUpdateErrno();
save_errno = errno;
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] After select\n"), _xio_name));
@@ -1339,7 +1338,7 @@ globus_l_xio_system_poll(
{
globus_l_xio_system_bad_apple();
}
-
+
/*
* can't really do anything about other errors
* so, set ready fds to known state in case there are things
@@ -1361,11 +1360,11 @@ globus_l_xio_system_poll(
fd = (int) (intptr_t) globus_list_remove(
&globus_l_xio_system_canceled_reads,
globus_l_xio_system_canceled_reads);
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] fd=%d, Setting canceled read\n"), _xio_name, fd));
-
+
if(!FD_ISSET(fd, globus_l_xio_system_ready_reads))
{
FD_SET(fd, globus_l_xio_system_ready_reads);
@@ -1378,11 +1377,11 @@ globus_l_xio_system_poll(
fd = (int) (intptr_t) globus_list_remove(
&globus_l_xio_system_canceled_writes,
globus_l_xio_system_canceled_writes);
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
(_XIOSL("[%s] fd=%d, Setting canceled read\n"), _xio_name, fd));
-
+
if(!FD_ISSET(fd, globus_l_xio_system_ready_writes))
{
FD_SET(fd, globus_l_xio_system_ready_writes);
@@ -1486,7 +1485,7 @@ globus_xio_system_socket_register_connect(
goto error_register;
}
-
+
/* handle could be destroyed by time we get here - no touch! */
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -1514,7 +1513,7 @@ globus_xio_system_socket_register_accept(
GlobusXIOName(globus_xio_system_socket_register_accept);
GlobusXIOSystemDebugEnterFD(fd);
-
+
GlobusIXIOSystemAllocOperation(op_info);
if(!op_info)
{
@@ -1539,7 +1538,7 @@ globus_xio_system_socket_register_accept(
_XIOSL("globus_l_xio_system_register_read_fd"), result);
goto error_register;
}
-
+
/* handle could be destroyed by time we get here - no touch! */
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -1576,23 +1575,23 @@ globus_l_xio_system_register_read(
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_DATA,
(_XIOSL("[%s] Waiting for %u bytes\n"), _xio_name, (unsigned) waitforbytes));
-
+
GlobusIXIOSystemAllocOperation(op_info);
if(!op_info)
{
result = GlobusXIOErrorMemory("op_info");
goto error_op_info;
}
-
+
GlobusIXIOSystemAllocIovec(u_iovc, iov);
if(!iov)
{
result = GlobusXIOErrorMemory("iov");
goto error_iovec;
}
-
+
GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc);
-
+
op_info->type = GLOBUS_I_XIO_SYSTEM_OP_READ;
op_info->sop.data.start_iov = iov;
op_info->sop.data.start_iovc = u_iovc;
@@ -1600,7 +1599,7 @@ globus_l_xio_system_register_read(
op_info->sop.data.iovc = u_iovc;
op_info->sop.data.addr = from;
op_info->sop.data.flags = flags;
-
+
op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW;
op_info->op = op;
op_info->handle = handle;
@@ -1608,7 +1607,7 @@ globus_l_xio_system_register_read(
op_info->sop.data.callback = callback;
op_info->waitforbytes = waitforbytes;
op_info->offset = offset;
-
+
result = globus_l_xio_system_register_read_fd(fd, op_info);
if(result != GLOBUS_SUCCESS)
{
@@ -1616,7 +1615,7 @@ globus_l_xio_system_register_read(
"globus_l_xio_system_register_read_fd", result);
goto error_register;
}
-
+
/* handle could be destroyed by time we get here - no touch! */
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -1705,14 +1704,14 @@ globus_l_xio_system_register_write(
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_DATA,
(_XIOSL("[%s] Waiting for %u bytes\n"), _xio_name, (unsigned) waitforbytes));
-
+
GlobusIXIOSystemAllocOperation(op_info);
if(!op_info)
{
result = GlobusXIOErrorMemory("op_info");
goto error_op_info;
}
-
+
GlobusIXIOSystemAllocIovec(u_iovc, iov);
if(!iov)
{
@@ -1721,7 +1720,7 @@ globus_l_xio_system_register_write(
}
GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc);
-
+
op_info->type = GLOBUS_I_XIO_SYSTEM_OP_WRITE;
op_info->sop.data.start_iov = iov;
op_info->sop.data.start_iovc = u_iovc;
@@ -1729,7 +1728,7 @@ globus_l_xio_system_register_write(
op_info->sop.data.iovc = u_iovc;
op_info->sop.data.addr = to;
op_info->sop.data.flags = flags;
-
+
op_info->state = GLOBUS_I_XIO_SYSTEM_OP_NEW;
op_info->op = op;
op_info->handle = handle;
@@ -1737,7 +1736,7 @@ globus_l_xio_system_register_write(
op_info->sop.data.callback = callback;
op_info->waitforbytes = waitforbytes;
op_info->offset = offset;
-
+
result = globus_l_xio_system_register_write_fd(fd, op_info);
if(result != GLOBUS_SUCCESS)
{
@@ -1745,7 +1744,7 @@ globus_l_xio_system_register_write(
"globus_l_xio_system_register_write_fd", result);
goto error_register;
}
-
+
/* handle could be destroyed by time we get here - no touch! */
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -1824,7 +1823,7 @@ globus_l_xio_system_try_read(
if(handle->type == GLOBUS_XIO_SYSTEM_FILE)
{
globus_result_t result;
-
+
globus_mutex_lock(&handle->lock);
{
if(handle->file_position != offset &&
@@ -1835,19 +1834,19 @@ globus_l_xio_system_try_read(
("[globus_l_xio_system_try_read] fd=%d, "
"Changing file position to %" GLOBUS_OFF_T_FORMAT "\n",
handle->fd, offset));
-
+
/* assume success as possible failures are ignorable */
lseek(handle->fd, offset, SEEK_SET);
handle->file_position = offset;
}
-
+
result = globus_i_xio_system_file_try_read(
handle->fd, iov, iovc, nbytes);
-
+
handle->file_position += *nbytes;
}
globus_mutex_unlock(&handle->lock);
-
+
return result;
}
else
@@ -1870,28 +1869,27 @@ globus_l_xio_system_read(
globus_size_t * u_nbytes)
{
globus_result_t result;
- int rc;
GlobusXIOName(globus_l_xio_system_read);
GlobusXIOSystemDebugEnter();
result = globus_l_xio_system_try_read(
handle, offset, u_iov, u_iovc, flags, from, u_nbytes);
-
+
if(result == GLOBUS_SUCCESS && *u_nbytes < waitforbytes)
{
struct iovec * iov;
int iovc;
globus_size_t nbytes = *u_nbytes;
globus_size_t total = nbytes;
-
+
/*
* XXX this is not thread safe... both reads and writes are mucking
* with blocking status.
* worst case, we read 0 bytes in the loop below, return, and xio
* calls us again to finish up.
*/
- rc = globus_l_xio_system_remove_nonblocking(handle);
+ globus_l_xio_system_remove_nonblocking(handle);
GlobusIXIOSystemAllocIovec(u_iovc, iov);
if(!iov)
{
@@ -1902,7 +1900,7 @@ globus_l_xio_system_read(
GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc);
u_iov = iov;
iovc = u_iovc;
-
+
do
{
if(total > 0)
@@ -1910,25 +1908,25 @@ globus_l_xio_system_read(
/* only capture source first time around */
from = GLOBUS_NULL;
}
-
+
offset += nbytes;
GlobusIXIOUtilAdjustIovec(iov, iovc, nbytes);
result = globus_l_xio_system_try_read(
handle, offset, iov, iovc, flags, from, &nbytes);
total += nbytes;
} while(result == GLOBUS_SUCCESS && nbytes && total < waitforbytes);
-
+
*u_nbytes = total;
-
+
GlobusIXIOSystemFreeIovec(u_iovc, (globus_xio_iovec_t *) u_iov);
- rc = globus_l_xio_system_add_nonblocking(handle);
+ globus_l_xio_system_add_nonblocking(handle);
}
GlobusXIOSystemDebugExit();
return result;
error_iovec:
- rc = globus_l_xio_system_add_nonblocking(handle);
+ globus_l_xio_system_add_nonblocking(handle);
GlobusXIOSystemDebugExitWithError();
return result;
}
@@ -1974,7 +1972,7 @@ globus_l_xio_system_try_write(
if(handle->type == GLOBUS_XIO_SYSTEM_FILE)
{
globus_result_t result;
-
+
globus_mutex_lock(&handle->lock);
{
if(handle->file_position != offset &&
@@ -1985,19 +1983,19 @@ globus_l_xio_system_try_write(
("[globus_l_xio_system_try_write] fd=%d, "
"Changing file position to %" GLOBUS_OFF_T_FORMAT "\n",
handle->fd, offset));
-
+
/* assume success as possible failures are ignorable */
lseek(handle->fd, offset, SEEK_SET);
handle->file_position = offset;
}
-
+
result = globus_i_xio_system_file_try_write(
handle->fd, iov, iovc, nbytes);
-
+
handle->file_position += *nbytes;
}
globus_mutex_unlock(&handle->lock);
-
+
return result;
}
else
@@ -2020,26 +2018,25 @@ globus_l_xio_system_write(
globus_size_t * u_nbytes)
{
globus_result_t result;
- int rc;
GlobusXIOName(globus_l_xio_system_write);
GlobusXIOSystemDebugEnter();
result = globus_l_xio_system_try_write(
handle, offset, u_iov, u_iovc, flags, to, u_nbytes);
-
+
if(result == GLOBUS_SUCCESS && *u_nbytes < waitforbytes)
{
struct iovec * iov;
int iovc;
globus_size_t nbytes = *u_nbytes;
globus_size_t total = nbytes;
-
+
/*
* XXX this is not thread safe... both reads and writes are mucking
* with blocking status
*/
- rc = globus_l_xio_system_remove_nonblocking(handle);
+ globus_l_xio_system_remove_nonblocking(handle);
GlobusIXIOSystemAllocIovec(u_iovc, iov);
if(!iov)
{
@@ -2050,7 +2047,7 @@ globus_l_xio_system_write(
GlobusIXIOUtilTransferIovec(iov, u_iov, u_iovc);
u_iov = iov;
iovc = u_iovc;
-
+
do
{
offset += nbytes;
@@ -2059,18 +2056,18 @@ globus_l_xio_system_write(
handle, offset, iov, iovc, flags, to, &nbytes);
total += nbytes;
} while(result == GLOBUS_SUCCESS && nbytes && total < waitforbytes);
-
+
*u_nbytes = total;
-
+
GlobusIXIOSystemFreeIovec(u_iovc, (globus_xio_iovec_t *) u_iov);
- rc = globus_l_xio_system_add_nonblocking(handle);
+ globus_l_xio_system_add_nonblocking(handle);
}
GlobusXIOSystemDebugExit();
return result;
error_iovec:
- rc = globus_l_xio_system_add_nonblocking(handle);
+ globus_l_xio_system_add_nonblocking(handle);
GlobusXIOSystemDebugExitWithError();
return result;
}
@@ -2112,19 +2109,19 @@ globus_l_xio_system_close(
GlobusXIOName(globus_l_xio_system_close);
GlobusXIOSystemDebugEnterFD(fd);
-
+
do
{
rc = close(fd);
GlobusXIOSystemUpdateErrno();
} while(rc < 0 && errno == EINTR);
-
+
if(rc < 0)
{
result = GlobusXIOErrorSystemError("close", errno);
goto error_close;
}
-
+
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -2139,18 +2136,18 @@ globus_xio_system_file_get_position(
{
globus_off_t offset;
GlobusXIOName(globus_xio_system_file_get_position);
-
+
GlobusXIOSystemDebugEnterFD(fd);
-
+
/* ignore errors, may be a pipe or other unseekable */
offset = lseek(fd, 0, SEEK_CUR);
if(offset == -1)
{
offset = 0;
}
-
+
GlobusXIOSystemDebugExitFD(fd);
-
+
return offset;
}
@@ -2161,16 +2158,16 @@ globus_xio_system_file_get_size(
globus_off_t size = -1;
struct stat buf;
GlobusXIOName(globus_xio_system_file_get_size);
-
+
GlobusXIOSystemDebugEnterFD(fd);
-
+
if(fstat(fd, &buf) == 0)
{
size = buf.st_size;
}
-
+
GlobusXIOSystemDebugExitFD(fd);
-
+
return size;
}
@@ -2190,7 +2187,7 @@ globus_xio_system_convert_stdio(
{
return fileno(stderr);
}
-
+
return GLOBUS_XIO_SYSTEM_INVALID_FILE;
}
@@ -2202,9 +2199,9 @@ globus_xio_system_file_truncate(
globus_result_t result;
int rc;
GlobusXIOName(globus_xio_system_file_truncate);
-
+
GlobusXIOSystemDebugEnterFD(fd);
-
+
#ifdef TARGET_ARCH_ARM
setErrno(EINVAL);
@@ -2217,7 +2214,7 @@ globus_xio_system_file_truncate(
result = GlobusXIOErrorSystemError("ftruncate", errno);
goto error_truncate;
}
-
+
GlobusXIOSystemDebugExitFD(fd);
return GLOBUS_SUCCESS;
@@ -2236,10 +2233,10 @@ globus_xio_system_file_open(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_file_open);
-
+
*fd = -1;
GlobusXIOSystemDebugEnterFD(*fd);
-
+
do
{
*fd = open(filename, flags, mode);
@@ -2251,10 +2248,10 @@ globus_xio_system_file_open(
result = GlobusXIOErrorSystemError("open", errno);
goto error_open;
}
-
+
/* all handles created by me are closed on exec */
fcntl(*fd, F_SETFD, FD_CLOEXEC);
-
+
GlobusXIOSystemDebugPrintf(
GLOBUS_I_XIO_SYSTEM_DEBUG_INFO,
("[%s] Opened file, %s fd=%d\n", _xio_name, filename, *fd));
@@ -2283,10 +2280,10 @@ globus_xio_system_socket_create(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_create);
-
+
*fd = -1;
GlobusXIOSystemDebugEnterFD(*fd);
-
+
*fd = socket(domain, type, protocol);
GlobusXIOSystemUpdateErrno();
if(*fd == -1)
@@ -2294,7 +2291,7 @@ globus_xio_system_socket_create(
result = GlobusXIOErrorSystemError("socket", errno);
goto error_socket;
}
-
+
/* all handles created by me are closed on exec */
fcntl(*fd, F_SETFD, FD_CLOEXEC);
@@ -2316,16 +2313,16 @@ globus_xio_system_socket_setsockopt(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_setsockopt);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
if(setsockopt(socket, level, optname, (void *) optval, optlen) < 0)
{
GlobusXIOSystemUpdateErrno();
result = GlobusXIOErrorSystemError("setsockopt", errno);
goto error_setsockopt;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
@@ -2344,16 +2341,16 @@ globus_xio_system_socket_getsockopt(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_getsockopt);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
if(getsockopt(socket, level, optname, optval, optlen) < 0)
{
GlobusXIOSystemUpdateErrno();
result = GlobusXIOErrorSystemError("getsockopt", errno);
goto error_getsockopt;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
@@ -2370,16 +2367,16 @@ globus_xio_system_socket_getsockname(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_getsockname);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
if(getsockname(socket, name, namelen) < 0)
{
GlobusXIOSystemUpdateErrno();
result = GlobusXIOErrorSystemError("getsockname", errno);
goto error_getsockname;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
@@ -2396,16 +2393,16 @@ globus_xio_system_socket_getpeername(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_getpeername);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
if(getpeername(socket, name, namelen) < 0)
{
GlobusXIOSystemUpdateErrno();
result = GlobusXIOErrorSystemError("getpeername", errno);
goto error_getpeername;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
@@ -2422,16 +2419,16 @@ globus_xio_system_socket_bind(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_bind);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
if(bind(socket, addr, addrlen) < 0)
{
GlobusXIOSystemUpdateErrno();
result = GlobusXIOErrorSystemError("bind", errno);
goto error_bind;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
@@ -2447,16 +2444,16 @@ globus_xio_system_socket_listen(
{
globus_result_t result;
GlobusXIOName(globus_xio_system_socket_listen);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
if(listen(socket, backlog) < 0)
{
GlobusXIOSystemUpdateErrno();
result = GlobusXIOErrorSystemError("listen", errno);
goto error_listen;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
@@ -2474,21 +2471,21 @@ globus_xio_system_socket_connect(
globus_result_t result;
int rc;
GlobusXIOName(globus_xio_system_socket_connect);
-
+
GlobusXIOSystemDebugEnterFD(socket);
-
+
do
{
rc = connect(socket, addr, addrlen);
GlobusXIOSystemUpdateErrno();
} while(rc < 0 && errno == EINTR);
-
+
if(rc < 0)
{
result = GlobusXIOErrorSystemError("connect", errno);
goto error_connect;
}
-
+
GlobusXIOSystemDebugExitFD(socket);
return GLOBUS_SUCCESS;
diff --git a/xio/src/test/drivers/globus_xio_smtp.c b/xio/src/test/drivers/globus_xio_smtp.c
index 08569c0562..72851c858d 100644
--- a/xio/src/test/drivers/globus_xio_smtp.c
+++ b/xio/src/test/drivers/globus_xio_smtp.c
@@ -123,7 +123,7 @@ globus_l_xio_smtp_attr_cntl(
if(cmd == 1)
{
to_addr = (char *) va_arg(ap, char *);
- sprintf(info->to_address, "%s", to_addr);
+ sprintf(info->to_address, "%s", to_addr);
}
return GLOBUS_SUCCESS;
@@ -224,7 +224,7 @@ globus_l_xio_smtp_read_header_cb(
{
/* if we have not recieved the entire message repost */
info->read_offset += nbytes;
- if(info->read_offset < 2 ||
+ if(info->read_offset < 2 ||
info->message[info->read_offset - 2] != '\r' ||
info->message[info->read_offset - 1] != '\n')
{
@@ -274,7 +274,6 @@ globus_l_xio_smtp_write_header_cb(
globus_size_t nbytes,
void * user_arg)
{
- globus_result_t res;
l_smtp_info_t * info;
info = (l_smtp_info_t *) user_arg;
@@ -291,7 +290,7 @@ globus_l_xio_smtp_write_header_cb(
*/
else
{
- res = globus_xio_driver_pass_read(op, &info->iovec, 1,
+ globus_xio_driver_pass_read(op, &info->iovec, 1,
1, globus_l_xio_smtp_read_header_cb, (void *) info);
}
}
@@ -318,7 +317,7 @@ globus_l_xio_smtp_open_cb(
{
next_state(info, op);
}
-}
+}
static
globus_result_t
@@ -352,9 +351,9 @@ globus_l_xio_smtp_close_cb(
globus_xio_operation_t op,
globus_result_t result,
void * user_arg)
-{
+{
globus_xio_driver_finished_close(op, result);
-}
+}
void
globus_l_xio_smtp_write_close_cb(
@@ -363,9 +362,7 @@ globus_l_xio_smtp_write_close_cb(
globus_size_t nbytes,
void * user_arg)
{
- globus_result_t res;
-
- res = globus_xio_driver_pass_close(
+ globus_xio_driver_pass_close(
op, globus_l_xio_smtp_close_cb, user_arg);
}
@@ -515,7 +512,7 @@ globus_l_xio_smtp_activate(void)
globus_l_return_address = globus_common_create_string("%s@%s",
username, globus_l_hostname);
-
+
if(rc == GLOBUS_SUCCESS)
{
GlobusXIORegisterDriver(smtp);
diff --git a/xio/src/test/globus_utp_main.c b/xio/src/test/globus_utp_main.c
index 698e4b318d..43f59d4671 100644
--- a/xio/src/test/globus_utp_main.c
+++ b/xio/src/test/globus_utp_main.c
@@ -45,7 +45,7 @@ Public functions for the Unnamed Timing Package (UTP).
#include "globus_utp_private.h"
/******************************************************************************
- Module activation structure
+ Module activation structure
******************************************************************************/
static int
globus_l_utp_activate(void);
@@ -54,7 +54,7 @@ static int
globus_l_utp_deactivate(void);
-globus_module_descriptor_t globus_i_utp_module =
+globus_module_descriptor_t globus_i_utp_module =
{
"globus_utp",
globus_l_utp_activate,
@@ -64,7 +64,7 @@ globus_module_descriptor_t globus_i_utp_module =
/******************************************************************************
- globus_utp module activation functions
+ globus_utp module activation functions
******************************************************************************/
static int
@@ -72,14 +72,14 @@ globus_l_utp_activate(void)
{
if (globus_module_activate(GLOBUS_COMMON_MODULE) != GLOBUS_SUCCESS)
{
- return GLOBUS_FAILURE;
+ return GLOBUS_FAILURE;
}
/* Initialize some global variables */
globus_utp_attributes = GLOBUS_NULL;
globus_utp_numTimers = 0;
globus_utp_timers = GLOBUS_NULL;
-
+
return GLOBUS_SUCCESS;
}
@@ -93,7 +93,7 @@ globus_l_utp_deactivate(void)
globus_utp_Attribute_t *tmpAttr;
rc = GLOBUS_SUCCESS;
-
+
/*
* Free up any storage
*/
@@ -101,18 +101,18 @@ globus_l_utp_deactivate(void)
while (curAttr)
{
- tmpAttr = curAttr;
- curAttr = curAttr->next;
- globus_free(tmpAttr);
+ tmpAttr = curAttr;
+ curAttr = curAttr->next;
+ globus_free(tmpAttr);
}
globus_utp_attributes = GLOBUS_NULL;
for (i = 0; i < globus_utp_numTimers; i++)
{
- if (globus_utp_timers[i].name)
- {
- globus_free(globus_utp_timers[i].name);
- }
+ if (globus_utp_timers[i].name)
+ {
+ globus_free(globus_utp_timers[i].name);
+ }
}
globus_free(globus_utp_timers);
globus_utp_numTimers = 0;
@@ -123,11 +123,11 @@ globus_l_utp_deactivate(void)
*/
if (globus_module_deactivate(GLOBUS_COMMON_MODULE) != GLOBUS_SUCCESS)
{
- rc = GLOBUS_FAILURE;
+ rc = GLOBUS_FAILURE;
}
return rc;
-
+
}
@@ -137,53 +137,53 @@ Public UTP functions.
int globus_utp_init(unsigned numTimers, int mode)
{
- unsigned i;
- int sharingMode = mode & GLOBUS_UTP_MODE_SHARING_FIELD;
- char hostnameBuff[MAXHOSTNAMELEN];
- time_t theTime;
+ unsigned i;
+ int sharingMode = mode & GLOBUS_UTP_MODE_SHARING_FIELD;
+ char hostnameBuff[MAXHOSTNAMELEN];
+ time_t theTime;
const char *username;
- char theTimeStr[27];
-
- if (sharingMode == GLOBUS_UTP_MODE_PRIVATE)
- {
- globus_utp_warn("globus_utp_init: mode GLOBUS_UTP_MODE_PRIVATE not yet "
- "implemented");
- return 1;
- } else if (sharingMode != GLOBUS_UTP_MODE_SHARED)
- {
- globus_utp_warn("globus_utp_init: invalid sharing mode %#X specified",
- sharingMode);
- return 1;
- }
-
- if (!(globus_utp_timers = globus_malloc(numTimers * sizeof(globus_utp_Timer_t))))
- {
- globus_utp_warn("globus_utp_init: globus_malloc() failed for timers");
- globus_utp_numTimers = 0;
- return 1;
- }
-
- globus_utp_numTimers = numTimers;
-
- /* This loop not only initializes every
- field; by "touching" everything, it also
- makes sure it is paged in. */
- for (i = 0; i < numTimers; i++) {
- globus_utp_timers[i].state = GLOBUS_UTP_TIMER_STOPPED;
- globus_utp_timeZero(&globus_utp_timers[i].startTime);
- globus_utp_timeZero(&globus_utp_timers[i].accumulatedTime);
- globus_utp_timers[i].numEvents = 0;
- /* If name is still NULL when
- globus_utp_write_file() is called,
- globus_utp_DEFAULT_TIMER_NAME is printed. */
- globus_utp_timers[i].name = NULL;
- }
-
- /* Make key/value linked list empty. */
- globus_utp_attributes = NULL;
-
- /* Set attributes for "user", "hostname",
- and "timestamp". */
+ char theTimeStr[27];
+
+ if (sharingMode == GLOBUS_UTP_MODE_PRIVATE)
+ {
+ globus_utp_warn("globus_utp_init: mode GLOBUS_UTP_MODE_PRIVATE not yet "
+ "implemented");
+ return 1;
+ } else if (sharingMode != GLOBUS_UTP_MODE_SHARED)
+ {
+ globus_utp_warn("globus_utp_init: invalid sharing mode %#X specified",
+ sharingMode);
+ return 1;
+ }
+
+ if (!(globus_utp_timers = globus_malloc(numTimers * sizeof(globus_utp_Timer_t))))
+ {
+ globus_utp_warn("globus_utp_init: globus_malloc() failed for timers");
+ globus_utp_numTimers = 0;
+ return 1;
+ }
+
+ globus_utp_numTimers = numTimers;
+
+ /* This loop not only initializes every
+ field; by "touching" everything, it also
+ makes sure it is paged in. */
+ for (i = 0; i < numTimers; i++) {
+ globus_utp_timers[i].state = GLOBUS_UTP_TIMER_STOPPED;
+ globus_utp_timeZero(&globus_utp_timers[i].startTime);
+ globus_utp_timeZero(&globus_utp_timers[i].accumulatedTime);
+ globus_utp_timers[i].numEvents = 0;
+ /* If name is still NULL when
+ globus_utp_write_file() is called,
+ globus_utp_DEFAULT_TIMER_NAME is printed. */
+ globus_utp_timers[i].name = NULL;
+ }
+
+ /* Make key/value linked list empty. */
+ globus_utp_attributes = NULL;
+
+ /* Set attributes for "user", "hostname",
+ and "timestamp". */
# ifdef _WIN32
{
@@ -198,31 +198,31 @@ int globus_utp_init(unsigned numTimers, int mode)
struct passwd *passwdEntry;
passwdEntry = getpwuid(getuid());
if (!passwdEntry) {
- return 1;
+ return 1;
}
username = passwdEntry->pw_name;
}
- globus_utp_set_attribute("%s", "user", username);
+ globus_utp_set_attribute("%s", "user", username);
#endif
- if (globus_libc_gethostname(hostnameBuff, MAXHOSTNAMELEN)) {
- /* globus_utp_warn("globus_utp_init: gethostname() failed; system error is "
- "\"%s\"", sys_errlist[errno]); */
- return 1;
- }
- globus_utp_set_attribute("%s", "hostname", hostnameBuff);
-
- if ((theTime = time(NULL)) == (time_t) -1) {
- /* globus_utp_warn("globus_utp_init: time(3) failed; system error is "
- "\"%s\"", sys_errlist[errno]); */
- return 1;
- }
- strcpy(theTimeStr, ctime(&theTime));
- /* Remove trailing '\n'. */
- theTimeStr[strlen(theTimeStr) - 1] = 0;
- globus_utp_set_attribute("%s", "timestamp", theTimeStr);
-
- return 0;
+ if (globus_libc_gethostname(hostnameBuff, MAXHOSTNAMELEN)) {
+ /* globus_utp_warn("globus_utp_init: gethostname() failed; system error is "
+ "\"%s\"", sys_errlist[errno]); */
+ return 1;
+ }
+ globus_utp_set_attribute("%s", "hostname", hostnameBuff);
+
+ if ((theTime = time(NULL)) == (time_t) -1) {
+ /* globus_utp_warn("globus_utp_init: time(3) failed; system error is "
+ "\"%s\"", sys_errlist[errno]); */
+ return 1;
+ }
+ strcpy(theTimeStr, ctime(&theTime));
+ /* Remove trailing '\n'. */
+ theTimeStr[strlen(theTimeStr) - 1] = 0;
+ globus_utp_set_attribute("%s", "timestamp", theTimeStr);
+
+ return 0;
}
void
@@ -235,306 +235,306 @@ globus_utp_write_file(const char *outFilename)
if (!(outFile = fopen(outFilename, "w")))
{
- /* globus_utp_warn("globus_utp_write_file: fopen() on file \"%s\" failed",
- outFilename);
- globus_utp_warn("globus_utp_write_file: system error message is \"%s\"",
- sys_errlist[errno]); */
- return;
+ /* globus_utp_warn("globus_utp_write_file: fopen() on file \"%s\" failed",
+ outFilename);
+ globus_utp_warn("globus_utp_write_file: system error message is \"%s\"",
+ sys_errlist[errno]); */
+ return;
}
curAttr = globus_utp_attributes;
while (curAttr)
{
- globus_utp_Attribute_t *tmp = curAttr;
- fprintf(outFile, "attribute\t\"%s\"\t\"%s\"\n",
- curAttr->key, curAttr->value);
- curAttr = curAttr->next;
- globus_free(tmp->key);
- globus_free(tmp->value);
- globus_free(tmp);
+ globus_utp_Attribute_t *tmp = curAttr;
+ fprintf(outFile, "attribute\t\"%s\"\t\"%s\"\n",
+ curAttr->key, curAttr->value);
+ curAttr = curAttr->next;
+ globus_free(tmp->key);
+ globus_free(tmp->value);
+ globus_free(tmp);
}
globus_utp_attributes = NULL;
for (i = 0; i < globus_utp_numTimers; i++)
{
- const char *name = globus_utp_timers[i].name;
-
- if (globus_utp_timers[i].state == GLOBUS_UTP_TIMER_RUNNING)
- {
- globus_utp_warn("globus_utp_write_file: timer %d still running",
- i);
- globus_utp_stop_timer(i);
- }
-
- globus_utp_timeToString(buff,
- &globus_utp_timers[i].accumulatedTime);
-
- fprintf(outFile, "timer\t%u\t%s\t%lu\t\"%s\"\n",
- (unsigned) i,
- buff,
- globus_utp_timers[i].numEvents,
- name ? name : GLOBUS_UTP_DEFAULT_TIMER_NAME);
+ const char *name = globus_utp_timers[i].name;
+
+ if (globus_utp_timers[i].state == GLOBUS_UTP_TIMER_RUNNING)
+ {
+ globus_utp_warn("globus_utp_write_file: timer %d still running",
+ i);
+ globus_utp_stop_timer(i);
+ }
+
+ globus_utp_timeToString(buff,
+ &globus_utp_timers[i].accumulatedTime);
+
+ fprintf(outFile, "timer\t%u\t%s\t%lu\t\"%s\"\n",
+ (unsigned) i,
+ buff,
+ globus_utp_timers[i].numEvents,
+ name ? name : GLOBUS_UTP_DEFAULT_TIMER_NAME);
}
if (fclose(outFile))
{
- /* globus_utp_warn("globus_utp_write_file: fclose() on file \"%s\" failed",
- outFilename);
- globus_utp_warn("globus_utp_write_file: system error message is \"%s\"",
- sys_errlist[errno]); */
- return;
+ /* globus_utp_warn("globus_utp_write_file: fclose() on file \"%s\" failed",
+ outFilename);
+ globus_utp_warn("globus_utp_write_file: system error message is \"%s\"",
+ sys_errlist[errno]); */
+ return;
}
}
void
globus_utp_set_attribute(const char *keyStr, const char *keyArg,
- const char *valueStr, ...)
+ const char *valueStr, ...)
{
- globus_utp_Attribute_t *newAttr; /* New key/value pair. */
- globus_utp_Attribute_t **lastNext; /* Final "next" pointer in list. */
- char *newKey = globus_malloc(sizeof(char) * GLOBUS_UTP_MAX_NAME_LENGTH);
- char *newValue = globus_malloc(sizeof(char) * GLOBUS_UTP_MAX_NAME_LENGTH);
- va_list ap;
-
- if (!newKey || !newValue) {
- globus_utp_warn("globus_utp_set_attribute: globus_malloc() failed");
- return;
- }
- sprintf(newKey, keyStr, keyArg); /* Compute new key. */
- va_start(ap, valueStr); /* Compute new value. */
- vsprintf(newValue, valueStr, ap);
-
- newAttr = globus_utp_attributes;
- lastNext = &globus_utp_attributes;
- /* Search for same key in list. */
- while (newAttr && strcmp(newAttr->key, newKey) != 0) {
- lastNext = &newAttr->next;
- newAttr = newAttr->next;
- }
-
- if (newAttr) { /* Key already exists in list. */
- /* Just replace the old value. */
- strcpy(newAttr->value, newValue);
- globus_free(newKey);
- globus_free(newValue);
- return;
- }
-
- /* Add new key/value pair to list. */
- *lastNext = newAttr = globus_malloc(sizeof(globus_utp_Attribute_t));
- if (!newAttr) {
- globus_utp_warn("globus_utp_set_attribute: globus_malloc() failed");
- return;
- }
- newAttr->key = newKey;
- newAttr->value = newValue;
- newAttr->next = NULL;
+ globus_utp_Attribute_t *newAttr; /* New key/value pair. */
+ globus_utp_Attribute_t **lastNext; /* Final "next" pointer in list. */
+ char *newKey = globus_malloc(sizeof(char) * GLOBUS_UTP_MAX_NAME_LENGTH);
+ char *newValue = globus_malloc(sizeof(char) * GLOBUS_UTP_MAX_NAME_LENGTH);
+ va_list ap;
+
+ if (!newKey || !newValue) {
+ globus_utp_warn("globus_utp_set_attribute: globus_malloc() failed");
+ return;
+ }
+ sprintf(newKey, keyStr, keyArg); /* Compute new key. */
+ va_start(ap, valueStr); /* Compute new value. */
+ vsprintf(newValue, valueStr, ap);
+
+ newAttr = globus_utp_attributes;
+ lastNext = &globus_utp_attributes;
+ /* Search for same key in list. */
+ while (newAttr && strcmp(newAttr->key, newKey) != 0) {
+ lastNext = &newAttr->next;
+ newAttr = newAttr->next;
+ }
+
+ if (newAttr) { /* Key already exists in list. */
+ /* Just replace the old value. */
+ strcpy(newAttr->value, newValue);
+ globus_free(newKey);
+ globus_free(newValue);
+ return;
+ }
+
+ /* Add new key/value pair to list. */
+ *lastNext = newAttr = globus_malloc(sizeof(globus_utp_Attribute_t));
+ if (!newAttr) {
+ globus_utp_warn("globus_utp_set_attribute: globus_malloc() failed");
+ return;
+ }
+ newAttr->key = newKey;
+ newAttr->value = newValue;
+ newAttr->next = NULL;
}
/**********************************************************************
-Timer state transition diagram. If timer is in "Current State", and
+Timer state transition diagram. If timer is in "Current State", and
"State Change Function" is called, result is either the indicated new state
or "Invalid" (in which case globus_utp_warn() is called).
- State Change Function
+ State Change Function
Current
-State start() stop() reset() disable() enable()
-------- ------- ------ ------- --------- ---------
-STOPPED RUNNING Invalid STOPPED DISABLED STOPPED
+State start() stop() reset() disable() enable()
+------- ------- ------ ------- --------- ---------
+STOPPED RUNNING Invalid STOPPED DISABLED STOPPED
-RUNNING Invalid STOPPED STOPPED Invalid RUNNING
+RUNNING Invalid STOPPED STOPPED Invalid RUNNING
-DISABLED DISABLED DISABLED DISABLED DISABLED STOPPED
+DISABLED DISABLED DISABLED DISABLED DISABLED STOPPED
**********************************************************************/
void globus_utp_start_timer(unsigned timerNumber)
{
- globus_utp_Timer_t *theTimer;
+ globus_utp_Timer_t *theTimer;
- /* Don't compile run-time checks into fully-optimized
- version of the library. */
+ /* Don't compile run-time checks into fully-optimized
+ version of the library. */
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_start_timer: illegal timer %d",
- (int) timerNumber);
- return;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_start_timer: illegal timer %d",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer = &globus_utp_timers[timerNumber];
- if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
- return;
+ theTimer = &globus_utp_timers[timerNumber];
+ if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
+ return;
#ifndef NDEBUG
- if (theTimer->state == GLOBUS_UTP_TIMER_RUNNING) {
- globus_utp_warn("globus_utp_start_timer: timer %d already running",
- (int) timerNumber);
- return;
- }
+ if (theTimer->state == GLOBUS_UTP_TIMER_RUNNING) {
+ globus_utp_warn("globus_utp_start_timer: timer %d already running",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer->state = GLOBUS_UTP_TIMER_RUNNING;
- globus_utp_readTime(&theTimer->startTime);
+ theTimer->state = GLOBUS_UTP_TIMER_RUNNING;
+ globus_utp_readTime(&theTimer->startTime);
}
void globus_utp_stop_timer(unsigned timerNumber)
{
- globus_utp_Timer_t *theTimer;
- globus_utp_TimeValue_t stopTime, elapsedTime;
+ globus_utp_Timer_t *theTimer;
+ globus_utp_TimeValue_t stopTime, elapsedTime;
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_stop_timer: illegal timer %d",
- (int) timerNumber);
- return;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_stop_timer: illegal timer %d",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer = &globus_utp_timers[timerNumber];
- if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
- return;
+ theTimer = &globus_utp_timers[timerNumber];
+ if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
+ return;
#ifndef NDEBUG
- if (theTimer->state == GLOBUS_UTP_TIMER_STOPPED) {
- globus_utp_warn("globus_utp_stop_timer: timer %d not running",
- (int) timerNumber);
- return;
- }
+ if (theTimer->state == GLOBUS_UTP_TIMER_STOPPED) {
+ globus_utp_warn("globus_utp_stop_timer: timer %d not running",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer->state = GLOBUS_UTP_TIMER_STOPPED;
- globus_utp_readTime(&stopTime);
- globus_utp_timeDifference(&elapsedTime, &theTimer->startTime, &stopTime);
- globus_utp_timeAdd(&theTimer->accumulatedTime, &elapsedTime);
- theTimer->numEvents++;
+ theTimer->state = GLOBUS_UTP_TIMER_STOPPED;
+ globus_utp_readTime(&stopTime);
+ globus_utp_timeDifference(&elapsedTime, &theTimer->startTime, &stopTime);
+ globus_utp_timeAdd(&theTimer->accumulatedTime, &elapsedTime);
+ theTimer->numEvents++;
}
void globus_utp_reset_timer(unsigned timerNumber)
{
- globus_utp_Timer_t *theTimer;
+ globus_utp_Timer_t *theTimer;
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_reset_timer: illegal timer %d",
- (int) timerNumber);
- return;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_reset_timer: illegal timer %d",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer = &globus_utp_timers[timerNumber];
- if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
- return;
+ theTimer = &globus_utp_timers[timerNumber];
+ if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
+ return;
- theTimer->state = GLOBUS_UTP_TIMER_STOPPED;
- globus_utp_timeZero(&theTimer->startTime);
- globus_utp_timeZero(&theTimer->accumulatedTime);
- theTimer->numEvents = 0;
+ theTimer->state = GLOBUS_UTP_TIMER_STOPPED;
+ globus_utp_timeZero(&theTimer->startTime);
+ globus_utp_timeZero(&theTimer->accumulatedTime);
+ theTimer->numEvents = 0;
}
void globus_utp_disable_timer(unsigned timerNumber)
{
- globus_utp_Timer_t *theTimer;
+ globus_utp_Timer_t *theTimer;
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_disable_timer: illegal timer %d",
- (int) timerNumber);
- return;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_disable_timer: illegal timer %d",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer = &globus_utp_timers[timerNumber];
+ theTimer = &globus_utp_timers[timerNumber];
#ifndef NDEBUG
- if (theTimer->state == GLOBUS_UTP_TIMER_RUNNING) {
- globus_utp_warn("globus_utp_disable_timer: timer %d is running",
- (int) timerNumber);
- return;
- }
+ if (theTimer->state == GLOBUS_UTP_TIMER_RUNNING) {
+ globus_utp_warn("globus_utp_disable_timer: timer %d is running",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer->state = GLOBUS_UTP_TIMER_DISABLED;
+ theTimer->state = GLOBUS_UTP_TIMER_DISABLED;
}
void globus_utp_enable_timer(unsigned timerNumber)
{
- globus_utp_Timer_t *theTimer;
+ globus_utp_Timer_t *theTimer;
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_disable_timer: illegal timer %d",
- (int) timerNumber);
- return;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_disable_timer: illegal timer %d",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer = &globus_utp_timers[timerNumber];
+ theTimer = &globus_utp_timers[timerNumber];
- /* If STOPPED or RUNNING, already enabled.
- Otherwise, can only get to DISABLED from
- STOPPED, so go there. */
- if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
- theTimer->state = GLOBUS_UTP_TIMER_STOPPED;
+ /* If STOPPED or RUNNING, already enabled.
+ Otherwise, can only get to DISABLED from
+ STOPPED, so go there. */
+ if (theTimer->state == GLOBUS_UTP_TIMER_DISABLED)
+ theTimer->state = GLOBUS_UTP_TIMER_STOPPED;
}
void globus_utp_disable_all_timers(void)
{
- unsigned i;
+ unsigned i;
- for (i = 0; i < globus_utp_numTimers; i++)
- globus_utp_disable_timer(i);
+ for (i = 0; i < globus_utp_numTimers; i++)
+ globus_utp_disable_timer(i);
}
void globus_utp_enable_all_timers(void)
{
- unsigned i;
+ unsigned i;
- for (i = 0; i < globus_utp_numTimers; i++)
- globus_utp_enable_timer(i);
+ for (i = 0; i < globus_utp_numTimers; i++)
+ globus_utp_enable_timer(i);
}
const char *
globus_utp_name_timer(unsigned timerNumber, const char *nameStr, ...)
{
- char *name;
- va_list ap;
+ char *name;
+ va_list ap;
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_name_timer: illegal timer %d",
- (int) timerNumber);
- return NULL;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_name_timer: illegal timer %d",
+ (int) timerNumber);
+ return NULL;
+ }
#endif /* #ifndef NDEBUG */
- if (!(name = globus_malloc(sizeof(char) * GLOBUS_UTP_MAX_NAME_LENGTH))) {
- globus_utp_warn("globus_utp_name_timer: globus_malloc() failed");
- return NULL;
- }
+ if (!(name = globus_malloc(sizeof(char) * GLOBUS_UTP_MAX_NAME_LENGTH))) {
+ globus_utp_warn("globus_utp_name_timer: globus_malloc() failed");
+ return NULL;
+ }
- va_start(ap, nameStr);
- vsprintf(name, nameStr, ap);
- globus_utp_timers[timerNumber].name = name;
+ va_start(ap, nameStr);
+ vsprintf(name, nameStr, ap);
+ globus_utp_timers[timerNumber].name = name;
- return name;
+ return name;
}
void
globus_utp_get_accum_time(unsigned timerNumber, double *time, int *precision)
{
- globus_utp_Timer_t *theTimer;
+ globus_utp_Timer_t *theTimer;
#ifndef NDEBUG
- if (timerNumber >= globus_utp_numTimers) {
- globus_utp_warn("globus_utp_get_accum_time: illegal timer %d",
- (int) timerNumber);
- return;
- }
+ if (timerNumber >= globus_utp_numTimers) {
+ globus_utp_warn("globus_utp_get_accum_time: illegal timer %d",
+ (int) timerNumber);
+ return;
+ }
#endif /* #ifndef NDEBUG */
- theTimer = &globus_utp_timers[timerNumber];
+ theTimer = &globus_utp_timers[timerNumber];
- globus_utp_timeToDouble(time, precision, &theTimer->accumulatedTime);
+ globus_utp_timeToDouble(time, precision, &theTimer->accumulatedTime);
}
@@ -542,30 +542,32 @@ globus_utp_get_accum_time(unsigned timerNumber, double *time, int *precision)
Private UTP functions.
**********************************************************************/
- /* Use external assembler routine for RS6000 by
- default, unless RS6000_GETTIMER is defined. */
+ /* Use external assembler routine for RS6000 by
+ default, unless RS6000_GETTIMER is defined. */
#if !defined(RS6000) || (defined(RS6000) && defined(RS6000_GETTIMER))
void
globus_utp_readTime(globus_utp_TimeValue_t *tv)
{
#ifdef UNIX
- int flag;
+#ifdef DEBUG
+ int flag;
- flag = gettimeofday(tv, NULL);
+ flag = gettimeofday(tv, NULL);
-#ifdef DEBUG
- if (flag) {
- globus_utp_warn("globus_utp_readTime: gettimeofday() failed");
- globus_utp_warn("globus_utp_readTime: system error message is \"%s\"",
- sys_errlist[errno]);
- }
+ if (flag) {
+ globus_utp_warn("globus_utp_readTime: gettimeofday() failed");
+ globus_utp_warn("globus_utp_readTime: system error message is \"%s\"",
+ sys_errlist[errno]);
+ }
+#else
+ gettimeofday(tv, NULL);
#endif /* #ifdef DEBUG */
#endif /* #ifdef UNIX */
#ifdef SOLHR
- *tv = gethrtime();
+ *tv = gethrtime();
#endif
#ifdef RS6000
@@ -577,95 +579,97 @@ on p. 59 of the "Optimizing and Tuning Guide for FORTRAN, C, and C++", and
seems to work just fine.
*/
- int flag;
+#ifdef DEBUG
+ int flag;
- flag = gettimer(TIMEOFDAY, tv);
+ flag = gettimer(TIMEOFDAY, tv);
-#ifdef DEBUG
- if (flag) {
- globus_utp_warn("globus_utp_readTime: gettimer() failed");
- globus_utp_warn("globus_utp_readTime: system error message is \"%s\"",
- sys_errlist[errno]);
- }
+ if (flag) {
+ globus_utp_warn("globus_utp_readTime: gettimer() failed");
+ globus_utp_warn("globus_utp_readTime: system error message is \"%s\"",
+ sys_errlist[errno]);
+ }
+#else
+ gettimer(TIMEOFDAY, tv);
#endif /* #ifdef DEBUG */
#endif /* #ifdef RS6000 */
#ifdef PARAGON
- *tv = dclock();
-#endif /* #ifdef PARAGON */
+ *tv = dclock();
+#endif /* #ifdef PARAGON */
}
-#endif /* #if !defined(RS6000) || .... */
+#endif /* #if !defined(RS6000) || .... */
void
globus_utp_timeDifference(globus_utp_TimeValue_t *diff, const globus_utp_TimeValue_t *start,
- const globus_utp_TimeValue_t *end)
+ const globus_utp_TimeValue_t *end)
{
#ifdef UNIX
- diff->tv_sec = end->tv_sec - start->tv_sec;
+ diff->tv_sec = end->tv_sec - start->tv_sec;
- if (end->tv_usec < start->tv_usec) {
- diff->tv_sec--; /* "Borrow" from seconds. */
- diff->tv_usec = 1000000 + end->tv_usec - start->tv_usec;
- } else
- diff->tv_usec = end->tv_usec - start->tv_usec;
+ if (end->tv_usec < start->tv_usec) {
+ diff->tv_sec--; /* "Borrow" from seconds. */
+ diff->tv_usec = 1000000 + end->tv_usec - start->tv_usec;
+ } else
+ diff->tv_usec = end->tv_usec - start->tv_usec;
#endif /* #ifdef UNIX */
#ifdef RS6000
- diff->tv_sec = end->tv_sec - start->tv_sec;
+ diff->tv_sec = end->tv_sec - start->tv_sec;
- if (end->tv_nsec < start->tv_nsec) {
- diff->tv_sec--; /* "Borrow" from seconds. */
- diff->tv_nsec = 1000000000 + end->tv_nsec - start->tv_nsec;
- } else
- diff->tv_nsec = end->tv_nsec - start->tv_nsec;
+ if (end->tv_nsec < start->tv_nsec) {
+ diff->tv_sec--; /* "Borrow" from seconds. */
+ diff->tv_nsec = 1000000000 + end->tv_nsec - start->tv_nsec;
+ } else
+ diff->tv_nsec = end->tv_nsec - start->tv_nsec;
#endif /* #ifdef RS6000 */
#ifdef SOLHR
- *diff = *end - *start;
+ *diff = *end - *start;
#endif
#ifdef PARAGON
- *diff = *end - *start;
-#endif /* #ifdef PARAGON */
+ *diff = *end - *start;
+#endif /* #ifdef PARAGON */
}
void
globus_utp_timeAdd(globus_utp_TimeValue_t *oldElapsed,
- const globus_utp_TimeValue_t *newElapsed)
+ const globus_utp_TimeValue_t *newElapsed)
{
#ifdef UNIX
- oldElapsed->tv_usec += newElapsed->tv_usec;
+ oldElapsed->tv_usec += newElapsed->tv_usec;
- if (oldElapsed->tv_usec >= 1000000) {
- oldElapsed->tv_sec++; /* "Carry" into seconds. */
- oldElapsed->tv_usec -= 1000000;
- }
+ if (oldElapsed->tv_usec >= 1000000) {
+ oldElapsed->tv_sec++; /* "Carry" into seconds. */
+ oldElapsed->tv_usec -= 1000000;
+ }
- oldElapsed->tv_sec += newElapsed->tv_sec;
+ oldElapsed->tv_sec += newElapsed->tv_sec;
#endif /* #ifdef UNIX */
#ifdef RS6000
- oldElapsed->tv_nsec += newElapsed->tv_nsec;
+ oldElapsed->tv_nsec += newElapsed->tv_nsec;
- if (oldElapsed->tv_nsec >= 1000000000) {
- oldElapsed->tv_sec++; /* "Carry" into seconds. */
- oldElapsed->tv_nsec -= 1000000000;
- }
+ if (oldElapsed->tv_nsec >= 1000000000) {
+ oldElapsed->tv_sec++; /* "Carry" into seconds. */
+ oldElapsed->tv_nsec -= 1000000000;
+ }
- oldElapsed->tv_sec += newElapsed->tv_sec;
+ oldElapsed->tv_sec += newElapsed->tv_sec;
#endif /* #ifdef RS6000 */
#ifdef SOLHR
- *oldElapsed += *newElapsed;
+ *oldElapsed += *newElapsed;
#endif
#ifdef PARAGON
- *oldElapsed += *newElapsed;
-#endif /* #ifdef PARAGON */
+ *oldElapsed += *newElapsed;
+#endif /* #ifdef PARAGON */
}
@@ -673,22 +677,22 @@ void
globus_utp_timeZero(globus_utp_TimeValue_t *tv)
{
#ifdef UNIX
- tv->tv_sec = 0;
- tv->tv_usec = 0;
+ tv->tv_sec = 0;
+ tv->tv_usec = 0;
#endif /* #ifdef UNIX */
#ifdef RS6000
- tv->tv_sec = 0;
- tv->tv_nsec = 0;
+ tv->tv_sec = 0;
+ tv->tv_nsec = 0;
#endif /* #ifdef RS6000 */
#ifdef SOLHR
- *tv = 0;
+ *tv = 0;
#endif
#ifdef PARAGON
- *tv = 0.0;
-#endif /* #ifdef PARAGON */
+ *tv = 0.0;
+#endif /* #ifdef PARAGON */
}
@@ -696,37 +700,37 @@ void
globus_utp_timeToDouble(double *time, int *precision, const globus_utp_TimeValue_t *tv)
{
#ifdef UNIX
- *time = (double) tv->tv_sec + ((double) tv->tv_usec) / 1000000.0;
- *precision = 6;
+ *time = (double) tv->tv_sec + ((double) tv->tv_usec) / 1000000.0;
+ *precision = 6;
#endif /* #ifdef UNIX */
#ifdef RS6000
- *time = (double) tv->tv_sec + ((double) tv->tv_nsec) /
- 1000000000.0;
- *precision = 7;
+ *time = (double) tv->tv_sec + ((double) tv->tv_nsec) /
+ 1000000000.0;
+ *precision = 7;
#endif /* #ifdef RS6000 */
#ifdef SOLHR
- *time = ((double)*tv) / 1000000000.0;
- *precision = 6;
+ *time = ((double)*tv) / 1000000000.0;
+ *precision = 6;
#endif
#ifdef PARAGON
- *time = *tv;
- *precision = 7;
-#endif /* #ifdef PARAGON */
+ *time = *tv;
+ *precision = 7;
+#endif /* #ifdef PARAGON */
}
void
globus_utp_timeToString(char timeString[], const globus_utp_TimeValue_t *tv)
{
- double tvAsDouble;
- int precision;
+ double tvAsDouble;
+ int precision;
- globus_utp_timeToDouble(&tvAsDouble, &precision, tv);
+ globus_utp_timeToDouble(&tvAsDouble, &precision, tv);
- sprintf(timeString, "%.*f", precision, tvAsDouble);
+ sprintf(timeString, "%.*f", precision, tvAsDouble);
}
@@ -735,13 +739,13 @@ globus_utp_warn(const char *messageStr, ...)
{
# if defined(DEBUG)
{
- va_list ap;
+ va_list ap;
- va_start(ap, messageStr);
+ va_start(ap, messageStr);
- vfprintf(stderr, messageStr, ap);
- fprintf(stderr, "\n");
- fflush(stderr); /* Just to be safe. */
+ vfprintf(stderr, messageStr, ap);
+ fprintf(stderr, "\n");
+ fflush(stderr); /* Just to be safe. */
}
# endif
}
diff --git a/xio/src/test/http_timeout_test.c b/xio/src/test/http_timeout_test.c
index a1a4ed635f..d5335a7b09 100644
--- a/xio/src/test/http_timeout_test.c
+++ b/xio/src/test/http_timeout_test.c
@@ -108,7 +108,6 @@ main(
{
int rc;
char * contact = NULL;
- globus_result_t result;
globus_l_timeout_info_t client_timeout_info;
globus_l_timeout_info_t server_timeout_info;
globus_reltime_t timeout;
@@ -314,12 +313,12 @@ main(
server_timeout_info.handle = NULL;
server_timeout_info.result = GLOBUS_SUCCESS;
server_timeout_info.contact = NULL;
- result = globus_xio_server_create(
+ globus_xio_server_create(
&server_timeout_info.server,
server_timeout_info.attr,
globus_l_http_stack);
- result = globus_xio_server_get_contact_string(
+ globus_xio_server_get_contact_string(
server_timeout_info.server,
&contact);
@@ -333,19 +332,19 @@ main(
client_timeout_info.result = GLOBUS_SUCCESS;
client_timeout_info.server = NULL;
- result = globus_xio_handle_create(
+ globus_xio_handle_create(
&client_timeout_info.handle,
globus_l_http_stack);
/* oneshot to start server state machine */
- result = globus_callback_register_oneshot(
+ globus_callback_register_oneshot(
NULL,
&globus_i_reltime_zero,
state_machine,
&server_timeout_info);
/* oneshot to start client state machine */
- result = globus_callback_register_oneshot(
+ globus_callback_register_oneshot(
NULL,
&globus_i_reltime_zero,
state_machine,
@@ -534,7 +533,6 @@ state_machine(
void * user_arg)
{
globus_reltime_t delay;
- globus_result_t result;
globus_l_timeout_info_t * info = user_arg;
/* If the timeout is to be caused by this side of the transfer, then check
@@ -568,14 +566,14 @@ state_machine(
{
case GLOBUS_XIO_OPERATION_TYPE_ACCEPT:
globus_assert(info->server);
- result = globus_xio_server_register_accept(
+ globus_xio_server_register_accept(
info->server,
accept_callback,
info);
break;
case GLOBUS_XIO_OPERATION_TYPE_OPEN:
- result = globus_xio_register_open(
+ globus_xio_register_open(
info->handle,
info->contact,
info->attr,
@@ -584,7 +582,7 @@ state_machine(
break;
case GLOBUS_XIO_OPERATION_TYPE_READ:
- result = globus_xio_register_read(
+ globus_xio_register_read(
info->handle,
info->buffer,
sizeof(info->buffer),
@@ -597,7 +595,7 @@ state_machine(
case GLOBUS_XIO_OPERATION_TYPE_WRITE:
strcpy((char *) info->buffer, "ok\n");
- result = globus_xio_register_write(
+ globus_xio_register_write(
info->handle,
info->buffer,
strlen((char *) info->buffer),
@@ -608,7 +606,7 @@ state_machine(
break;
case GLOBUS_XIO_OPERATION_TYPE_CLOSE:
- result = globus_xio_register_close(
+ globus_xio_register_close(
info->handle,
NULL,
open_close_callback,
diff --git a/xio/xioperf/source/configure.ac b/xio/xioperf/source/configure.ac
index 249f5a42f9..b4f9191378 100644
--- a/xio/xioperf/source/configure.ac
+++ b/xio/xioperf/source/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ([2.60])
-AC_INIT([globus_xioperf], [5.1],[https://github.com/gridcf/gct/issues])
+AC_INIT([globus_xioperf], [5.2],[https://github.com/gridcf/gct/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 foreign parallel-tests tar-pax])
diff --git a/xio/xioperf/source/globus_i_xioperf_opts.c b/xio/xioperf/source/globus_i_xioperf_opts.c
index 616e28e701..1fd9eb1ca6 100644
--- a/xio/xioperf/source/globus_i_xioperf_opts.c
+++ b/xio/xioperf/source/globus_i_xioperf_opts.c
@@ -300,9 +300,6 @@ xioperf_l_opts_bandwidth(
int * out_parms_used)
{
GlobusXIOPerfFuncName(xioperf_l_opts_bandwidth);
- globus_i_xioperf_info_t * info;
-
- info = (globus_i_xioperf_info_t *) arg;
*out_parms_used = 0;
return GlobusXIOPerfError(
@@ -539,39 +536,39 @@ globus_options_entry_t globus_i_xioperf_opts_table[] =
"format to report: Kbits, Mbits, Gbits, KBytes, MBytes, GBytes",
1, xioperf_l_opts_format},
{"interval", "i", NULL, "#",
- "seconds between periodic bandwidth reports",
+ "seconds between periodic bandwidth reports",
1, xio_perf_l_opts_interval},
{"quiet", "q", NULL, NULL,
- "only output |