/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugins.d/usplash.c

* plugins.d/mandos-client.c (avahi_loop_with_timeout): Fix warning.
  (main): Disallow "--retry" arguments < 0.  Allow brackets [] around
          IPv6 addresses, as recommended by RFC 5952.  Bug fix: When
          using --connect, really use retry_interval, not 1 second.
* plugins.d/mandos-client.xml (DESCRIPTION): Add retry info.
  (--retry): Remove repeated word.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                                   dirent */
37
37
#include <stddef.h>             /* NULL */
38
38
#include <string.h>             /* strlen(), memcmp(), strerror() */
39
 
#include <stdio.h>              /* asprintf(), vasprintf(), vprintf(), fprintf() */
 
39
#include <stdio.h>              /* asprintf(), vasprintf(), vprintf(),
 
40
                                   fprintf() */
40
41
#include <unistd.h>             /* close(), write(), readlink(),
41
42
                                   read(), STDOUT_FILENO, sleep(),
42
43
                                   fork(), setuid(), geteuid(),
57
58
const char usplash_name[] = "/sbin/usplash";
58
59
 
59
60
/* Function to use when printing errors */
60
 
void error_plus(int status, int errnum, const char *formatstring, ...){
 
61
void error_plus(int status, int errnum, const char *formatstring,
 
62
                ...){
61
63
  va_list ap;
62
64
  char *text;
63
65
  int ret;
65
67
  va_start(ap, formatstring);
66
68
  ret = vasprintf(&text, formatstring, ap);
67
69
  if (ret == -1){
68
 
    fprintf(stderr, "Mandos plugin %s: ", program_invocation_short_name);
 
70
    fprintf(stderr, "Mandos plugin %s: ",
 
71
            program_invocation_short_name);
69
72
    vfprintf(stderr, formatstring, ap);
70
73
    fprintf(stderr, ": ");
71
74
    fprintf(stderr, "%s\n", strerror(errnum));