/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: 2008-09-03 17:34:29 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080903173429-db2mjtddf7mgbx8z
* plugins.d/password-request.xml (OVERVIEW): Refer to
                                             password-prompt(8) by
                                             name.
  (SECURITY): Improved wording.  Add paragraph about insecurity of
              ping.
  (SEE ALSO): Add references to cryptsetup(8) and crypttab(5).
              Changed to be a <variablelist> and added text.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
 
97
97
static plugin *plugin_list = NULL;
98
98
 
99
 
/* Gets an existing plugin based on name,
 
99
/* Gets a existing plugin based on name,
100
100
   or if none is found, creates a new one */
101
101
static plugin *getplugin(char *name){
102
102
  /* Check for exiting plugin with that name */
118
118
      return NULL;
119
119
    }
120
120
  }
121
 
  
 
121
 
122
122
  *new_plugin = (plugin) { .name = copy_name,
123
123
                           .argc = 1,
124
124
                           .disabled = false,
187
187
  size_t namelen = (size_t)(strchrnul(def, '=') - def);
188
188
  /* Search for this environment variable */
189
189
  for(char **e = p->environ; *e != NULL; e++){
190
 
    if(strncmp(*e, def, namelen + 1) == 0){
 
190
    if(strncmp(*e, def, namelen+1) == 0){
191
191
      /* It already exists */
192
192
      if(replace){
193
 
        char *new = realloc(*e, strlen(def) + 1);
 
193
        char *new = realloc(*e, strlen(def));
194
194
        if(new == NULL){
195
195
          return false;
196
196
        }
238
238
      /* No child processes */
239
239
      break;
240
240
    }
241
 
    
 
241
 
242
242
    /* A child exited, find it in process_list */
243
243
    while(proc != NULL and proc->pid != pid){
244
244
      proc = proc->next;
410
410
    case 'o':                   /* --options-for */
411
411
      if (arg != NULL){
412
412
        char *p_name = strsep(&arg, ":");
413
 
        if(p_name[0] == '\0' or arg == NULL){
 
413
        if(p_name[0] == '\0'){
414
414
          break;
415
415
        }
416
416
        char *opt = strsep(&arg, ":");
417
 
        if(opt[0] == '\0' or opt == NULL){
 
417
        if(opt[0] == '\0'){
418
418
          break;
419
419
        }
420
 
        char *p;
421
 
        while((p = strsep(&opt, ",")) != NULL){
422
 
          if(p[0] == '\0'){
423
 
            continue;
424
 
          }
425
 
          if(not add_argument(getplugin(p_name), p)){
426
 
            perror("add_argument");
427
 
            return ARGP_ERR_UNKNOWN;
 
420
        if(opt != NULL){
 
421
          char *p;
 
422
          while((p = strsep(&opt, ",")) != NULL){
 
423
            if(p[0] == '\0'){
 
424
              continue;
 
425
            }
 
426
            if(not add_argument(getplugin(p_name), p)){
 
427
              perror("add_argument");
 
428
              return ARGP_ERR_UNKNOWN;
 
429
            }
428
430
          }
429
431
        }
430
432
      }