/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugin-runner.c

* initramfs-tools-hook: Whitespace change only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
    switch(key){
383
383
    case 'g':                   /* --global-options */
384
384
      if(arg != NULL){
385
 
        char *plugin_option;
386
 
        while((plugin_option = strsep(&arg, ",")) != NULL){
387
 
          if(plugin_option[0] == '\0'){
 
385
        char *p;
 
386
        while((p = strsep(&arg, ",")) != NULL){
 
387
          if(p[0] == '\0'){
388
388
            continue;
389
389
          }
390
 
          if(not add_argument(getplugin(NULL), plugin_option)){
 
390
          if(not add_argument(getplugin(NULL), p)){
391
391
            perror("add_argument");
392
392
            return ARGP_ERR_UNKNOWN;
393
393
          }
404
404
      break;
405
405
    case 'o':                   /* --options-for */
406
406
      if(arg != NULL){
407
 
        char *plugin_name = strsep(&arg, ":");
408
 
        if(plugin_name[0] == '\0'){
409
 
          break;
410
 
        }
411
 
        char *plugin_option;
412
 
        while((plugin_option = strsep(&arg, ",")) != NULL){
413
 
          if(not add_argument(getplugin(plugin_name), plugin_option)){
 
407
        char *p_name = strsep(&arg, ":");
 
408
        if(p_name[0] == '\0' or arg == NULL){
 
409
          break;
 
410
        }
 
411
        char *opt = strsep(&arg, ":");
 
412
        if(opt[0] == '\0' or opt == NULL){
 
413
          break;
 
414
        }
 
415
        char *p;
 
416
        while((p = strsep(&opt, ",")) != NULL){
 
417
          if(p[0] == '\0'){
 
418
            continue;
 
419
          }
 
420
          if(not add_argument(getplugin(p_name), p)){
414
421
            perror("add_argument");
415
422
            return ARGP_ERR_UNKNOWN;
416
423
          }
929
936
  
930
937
  closedir(dir);
931
938
  dir = NULL;
932
 
  free_plugin(getplugin(NULL));
933
939
  
934
940
  for(plugin *p = plugin_list; p != NULL; p = p->next){
935
941
    if(p->pid != 0){