/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/password-prompt.c

* mandos-clients.conf.xml (OPTIONS): Moved up "extended_timeout" to
                                     order options alphabetically.
* clients.conf: Language change in comment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
                                   getenv(), free() */
42
42
#include <dirent.h>             /* scandir(), alphasort() */
43
43
#include <stdio.h>              /* fprintf(), stderr, getline(),
44
 
                                   stdin, feof(), fputc(), vfprintf(), vasprintf()
45
 
                                */
 
44
                                   stdin, feof(), fputc(), vfprintf(),
 
45
                                   vasprintf() */
46
46
#include <errno.h>              /* errno, EBADF, ENOTTY, EINVAL,
47
47
                                   EFAULT, EFBIG, EIO, ENOSPC, EINTR
48
48
                                */
51
51
#include <stdbool.h>            /* bool, false, true */
52
52
#include <inttypes.h>           /* strtoumax() */
53
53
#include <sys/stat.h>           /* struct stat, lstat(), open() */
54
 
#include <string.h>             /* strlen, rindex, memcmp, strerror() */
 
54
#include <string.h>             /* strlen, rindex, memcmp, strerror()
 
55
                                 */
55
56
#include <argp.h>               /* struct argp_option, struct
56
57
                                   argp_state, struct argp,
57
58
                                   argp_parse(), error_t,
72
73
const char plymouth_name[] = "plymouthd";
73
74
 
74
75
/* Function to use when printing errors */
75
 
void error_plus(int status, int errnum, const char *formatstring, ...){
 
76
void error_plus(int status, int errnum, const char *formatstring,
 
77
                ...){
76
78
  va_list ap;
77
79
  char *text;
78
80
  int ret;
80
82
  va_start(ap, formatstring);
81
83
  ret = vasprintf(&text, formatstring, ap);
82
84
  if (ret == -1){
83
 
    fprintf(stderr, "Mandos plugin %s: ", program_invocation_short_name);
 
85
    fprintf(stderr, "Mandos plugin %s: ",
 
86
            program_invocation_short_name);
84
87
    vfprintf(stderr, formatstring, ap);
85
88
    fprintf(stderr, ": ");
86
89
    fprintf(stderr, "%s\n", strerror(errnum));
205
208
    return 1;
206
209
  }
207
210
  
208
 
  struct dirent **direntries;
 
211
  struct dirent **direntries = NULL;
209
212
  int ret;
210
213
  ret = scandir("/proc", &direntries, is_plymouth, alphasort);
211
214
  if (ret == -1){
212
215
    error(1, errno, "scandir");
213
216
  }
 
217
  free(direntries);
214
218
  return ret > 0;
215
219
}
216
220