diff -ur globus_gsi_sysconfig-1.20.orig/library/globus_gsi_system_config.c globus_gsi_sysconfig-1.20/library/globus_gsi_system_config.c --- globus_gsi_sysconfig-1.20.orig/library/globus_gsi_system_config.c 2006-08-01 17:28:02.000000000 +0200 +++ globus_gsi_sysconfig-1.20/library/globus_gsi_system_config.c 2006-11-21 23:52:15.000000000 +0100 @@ -15,8 +15,8 @@ * @author Sam Lang, Sam Meder * * $RCSfile: globus_gsi_system_config.c,v $ - * $Revision: 1.73.4.3 $ - * $Date: 2006/08/01 15:28:02 $ + * $Revision: 1.73.4.4 $ + * $Date: 2006/10/03 23:13:32 $ */ #endif @@ -3764,13 +3764,16 @@ char * filename) { globus_result_t result = GLOBUS_SUCCESS; - int fd = -1; + int fd = -1; + mode_t oldmask; struct stat stx, stx2; static char * _function_name_ = "globus_gsi_sysconfig_set_key_permissions_unix"; GLOBUS_I_GSI_SYSCONFIG_DEBUG_ENTER; - if((fd = open(filename, O_RDONLY|O_CREAT|O_NONBLOCK)) < 0) + oldmask = globus_libc_umask(0077); + if((fd = globus_libc_open( + filename, O_RDONLY|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR)) < 0) { result = globus_error_put( globus_error_wrap_errno_error( @@ -3858,6 +3861,7 @@ close(fd); } + globus_libc_umask(oldmask); GLOBUS_I_GSI_SYSCONFIG_DEBUG_EXIT; return result; }