/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugins.d/passprompt.c

  • Committer: Björn Påhlsson
  • Date: 2008-08-03 20:35:01 UTC
  • mto: (237.7.1 mandos) (24.1.154 mandos)
  • mto: This revision was merged to the branch mainline in revision 41.
  • Revision ID: belorn@braxen-20080803203501-av7janz21ve7iq0b
mandosclient
        Droping privileges
        split gnutls function into global and session

* server.py (if_nametoindex): Redefine itself instead of using a
                              default keyword argument.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Passprompt - Read a password from the terminal and print it
4
4
 *
5
 
 * Copyright © 2007-2008 Teddy Hogeborn and Björn Påhlsson.
 
5
 * Copyright © 2007-2008 Teddy Hogeborn & Björn Påhlsson
6
6
 * 
7
7
 * This program is free software: you can redistribute it and/or
8
8
 * modify it under the terms of the GNU General Public License as
23
23
 */
24
24
 
25
25
#define _GNU_SOURCE             /* getline() */
26
 
#define _FORTIFY_SOURCE 2
27
26
 
28
27
#include <termios.h>            /* struct termios, tcsetattr(),
29
28
                                   TCSAFLUSH, tcgetattr(), ECHO */
50
49
volatile bool quit_now = false;
51
50
bool debug = false;
52
51
 
53
 
void termination_handler(__attribute__((unused))int signum){
 
52
static void termination_handler(__attribute__((unused))int signum){
54
53
  quit_now = true;
55
54
}
56
55
 
103
102
  
104
103
  sigemptyset(&new_action.sa_mask);
105
104
  sigaddset(&new_action.sa_mask, SIGINT);
106
 
  sigaddset(&new_action.sa_mask, SIGQUIT);
107
105
  sigaddset(&new_action.sa_mask, SIGHUP);
108
106
  sigaddset(&new_action.sa_mask, SIGTERM);
109
107
  sigaction(SIGINT, NULL, &old_action);
110
108
  if (old_action.sa_handler != SIG_IGN)
111
109
    sigaction(SIGINT, &new_action, NULL);
112
 
  sigaction(SIGQUIT, NULL, &old_action);
113
 
  if (old_action.sa_handler != SIG_IGN)
114
 
    sigaction(SIGQUIT, &new_action, NULL);
115
110
  sigaction(SIGHUP, NULL, &old_action);
116
111
  if (old_action.sa_handler != SIG_IGN)
117
112
    sigaction(SIGHUP, &new_action, NULL);