/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 plugins.d/mandos-client.c

  • Committer: teddy at bsnet
  • Date: 2011-12-24 19:43:48 UTC
  • mfrom: (505.1.27 teddy)
  • Revision ID: teddy@fukt.bsnet.se-20111224194348-0buonmve2dnwcnzw
Merge from Teddy

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * "browse_callback", and parts of "main".
10
10
 * 
11
11
 * Everything else is
12
 
 * Copyright © 2008-2012 Teddy Hogeborn
13
 
 * Copyright © 2008-2012 Björn Påhlsson
 
12
 * Copyright © 2008-2011 Teddy Hogeborn
 
13
 * Copyright © 2008-2011 Björn Påhlsson
14
14
 * 
15
15
 * This program is free software: you can redistribute it and/or
16
16
 * modify it under the terms of the GNU General Public License as
170
170
 
171
171
/* Function to use when printing errors */
172
172
void perror_plus(const char *print_text){
173
 
  int e = errno;
174
173
  fprintf(stderr, "Mandos plugin %s: ",
175
174
          program_invocation_short_name);
176
 
  errno = e;
177
175
  perror(print_text);
178
176
}
179
177
 
180
 
__attribute__((format (gnu_printf, 2, 3)))
181
178
int fprintf_plus(FILE *stream, const char *format, ...){
182
179
  va_list ap;
183
180
  va_start (ap, format);
1450
1447
          perror_plus("setenv");
1451
1448
          _exit(EX_OSERR);
1452
1449
        }
1453
 
        ret = setenv("VERBOSITY", debug ? "1" : "0", 1);
 
1450
        ret = setenv("VERBOSE", debug ? "1" : "0", 1);
1454
1451
        if(ret == -1){
1455
1452
          perror_plus("setenv");
1456
1453
          _exit(EX_OSERR);
1473
1470
          _exit(EX_OSERR);
1474
1471
        }
1475
1472
        free(delaystring);
1476
 
        if(connect_to != NULL){
1477
 
          ret = setenv("CONNECT", connect_to, 1);
1478
 
          if(ret == -1){
1479
 
            perror_plus("setenv");
1480
 
            _exit(EX_OSERR);
1481
 
          }
1482
 
        }
1483
 
        if(execl(fullname, direntry->d_name, mode, NULL) == -1){
1484
 
          perror_plus("execl");
1485
 
          _exit(EXIT_FAILURE);
1486
 
        }
 
1473
        ret = execl(fullname, direntry->d_name, mode, NULL);
 
1474
        perror_plus("execl");
1487
1475
      } else {
1488
1476
        int status;
1489
1477
        if(TEMP_FAILURE_RETRY(waitpid(hook_pid, &status, 0)) == -1){
1608
1596
        .group = 2 },
1609
1597
      { .name = "retry", .key = 132,
1610
1598
        .arg = "SECONDS",
1611
 
        .doc = "Retry interval used when denied by the Mandos server",
 
1599
        .doc = "Retry interval used when denied by the mandos server",
1612
1600
        .group = 2 },
1613
1601
      { .name = "network-hook-dir", .key = 133,
1614
1602
        .arg = "DIR",