65
65
#include <errno.h> /* errno, EBADF */
67
67
#define BUFFER_SIZE 256
68
#define ARGFILE "/conf/conf.d/mandos/plugin-runner.conf"
69
#define PDIR "/lib/mandos/plugins.d"
70
#define AFILE "/conf/conf.d/mandos/plugin-runner.conf"
70
72
const char *argp_program_version = "plugin-runner 1.0";
71
73
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
317
319
{ .name = "plugin-dir", .key = 128,
318
320
.arg = "DIRECTORY",
319
321
.doc = "Specify a different plugin directory", .group = 2 },
320
{ .name = "userid", .key = 129,
321
.arg = "ID", .flags = 0,
322
.doc = "User ID the plugins will run as", .group = 2 },
323
{ .name = "groupid", .key = 130,
324
.arg = "ID", .flags = 0,
325
.doc = "Group ID the plugins will run as", .group = 2 },
326
{ .name = "debug", .key = 131,
327
.doc = "Debug mode", .group = 3 },
322
{ .name = "config-file", .key = 129,
324
.doc = "Specify a different configuration file", .group = 2 },
325
{ .name = "userid", .key = 130,
326
.arg = "ID", .flags = 0,
327
.doc = "User ID the plugins will run as", .group = 3 },
328
{ .name = "groupid", .key = 131,
329
.arg = "ID", .flags = 0,
330
.doc = "Group ID the plugins will run as", .group = 3 },
331
{ .name = "debug", .key = 132,
332
.doc = "Debug mode", .group = 4 },
452
conffp = fopen(argfile, "r");
466
if (argfile == NULL){
467
conffp = fopen(AFILE, "r");
469
conffp = fopen(argfile, "r");
453
472
if(conffp != NULL){
454
473
char *org_line = NULL;
455
474
char *p, *arg, *new_arg, *line;