/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: Teddy Hogeborn
  • Date: 2008-07-22 06:23:29 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080722062329-jaex5y5mslf6sqjx
* mandos-clients.conf ([DEFAULT]): New section.

* plugins.d/mandosclient.c (start_mandos_communication): Only print if
                                                         debugging.
                                                         Print server
                                                         name.
                                                         Bug fix: Loop
                                                         until suc-
                                                         cess.

* server.py (serverName): Set via option, not globally.
  (Client.__init__): Removed argument "options".  Require "timeout"
                     and "interval" arguments.
  (tcp_handler.handle): Set "priority" from self.server.options.
  (main): Removed "--timeout" and "--interval" options.  New options
          "--priority" and "--servicename".  Add defaults for
          "timeout" and "interval".  Set "serviceName" from options.
          Do not pass "options" to "Client()".

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 & Björn Påhlsson
 
5
 * Copyright © 2007-2008 Teddy Hogeborn and 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
26
27
 
27
28
#include <termios.h>            /* struct termios, tcsetattr(),
28
29
                                   TCSAFLUSH, tcgetattr(), ECHO */
49
50
volatile bool quit_now = false;
50
51
bool debug = false;
51
52
 
52
 
static void termination_handler(__attribute__((unused))int signum){
 
53
void termination_handler(__attribute__((unused))int signum){
53
54
  quit_now = true;
54
55
}
55
56
 
102
103
  
103
104
  sigemptyset(&new_action.sa_mask);
104
105
  sigaddset(&new_action.sa_mask, SIGINT);
 
106
  sigaddset(&new_action.sa_mask, SIGQUIT);
105
107
  sigaddset(&new_action.sa_mask, SIGHUP);
106
108
  sigaddset(&new_action.sa_mask, SIGTERM);
107
109
  sigaction(SIGINT, NULL, &old_action);
108
110
  if (old_action.sa_handler != SIG_IGN)
109
111
    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);
110
115
  sigaction(SIGHUP, NULL, &old_action);
111
116
  if (old_action.sa_handler != SIG_IGN)
112
117
    sigaction(SIGHUP, &new_action, NULL);