/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/passprompt.c

plugbasedclient
        Parse a single argument as a plus-separated list of options

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  -*- coding: utf-8 -*- */
 
2
/*
 
3
 * Passprompt - Read a password from the terminal and print it
 
4
 *
 
5
 * Copyright © 2007-2008 Teddy Hogeborn & Björn Påhlsson
 
6
 * 
 
7
 * This program is free software: you can redistribute it and/or
 
8
 * modify it under the terms of the GNU General Public License as
 
9
 * published by the Free Software Foundation, either version 3 of the
 
10
 * License, or (at your option) any later version.
 
11
 * 
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 * 
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program.  If not, see
 
19
 * <http://www.gnu.org/licenses/>.
 
20
 * 
 
21
 * Contact the authors at <https://www.fukt.bsnet.se/~belorn/> and
 
22
 * <https://www.fukt.bsnet.se/~teddy/>.
 
23
 */
 
24
 
1
25
#define _GNU_SOURCE             /* getline() */
2
 
#define _FORTIFY_SOURCE 2
 
26
 
3
27
#include <termios.h>            /* struct termios, tcsetattr(),
4
28
                                   TCSAFLUSH, tcgetattr(), ECHO */
5
29
#include <unistd.h>             /* struct termios, tcsetattr(),
25
49
volatile bool quit_now = false;
26
50
bool debug = false;
27
51
 
28
 
void termination_handler(int signum){
 
52
void termination_handler(__attribute__((unused))int signum){
29
53
  quit_now = true;
30
54
}
31
55
 
78
102
  
79
103
  sigemptyset(&new_action.sa_mask);
80
104
  sigaddset(&new_action.sa_mask, SIGINT);
81
 
  sigaddset(&new_action.sa_mask, SIGQUIT);
82
105
  sigaddset(&new_action.sa_mask, SIGHUP);
83
106
  sigaddset(&new_action.sa_mask, SIGTERM);
84
107
  sigaction(SIGINT, NULL, &old_action);
85
108
  if (old_action.sa_handler != SIG_IGN)
86
109
    sigaction(SIGINT, &new_action, NULL);
87
 
  sigaction(SIGQUIT, NULL, &old_action);
88
 
  if (old_action.sa_handler != SIG_IGN)
89
 
    sigaction(SIGQUIT, &new_action, NULL);
90
110
  sigaction(SIGHUP, NULL, &old_action);
91
111
  if (old_action.sa_handler != SIG_IGN)
92
112
    sigaction(SIGHUP, &new_action, NULL);