47
47
#include <iso646.h> /* or, not */
48
48
#include <stdbool.h> /* bool, false, true */
49
#include <string.h> /* strlen, rindex, strncmp, strcmp */
49
#include <string.h> /* strlen, rindex */
50
50
#include <argp.h> /* struct argp_option, struct
51
51
argp_state, struct argp,
52
52
argp_parse(), error_t,
258
258
fprintf(stderr, "%s ", prefix);
261
const char *cryptsource = getenv("cryptsource");
262
const char *crypttarget = getenv("crypttarget");
263
const char *const prompt
264
= "Enter passphrase to unlock the disk";
261
const char *cryptsource = getenv("CRYPTTAB_SOURCE");
262
const char *crypttarget = getenv("CRYPTTAB_NAME");
263
/* Before cryptsetup 1.1.0~rc2 */
264
if(cryptsource == NULL){
265
cryptsource = getenv("cryptsource");
267
if(crypttarget == NULL){
268
crypttarget = getenv("crypttarget");
270
const char *const prompt1 = "Unlocking the disk";
271
const char *const prompt2 = "Enter passphrase";
265
272
if(cryptsource == NULL){
266
273
if(crypttarget == NULL){
267
fprintf(stderr, "%s: ", prompt);
274
fprintf(stderr, "%s to unlock the disk: ", prompt2);
269
fprintf(stderr, "%s (%s): ", prompt, crypttarget);
276
fprintf(stderr, "%s (%s)\n%s: ", prompt1, crypttarget,
272
280
if(crypttarget == NULL){
273
fprintf(stderr, "%s %s: ", prompt, cryptsource);
281
fprintf(stderr, "%s %s\n%s: ", prompt1, cryptsource,
275
fprintf(stderr, "%s %s (%s): ", prompt, cryptsource,
284
fprintf(stderr, "%s %s (%s)\n%s: ", prompt1, cryptsource,
285
crypttarget, prompt2);