/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 at recompile
  • Date: 2020-01-12 01:53:04 UTC
  • Revision ID: teddy@recompile.se-20200112015304-gqif9w4pbyix8w6b
mandos-ctl: Fix minor bug in tests

Fix two tests, the last assert of which would always erroneously
succeed.  (No change in non-test code needed.)

* mandos-ctl (Test_dbus_python_adapter_SystemBus): In the
  test_call_method_handles_exception() method, fix check for
  dbus.ConnectFailed exception.
  (Test_pydbus_adapter_SystemBus): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Askpass-FIFO - Read a password from a FIFO and output it
4
4
 * 
5
 
 * Copyright © 2008-2018 Teddy Hogeborn
6
 
 * Copyright © 2008-2018 Björn Påhlsson
 
5
 * Copyright © 2008-2019 Teddy Hogeborn
 
6
 * Copyright © 2008-2019 Björn Påhlsson
7
7
 * 
8
8
 * This file is part of Mandos.
9
9
 * 
65
65
    fprintf(stderr, ": ");
66
66
    fprintf(stderr, "%s\n", strerror(errnum));
67
67
    error(status, errno, "vasprintf while printing error");
 
68
    if(status){
 
69
      __builtin_unreachable();
 
70
    }
68
71
    return;
69
72
  }
70
73
  fprintf(stderr, "Mandos plugin ");
71
74
  error(status, errnum, "%s", text);
 
75
  if(status){
 
76
    __builtin_unreachable();
 
77
  }
72
78
  free(text);
73
79
}
74
80
 
90
96
    case ENOTDIR:
91
97
    case ELOOP:
92
98
      error_plus(EX_OSFILE, errno, "mkfifo");
 
99
      __builtin_unreachable();
93
100
    case ENAMETOOLONG:
94
101
    case ENOSPC:
95
102
    case EROFS:
96
103
    default:
97
104
      error_plus(EX_OSERR, errno, "mkfifo");
 
105
      __builtin_unreachable();
98
106
    case ENOENT:
99
107
      /* no "/lib/cryptsetup"? */
100
108
      error_plus(EX_UNAVAILABLE, errno, "mkfifo");
 
109
      __builtin_unreachable();
101
110
    case EEXIST:
102
111
      break;                    /* not an error */
103
112
    }