/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: 2009-04-17 08:26:17 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090417082617-eltetak5lzjyz55o
* initramfs-tools-hook: Bug fix: Add "--userid" and "--groupid" to
                        start of "plugin-runner.conf" file instead of
                        appending, to allow any preexisting options to
                        override.
* plugin-runner.conf: Improved wording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <sys/select.h>         /* fd_set, select(), FD_ZERO(),
39
39
                                   FD_SET(), FD_ISSET(), FD_CLR */
40
40
#include <sys/wait.h>           /* wait(), waitpid(), WIFEXITED(),
41
 
                                   WEXITSTATUS(), WTERMSIG(),
42
 
                                   WCOREDUMP() */
 
41
                                   WEXITSTATUS() */
43
42
#include <sys/stat.h>           /* struct stat, stat(), S_ISREG() */
44
43
#include <iso646.h>             /* and, or, not */
45
44
#include <dirent.h>             /* DIR, struct dirent, opendir(),
53
52
                                   close() */
54
53
#include <fcntl.h>              /* fcntl(), F_GETFD, F_SETFD,
55
54
                                   FD_CLOEXEC */
56
 
#include <string.h>             /* strsep, strlen(), asprintf(),
57
 
                                   strsignal() */
 
55
#include <string.h>             /* strsep, strlen(), asprintf() */
58
56
#include <errno.h>              /* errno */
59
57
#include <argp.h>               /* struct argp_option, struct
60
58
                                   argp_state, struct argp,
459
457
      plugindir = strdup(arg);
460
458
      if(plugindir == NULL){
461
459
        perror("strdup");
462
 
      }
 
460
      }      
463
461
      break;
464
462
    case 129:                   /* --config-file */
465
463
      /* This is already done by parse_opt_config_file() */
529
527
      if(argfile == NULL){
530
528
        perror("strdup");
531
529
      }
532
 
      break;
 
530
      break;      
533
531
    case 130:                   /* --userid */
534
532
    case 131:                   /* --groupid */
535
533
    case 132:                   /* --debug */
564
562
    conffp = fopen(AFILE, "r");
565
563
  } else {
566
564
    conffp = fopen(argfile, "r");
567
 
  }
 
565
  }  
568
566
  if(conffp != NULL){
569
567
    char *org_line = NULL;
570
568
    char *p, *arg, *new_arg, *line;
614
612
          goto fallback;
615
613
        }
616
614
        custom_argv[custom_argc-1] = new_arg;
617
 
        custom_argv[custom_argc] = NULL;
 
615
        custom_argv[custom_argc] = NULL;        
618
616
      }
619
617
    }
620
618
    free(org_line);
975
973
                      WEXITSTATUS(proc->status));
976
974
            } else if(WIFSIGNALED(proc->status)){
977
975
              fprintf(stderr, "Plugin %s [%" PRIdMAX "] killed by"
978
 
                      " signal %d: %s\n", proc->name,
 
976
                      " signal %d\n", proc->name,
979
977
                      (intmax_t) (proc->pid),
980
 
                      WTERMSIG(proc->status),
981
 
                      strsignal(WTERMSIG(proc->status)));
 
978
                      WTERMSIG(proc->status));
982
979
            } else if(WCOREDUMP(proc->status)){
983
980
              fprintf(stderr, "Plugin %s [%" PRIdMAX "] dumped"
984
981
                      " core\n", proc->name, (intmax_t) (proc->pid));