/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

fixed incorrect include comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * along with this program.  If not, see
20
20
 * <http://www.gnu.org/licenses/>.
21
21
 * 
22
 
 * Contact the authors at <https://www.fukt.bsnet.se/~belorn/> and
23
 
 * <https://www.fukt.bsnet.se/~teddy/>.
 
22
 * Contact the authors at <mandos@fukt.bsnet.se>.
24
23
 */
25
24
 
26
25
#define _GNU_SOURCE             /* getline() */
45
44
#include <errno.h>              /* errno, EINVAL */
46
45
#include <iso646.h>             /* or, not */
47
46
#include <stdbool.h>            /* bool, false, true */
48
 
#include <string.h>             /* strlen, rindex, strncmp, strcmp */
 
47
#include <string.h>             /* strlen, rindex */
49
48
#include <argp.h>               /* struct argp_option, struct
50
49
                                   argp_state, struct argp,
51
50
                                   argp_parse(), error_t,
129
128
  }
130
129
  
131
130
  sigemptyset(&new_action.sa_mask);
132
 
  sigaddset(&new_action.sa_mask, SIGINT);
133
 
  sigaddset(&new_action.sa_mask, SIGHUP);
134
 
  sigaddset(&new_action.sa_mask, SIGTERM);
135
 
  ret = sigaction(SIGINT, NULL, &old_action);
136
 
  if(ret == -1){
137
 
    perror("sigaction");
 
131
  ret = sigaddset(&new_action.sa_mask, SIGINT);
 
132
  if(ret == -1){
 
133
    perror("sigaddset");
 
134
    return EXIT_FAILURE;
 
135
  }
 
136
  ret = sigaddset(&new_action.sa_mask, SIGHUP);
 
137
  if(ret == -1){
 
138
    perror("sigaddset");
 
139
    return EXIT_FAILURE;
 
140
  }
 
141
  ret = sigaddset(&new_action.sa_mask, SIGTERM);
 
142
  if(ret == -1){
 
143
    perror("sigaddset");
138
144
    return EXIT_FAILURE;
139
145
  }
140
146
  /* Need to check if the handler is SIG_IGN before handling:
141
147
     | [[info:libc:Initial Signal Actions]] |
142
148
     | [[info:libc:Basic Signal Handling]]  |
143
149
  */
 
150
  ret = sigaction(SIGINT, NULL, &old_action);
 
151
  if(ret == -1){
 
152
    perror("sigaction");
 
153
    return EXIT_FAILURE;
 
154
  }
144
155
  if(old_action.sa_handler != SIG_IGN){
145
156
    ret = sigaction(SIGINT, &new_action, NULL);
146
157
    if(ret == -1){