/mandos/trunk

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

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2018-02-09 21:48:47 UTC
  • Revision ID: teddy@recompile.se-20180209214847-z9gcxqa6827z0ir5
Server bug fix: Correct bad argument list

* (mandos/AvahiServiceToSyslog.rename): Remove "self" from the
  arguments to the method when using super().

Show diffs side-by-side

added added

removed removed

Lines of Context:
313
313
__attribute__((nonnull))
314
314
static void free_plugin(plugin *plugin_node){
315
315
  
316
 
  for(char **arg = (plugin_node->argv)+1; *arg != NULL; arg++){
 
316
  free(plugin_node->name);
 
317
  for(char **arg = plugin_node->argv; *arg != NULL; arg++){
317
318
    free(*arg);
318
319
  }
319
 
  free(plugin_node->name);
320
320
  free(plugin_node->argv);
321
321
  for(char **env = plugin_node->environ; *env != NULL; env++){
322
322
    free(*env);
565
565
    case '?':                   /* --help */
566
566
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
567
567
      argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP);
568
 
      __builtin_unreachable();
569
568
    case -3:                    /* --usage */
570
569
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
571
570
      argp_state_help(state, state->out_stream,
572
571
                      ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
573
 
      __builtin_unreachable();
574
572
    case 'V':                   /* --version */
575
573
      fprintf(state->out_stream, "%s\n", argp_program_version);
576
574
      exit(EXIT_SUCCESS);
586
584
      if(arg[0] == '\0'){
587
585
        break;
588
586
      }
589
 
#if __GNUC__ >= 7
590
 
      __attribute__((fallthrough));
591
 
#else
592
 
          /* FALLTHROUGH */
593
 
#endif
594
587
    default:
595
588
      return ARGP_ERR_UNKNOWN;
596
589
    }
1100
1093
    
1101
1094
    new_plugin->pid = pid;
1102
1095
    new_plugin->fd = pipefd[0];
1103
 
 
1104
 
    if(debug){
1105
 
      fprintf(stderr, "Plugin %s started (PID %" PRIdMAX ")\n",
1106
 
              new_plugin->name, (intmax_t) (new_plugin->pid));
1107
 
    }
1108
 
 
 
1096
    
1109
1097
    /* Unblock SIGCHLD so signal handler can be run if this process
1110
1098
       has already completed */
1111
1099
    ret = (int)TEMP_FAILURE_RETRY(sigprocmask(SIG_UNBLOCK,