/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: 2019-02-10 04:20:26 UTC
  • Revision ID: teddy@recompile.se-20190210042026-3ntr3anw5scz07s0
Update copyright year to 2019

* DBUS-API: Update copyright year to 2019.
* debian/copyright: - '' -
* intro.xml: - '' -
* mandos: - '' -
* mandos-clients.conf.xml: - '' -
* mandos-ctl: - '' -
* mandos-ctl.xml: - '' -
* mandos-keygen: - '' -
* mandos-keygen.xml: - '' -
* mandos-monitor: - '' -
* mandos-monitor.xml: - '' -
* mandos.conf.xml: - '' -
* mandos.xml: - '' -
* plugin-runner.xml: - '' -
* plugins.d/askpass-fifo.xml: - '' -
* plugins.d/mandos-client.c: - '' -
* plugins.d/mandos-client.xml: - '' -
* plugins.d/password-prompt.xml: - '' -
* plugins.d/plymouth.xml: - '' -
* plugins.d/splashy.xml: - '' -
* plugins.d/usplash.xml: - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Password-prompt - Read a password from the terminal and print it
4
4
 * 
5
 
 * Copyright © 2008-2019 Teddy Hogeborn
6
 
 * Copyright © 2008-2019 Björn Påhlsson
 
5
 * Copyright © 2008-2018 Teddy Hogeborn
 
6
 * Copyright © 2008-2018 Björn Påhlsson
7
7
 * 
8
8
 * This file is part of Mandos.
9
9
 * 
274
274
        argp_state_help(state, state->out_stream,
275
275
                        (ARGP_HELP_STD_HELP | ARGP_HELP_EXIT_ERR)
276
276
                        & ~(unsigned int)ARGP_HELP_EXIT_OK);
277
 
        __builtin_unreachable();
278
277
      case -3:                  /* --usage */
279
278
        argp_state_help(state, state->out_stream,
280
279
                        ARGP_HELP_USAGE | ARGP_HELP_EXIT_ERR);
281
 
        __builtin_unreachable();
282
280
      case 'V':                 /* --version */
283
281
        fprintf(state->out_stream, "%s\n", argp_program_version);
284
282
        exit(argp_err_exit_status);
508
506
    }
509
507
    if(sret < 0){
510
508
      int e = errno;
511
 
      if(errno != EINTR){
512
 
        if(not feof(stdin)){
513
 
          error_plus(0, errno, "getline");
514
 
          switch(e){
515
 
          case EBADF:
516
 
            status = EX_UNAVAILABLE;
517
 
            break;
518
 
          case EIO:
519
 
          case EINVAL:
520
 
          default:
521
 
            status = EX_IOERR;
522
 
            break;
523
 
          }
524
 
          break;
525
 
        } else {
526
 
          clearerr(stdin);
 
509
      if(errno != EINTR and not feof(stdin)){
 
510
        error_plus(0, errno, "getline");
 
511
        switch(e){
 
512
        case EBADF:
 
513
          status = EX_UNAVAILABLE;
 
514
          break;
 
515
        case EIO:
 
516
        case EINVAL:
 
517
        default:
 
518
          status = EX_IOERR;
 
519
          break;
527
520
        }
 
521
        break;
528
522
      }
529
523
    }
530
524
    /* if(sret == 0), then the only sensible thing to do is to retry