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

  • Committer: Teddy Hogeborn
  • Date: 2008-08-12 06:46:11 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080812064611-7wfjg391ypmff085
* mandos-keygen: New program to generate new client keys on
                 installation.

* Makefile (all): No longer build documentation.
  (doc): New; build documentation.
  (maintainer-clean): Remove build-local client keydir.
  (run-client): Make build-local keydir with keys.
  (run-server): Do not depend on "all".
  (install, install-server, install-client, uninstall,
  uninstall-server, uninstall-client, purge, purge-server,
  purge-client): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <stddef.h>             /* NULL, size_t, ssize_t */
37
37
#include <sys/types.h>          /* ssize_t */
38
38
#include <stdlib.h>             /* EXIT_SUCCESS, EXIT_FAILURE,
39
 
                                   getopt_long, getenv() */
 
39
                                   getopt_long */
40
40
#include <stdio.h>              /* fprintf(), stderr, getline(),
41
41
                                   stdin, feof(), perror(), fputc(),
42
42
                                   stdout, getopt_long */
184
184
    }
185
185
 
186
186
    if(prefix){
187
 
      fprintf(stderr, "%s ", prefix);
188
 
    }
189
 
    {
190
 
      const char *cryptsource = getenv("cryptsource");
191
 
      const char *crypttarget = getenv("crypttarget");
192
 
      const char *const prompt
193
 
        = "Enter passphrase to unlock the disk";
194
 
      if(cryptsource == NULL){
195
 
        if(crypttarget == NULL){
196
 
          fprintf(stderr, "%s: ", prompt);
197
 
        } else {
198
 
          fprintf(stderr, "%s (%s): ", prompt, crypttarget);
199
 
        }
200
 
      } else {
201
 
        if(crypttarget == NULL){
202
 
          fprintf(stderr, "%s %s: ", prompt, cryptsource);
203
 
        } else {
204
 
          fprintf(stderr, "%s %s (%s): ", prompt, cryptsource,
205
 
                  crypttarget);
206
 
        }
207
 
      }
208
 
    }
 
187
      fprintf(stderr, "%s Password: ", prefix);
 
188
    } else {
 
189
      fprintf(stderr, "Password: ");
 
190
    }      
209
191
    ret = getline(&buffer, &n, stdin);
210
192
    if (ret > 0){
211
193
      fprintf(stdout, "%s", buffer);