/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

Added support for protocol version handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
volatile bool quit_now = false;
50
50
bool debug = false;
51
51
 
52
 
static void termination_handler(__attribute__((unused))int signum){
 
52
void termination_handler(__attribute__((unused))int signum){
53
53
  quit_now = true;
54
54
}
55
55
 
146
146
      status = EXIT_SUCCESS;
147
147
      break;
148
148
    }
 
149
    // ret == 0 makes no other sence than to retry to read from stdin
149
150
    if (ret < 0){
150
151
      if (errno != EINTR and not feof(stdin)){
151
152
        perror("getline");
153
154
        break;
154
155
      }
155
156
    }
156
 
    /* if(ret == 0), then the only sensible thing to do is to retry to
157
 
       read from stdin */
158
157
    fputc('\n', stderr);
159
158
  }
160
 
  
 
159
 
161
160
  if (debug){
162
161
    fprintf(stderr, "Restoring terminal attributes\n");
163
162
  }
164
163
  if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &t_old) != 0){
165
164
    perror("tcsetattr+echo");
166
165
  }
167
 
  
 
166
 
168
167
  if (debug){
169
168
    fprintf(stderr, "%s is exiting\n", argv[0]);
170
169
  }