/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-08-15 21:09:25 UTC
  • mfrom: (24.1.52 mandos)
  • Revision ID: teddy@fukt.bsnet.se-20080815210925-32718zu3nrlotix5
Merge.

* plugin-runner.c (ARGFILE): Renamed to "plugin-runner.conf".

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 * Contact the authors at <mandos@fukt.bsnet.se>.
22
22
 */
23
23
 
24
 
#define _GNU_SOURCE             /* TEMP_FAILURE_RETRY() */
 
24
#define _GNU_SOURCE             /* TEMP_FAILURE_RETRY(), getline() */
25
25
 
26
26
#include <stddef.h>             /* size_t, NULL */
27
27
#include <stdlib.h>             /* malloc(), exit(), EXIT_FAILURE,
65
65
#include <errno.h>              /* errno, EBADF */
66
66
 
67
67
#define BUFFER_SIZE 256
68
 
#define CONFFILE "/conf/conf.d/mandos/client.conf"
 
68
#define ARGFILE "/conf/conf.d/mandos/plugin-runner.conf"
69
69
 
70
 
const char *argp_program_version = "mandos-client 1.0";
 
70
const char *argp_program_version = "plugin-runner 1.0";
71
71
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
72
72
 
73
73
struct process;
209
209
}
210
210
 
211
211
int main(int argc, char *argv[]){
212
 
  const char *plugindir = "/conf/conf.d/mandos/plugins.d";
213
 
  const char *conffile = CONFFILE;
 
212
  const char *plugindir = "/lib/mandos/plugins.d";
 
213
  const char *argfile = ARGFILE;
214
214
  FILE *conffp;
215
215
  size_t d_name_len;
216
216
  DIR *dir = NULL;
344
344
    goto end;
345
345
  }
346
346
 
347
 
  conffp = fopen(conffile, "r");
 
347
  conffp = fopen(argfile, "r");
348
348
  if(conffp != NULL){
349
349
    char *org_line = NULL;
350
350
    size_t size = 0;
376
376
    }
377
377
    free(org_line);
378
378
  } else{
379
 
    /* check for harmfull errors */
 
379
    /* Check for harmful errors and go to fallback. Other errors might
 
380
       not affect opening plugins */
380
381
    if (errno == EMFILE or errno == ENFILE or errno == ENOMEM){
381
382
      perror("fopen");
382
383
      exitstatus = EXIT_FAILURE;