/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: 2019-07-29 16:35:53 UTC
  • Revision ID: teddy@recompile.se-20190729163553-1i442i2cbx64c537
Make tests and man page examples match

Make the tests test_manual_page_example[1-5] match exactly what is
written in the manual page, and add comments to manual page as
reminders to keep tests and manual page examples in sync.

* mandos-ctl (Test_commands_from_options.test_manual_page_example_1):
  Remove "--verbose" option, since the manual does not have it as the
  first example, and change assertion to match.
* mandos-ctl.xml (EXAMPLE): Add comments to all examples documenting
  which test function they correspond to.  Also remove unnecessary
  quotes from option arguments in fourth example, and clarify language
  slightly in fifth example.

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
    }