/[pdpsoft]/trunk/grid-mw-security/glexec/util/llrun/llrun.c
ViewVC logotype

Diff of /trunk/grid-mw-security/glexec/util/llrun/llrun.c

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

revision 2429 by msalle, Tue May 3 12:50:52 2011 UTC revision 2430 by msalle, Thu Sep 22 10:24:13 2011 UTC
# Line 46  Line 46 
46    
47  #include <syslog.h>  #include <syslog.h>
48    
49  #define VERSION     "0.1.1"  #define VERSION     "0.1.2"
50    
51  /* Define to have getopt() behave POSIX correctly */  /* Define to have getopt() behave POSIX correctly */
52  #define POSIXLY_CORRECT  #define POSIXLY_CORRECT
# Line 181  void llnotice(char *format, ...)       { Line 181  void llnotice(char *format, ...)       {
181      fprintf(stdout,"[%s]: ", prog);      fprintf(stdout,"[%s]: ", prog);
182      va_start(args,format);      va_start(args,format);
183      vfprintf(stdout,format,args);      vfprintf(stdout,format,args);
184        va_end(args);
185  }  }
186    
187  /* Prints a warning on stderr */  /* Prints a warning on stderr */
# Line 190  void llwarn(char *format, ...) { Line 191  void llwarn(char *format, ...) {
191      fprintf(stderr,"[%s]: WARNING: ", prog);      fprintf(stderr,"[%s]: WARNING: ", prog);
192      va_start(args,format);      va_start(args,format);
193      vfprintf(stderr,format,args);      vfprintf(stderr,format,args);
194        va_end(args);
195  }  }
196    
197  /* Prints an error on stderr */  /* Prints an error on stderr */
# Line 199  void llerr(char *format, ...)  { Line 201  void llerr(char *format, ...)  {
201      fprintf(stderr,"[%s]: ERROR: ", prog);      fprintf(stderr,"[%s]: ERROR: ", prog);
202      va_start(args,format);      va_start(args,format);
203      vfprintf(stderr,format,args);      vfprintf(stderr,format,args);
204        va_end(args);
205  }  }
206    
207  /* Opens the correct syslog facility. Note that the actual opening does not  /* Opens the correct syslog facility. Note that the actual opening does not
# Line 602  int lcmaps_run(lcmaps_t *lcmaps)    { Line 605  int lcmaps_run(lcmaps_t *lcmaps)    {
605      else if (lcmaps->dovoms==1)      else if (lcmaps->dovoms==1)
606          lcmaps->lcmaps_enable_voms_attributes_verification();          lcmaps->lcmaps_enable_voms_attributes_verification();
607            
608      /* Do actual mapping call */      /* Do actual mapping call. NOTE: this also calls lcmaps_term() */
609      switch (lcmaps->mode) {      switch (lcmaps->mode) {
610          case  LCMAPS_RETURN_ACCOUNT_FROM_PEM:          case  LCMAPS_RETURN_ACCOUNT_FROM_PEM:
611              if ( (rc=lcmaps->lcmaps_return_account_from_pem(              if ( (rc=lcmaps->lcmaps_return_account_from_pem(
# Line 628  int lcmaps_run(lcmaps_t *lcmaps)    { Line 631  int lcmaps_run(lcmaps_t *lcmaps)    {
631              }              }
632              break;              break;
633      }      }
     /* terminate lcmaps */  
     if ( (rc=lcmaps->lcmaps_term()) )  {  
         llerr("lcmaps_term() failed.\n");  
         goto lcmapsrun_clean;  
     }  
634      /* LCMAPS finished succesfully */      /* LCMAPS finished succesfully */
635      rc=0;      rc=0;
636      llnotice("LCMAPS succeeded.\n");      llnotice("LCMAPS succeeded.\n");
# Line 904  void parse_options(int argc, char *argv[ Line 902  void parse_options(int argc, char *argv[
902              case 'v':              case 'v':
903                  version();                  version();
904              case 's': /* Do not log to file but to stderr */              case 's': /* Do not log to file but to stderr */
905                    /* Uncomment next lines to use unbuffered output */
906    /*              setvbuf(stdout,(char*)NULL,_IONBF,0);
907                    setvbuf(stderr,(char*)NULL,_IONBF,0);*/
908                  if (lcmaps->logfile && lcmaps->logfile!=stderr)                  if (lcmaps->logfile && lcmaps->logfile!=stderr)
909                      fclose(lcmaps->logfile);                      fclose(lcmaps->logfile);
910                  if (lcas->logfile && lcas->logfile!=stderr)                  if (lcas->logfile && lcas->logfile!=stderr)

Legend:
Removed from v.2429  
changed lines
  Added in v.2430

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