/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

  • Committer: Teddy Hogeborn
  • Date: 2019-03-18 22:29:25 UTC
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190318222925-jvhek84dgcfgj6g3
mandos-ctl: Refactor tests

* mandos-ctl: Where the clients names "foo" and "barbar" do not refer
              to the actual mock clients in the TestCommand class,
              change all occurrences of these names to "client1" and
              "client2" (or just "client" when only one is used) .
              Also change all test doubles to use correct terminology;
              some things called mocks are actually stubs or spies,
              and rename all true mocks to have "mock" in their names.
              Also eliminate duplicate values in tests; derive values
              from previously defined values whenever possible.

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
 
  free(plugin_node->name);
317
316
  for(char **arg = plugin_node->argv; *arg != NULL; arg++){
318
317
    free(*arg);
319
318
  }
565
564
    case '?':                   /* --help */
566
565
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
567
566
      argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP);
 
567
      __builtin_unreachable();
568
568
    case -3:                    /* --usage */
569
569
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
570
570
      argp_state_help(state, state->out_stream,
571
571
                      ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
 
572
      __builtin_unreachable();
572
573
    case 'V':                   /* --version */
573
574
      fprintf(state->out_stream, "%s\n", argp_program_version);
574
575
      exit(EXIT_SUCCESS);
584
585
      if(arg[0] == '\0'){
585
586
        break;
586
587
      }
 
588
      /* FALLTHROUGH */
587
589
    default:
588
590
      return ARGP_ERR_UNKNOWN;
589
591
    }
1093
1095
    
1094
1096
    new_plugin->pid = pid;
1095
1097
    new_plugin->fd = pipefd[0];
1096
 
    
 
1098
 
 
1099
    if(debug){
 
1100
      fprintf(stderr, "Plugin %s started (PID %" PRIdMAX ")\n",
 
1101
              new_plugin->name, (intmax_t) (new_plugin->pid));
 
1102
    }
 
1103
 
1097
1104
    /* Unblock SIGCHLD so signal handler can be run if this process
1098
1105
       has already completed */
1099
1106
    ret = (int)TEMP_FAILURE_RETRY(sigprocmask(SIG_UNBLOCK,