/[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 1351 by aramv, Thu Jan 7 16:38:30 2010 UTC revision 1352 by aramv, Fri Jan 8 17:32:05 2010 UTC
# Line 8  Line 8 
8  static char *_string = NULL;  static char *_string = NULL;
9  int _fd = 0;  int _fd = 0;
10  char *cert_file = NULL;  char *cert_file = NULL;
11    aos_attribute_t* pemstring;
12    aos_context_t*   context;
13    
14  EES_PL_RC plugin_initialize(int argc, char* argv[]){  EES_PL_RC plugin_initialize(int argc, char* argv[]){
15    char *cert_file_name = "/.globus/usercert.pem";    char *cert_file_name = "/.globus/usercert.pem";
16    char *home = "";    char *home = "";
17    struct stat _stat;    struct stat _stat;
   
18    /* get home dir */    /* get home dir */
19    home = getenv("HOME");    home = getenv("HOME");
20    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))))){
# Line 50  EES_PL_RC plugin_initialize(int argc, ch Line 51  EES_PL_RC plugin_initialize(int argc, ch
51      printf("Read %ld bytes from file '%s'\n", (long int) _stat.st_size, cert_file);      printf("Read %ld bytes from file '%s'\n", (long int) _stat.st_size, cert_file);
52  #endif  #endif
53      /*setObligation("my_pemstring", _string);*/      /*setObligation("my_pemstring", _string);*/
54        /*pemstring = createAttribute();*/
55        /*setAttributeId(pemstring, "my_pemstring");*/
56        /*setAttributeValue(pemstring, _string, strlen(_string));*/
57        /*if((context = getNextContext(ANY, NULL)) == NULL){*/
58        /*context = createContext(ANY);*/
59        /*}*/
60        /*addAttribute(context, pemstring);*/
61      return EES_PL_SUCCESS;      return EES_PL_SUCCESS;
62    }    }
63    
# Line 58  EES_PL_RC plugin_initialize(int argc, ch Line 66  EES_PL_RC plugin_initialize(int argc, ch
66    
67  EES_PL_RC plugin_run(){  EES_PL_RC plugin_run(){
68          eef_log(LOG_ERR, "Getting 'pemstring'\n");          eef_log(LOG_ERR, "Getting 'pemstring'\n");
69          eef_log(LOG_ERR, "my_pemstring: %s\n", getObligation("my_pemstring"));    /*context = getNextContext(ANY,NULL);*/
70      /*while(pemstring = getNextAttribute(context)){*/
71      /*if(getAttributeId(pemstring) == "my_pemstring"){*/
72      /*eef_log(LOG_ERR, "my_pemstring: %s\n", getObligation("my_pemstring"));*/
73      /*}*/
74      /*}*/
75    
76          eef_log(LOG_ERR, "Setting 'pemstring' leeg\n");          eef_log(LOG_ERR, "Setting 'pemstring' leeg\n");
77    /*setObligation("my_pemstring", "Leeggehaald\n");*/    /*setObligation("my_pemstring", "Leeggehaald\n");*/
78    /*setObligation("foo", "barbaz");*/    /*setObligation("foo", "barbaz");*/
# Line 66  EES_PL_RC plugin_run(){ Line 80  EES_PL_RC plugin_run(){
80  }  }
81    
82  EES_PL_RC plugin_terminate(){  EES_PL_RC plugin_terminate(){
83    destroyObligation("my_pemstring");    /*destroyObligation("my_pemstring");*/
84    free(cert_file);    free(cert_file);
85    if(_fd > 0){    if(_fd > 0){
86      close(_fd);      close(_fd);

Legend:
Removed from v.1351  
changed lines
  Added in v.1352

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