/[pdpsoft]/trunk/grid-mw-security/ees/plugin_examples/example_plugin/src/example_plugin.c
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/plugin_examples/example_plugin/src/example_plugin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1266 by aramv, Thu Dec 3 14:10:37 2009 UTC revision 1267 by aramv, Wed Dec 9 16:41:47 2009 UTC
# Line 12  char *cert_file = NULL; Line 12  char *cert_file = NULL;
12  EES_PL_RC plugin_initialize(int argc, char* argv[]){  EES_PL_RC plugin_initialize(int argc, char* argv[]){
13    char *cert_file_name = "/.globus/usercert.pem";    char *cert_file_name = "/.globus/usercert.pem";
14    char *home = "";    char *home = "";
15      struct stat _stat;
16    
17    /* get home dir */    /* get home dir */
18    home = getenv("HOME");    home = getenv("HOME");
19    if(cert_file = calloc(1, (sizeof(char) * (strlen(home) + strlen(cert_file_name) + 1)))){    if((cert_file = calloc(1, (sizeof(char) * (strlen(home) + strlen(cert_file_name) + 1))))){
20      strcat(cert_file, home);      strcat(cert_file, home);
21      strcat(cert_file, cert_file_name);      strcat(cert_file, cert_file_name);
22    } else {    } else {
# Line 22  EES_PL_RC plugin_initialize(int argc, ch Line 24  EES_PL_RC plugin_initialize(int argc, ch
24      return EES_PL_FAILURE;      return EES_PL_FAILURE;
25    }    }
26    
   struct stat _stat;  
27          eef_log(LOG_ERR, "Initializing example plugin!\n");          eef_log(LOG_ERR, "Initializing example plugin!\n");
28    if((_fd = open(cert_file, O_RDONLY)) == -1){    if((_fd = open(cert_file, O_RDONLY)) == -1){
29      eef_log(LOG_ERR, "Cannot open file %s: %s\n", cert_file, strerror(errno));      eef_log(LOG_ERR, "Cannot open file %s: %s\n", cert_file, strerror(errno));

Legend:
Removed from v.1266  
changed lines
  Added in v.1267

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28