/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/askpass-fifo.c

  • Committer: Teddy Hogeborn
  • Date: 2010-09-12 02:51:19 UTC
  • Revision ID: teddy@fukt.bsnet.se-20100912025119-7vvpqofpnbxf7i22
Rename all D-Bus properties to conform to D-Bus naming conventions;
all programs changed.

Also rename client setting "approved_delay" to "approval_delay", and
"approved_duration" to "approval_duration"; all programs changed.

* mandos (ClientDBus.NeedApproval): Bug fix: send an UInt64, not a
                                    float.
  (ClientDBus.ApprovedByDefault_dbus_property,
  ClientDBus.ApprovalDelay_dbus_property,
  ClientDBus.ApprovalDuration_dbus_property): Bug fix: send
                                              PropertyChanged signal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
                                   ENOENT, EEXIST, EFAULT, EMFILE,
32
32
                                   ENFILE, ENOMEM, EBADF, EINVAL, EIO,
33
33
                                   EISDIR, EFBIG */
34
 
#include <stdio.h>              /* perror() */
 
34
#include <error.h>              /* error() */
35
35
#include <stdlib.h>             /* EXIT_FAILURE, NULL, size_t, free(),
36
36
                                   realloc(), EXIT_SUCCESS */
37
37
#include <fcntl.h>              /* open(), O_RDONLY */
51
51
  ret = mkfifo(passfifo, S_IRUSR | S_IWUSR);
52
52
  if(ret == -1){
53
53
    int e = errno;
54
 
    perror("mkfifo");
 
54
    error(0, errno, "mkfifo");
55
55
    switch(e){
56
56
    case EACCES:
57
57
    case ENOTDIR:
73
73
  int fifo_fd = open(passfifo, O_RDONLY);
74
74
  if(fifo_fd == -1){
75
75
    int e = errno;
76
 
    perror("open");
 
76
    error(0, errno, "open");
77
77
    switch(e){
78
78
    case EACCES:
79
79
    case ENOENT:
101
101
      if(buf_len + blocksize > buf_allocated){
102
102
        char *tmp = realloc(buf, buf_allocated + blocksize);
103
103
        if(tmp == NULL){
104
 
          perror("realloc");
 
104
          error(0, errno, "realloc");
105
105
          free(buf);
106
106
          return EX_OSERR;
107
107
        }
113
113
        int e = errno;
114
114
        free(buf);
115
115
        errno = e;
116
 
        perror("read");
 
116
        error(0, errno, "read");
117
117
        switch(e){
118
118
        case EBADF:
119
119
        case EFAULT:
141
141
      int e = errno;
142
142
      free(buf);
143
143
      errno = e;
144
 
      perror("write");
 
144
      error(0, errno, "write");
145
145
      switch(e){
146
146
      case EBADF:
147
147
      case EFAULT:
161
161
  ret = close(STDOUT_FILENO);
162
162
  if(ret == -1){
163
163
    int e = errno;
164
 
    perror("close");
 
164
    error(0, errno, "close");
165
165
    switch(e){
166
166
    case EBADF:
167
167
      return EX_OSFILE;