summaryrefslogtreecommitdiff
path: root/modules/pam_filter
diff options
context:
space:
mode:
authorSebastien Tricaud <toady@gscore.org>2004-11-16 14:27:40 +0000
committerSebastien Tricaud <toady@gscore.org>2004-11-16 14:27:40 +0000
commit6d6eebcafec81d696b621d8453b13d55a1f9be1d (patch)
tree441c3d1fc820ffa2d83b3e1cd592715a3724d0ed /modules/pam_filter
parentf135e2b8bca4998e100d412690e493dfff90dbbd (diff)
Applied debian patches
Diffstat (limited to 'modules/pam_filter')
-rw-r--r--modules/pam_filter/pam_filter.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/pam_filter/pam_filter.c b/modules/pam_filter/pam_filter.c
index d3462f40..328fec87 100644
--- a/modules/pam_filter/pam_filter.c
+++ b/modules/pam_filter/pam_filter.c
@@ -21,7 +21,7 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <termio.h>
+#include <termios.h>
#include <signal.h>
@@ -287,7 +287,7 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
{
int status=-1;
char terminal[TERMINAL_LEN];
- struct termio stored_mode; /* initial terminal mode settings */
+ struct termios stored_mode; /* initial terminal mode settings */
int fd[2], child=0, child2=0, aterminal;
if (filtername == NULL || *filtername != '/') {
@@ -314,15 +314,15 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
/* set terminal into raw mode.. remember old mode so that we can
revert to it after the child has quit. */
- /* this is termio terminal handling... */
+ /* this is termios terminal handling... */
- if (ioctl(STDIN_FILENO, TCGETA, (char *) &stored_mode ) < 0) {
+ if ( tcgetattr(STDIN_FILENO, &stored_mode) < 0 ) {
/* in trouble, so close down */
close(fd[0]);
_pam_log(LOG_CRIT, "couldn't copy terminal mode");
return PAM_ABORT;
} else {
- struct termio t_mode = stored_mode;
+ struct termios t_mode = stored_mode;
t_mode.c_iflag = 0; /* no input control */
t_mode.c_oflag &= ~OPOST; /* no ouput post processing */
@@ -335,7 +335,7 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
t_mode.c_cc[VMIN] = 1; /* number of chars to satisfy a read */
t_mode.c_cc[VTIME] = 0; /* 0/10th second for chars */
- if (ioctl(STDIN_FILENO, TCSETA, (char *) &t_mode) < 0) {
+ if ( tcsetattr(STDIN_FILENO, TCSAFLUSH, &t_mode) < 0 ) {
close(fd[0]);
_pam_log(LOG_WARNING, "couldn't put terminal in RAW mode");
return PAM_ABORT;
@@ -365,7 +365,7 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
_pam_log(LOG_WARNING,"first fork failed");
if (aterminal) {
- (void) ioctl(STDIN_FILENO, TCSETA, (char *) &stored_mode);
+ (void) tcsetattr(STDIN_FILENO, TCSAFLUSH, &stored_mode);
}
return PAM_AUTH_ERR;
@@ -407,7 +407,7 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
/* initialize the child's terminal to be the way the
parent's was before we set it into RAW mode */
- if (ioctl(fd[1], TCSETA, (char *) &stored_mode) < 0) {
+ if ( tcsetattr(fd[1], TCSANOW, &stored_mode) < 0 ) {
_pam_log(LOG_WARNING,"cannot set slave terminal mode; %s"
,terminal);
close(fd[1]);
@@ -581,7 +581,7 @@ static int set_filter(pam_handle_t *pamh, int flags, int ctrl
if (aterminal) {
/* reset to initial terminal mode */
- (void) ioctl(STDIN_FILENO, TCSETA, (char *) &stored_mode);
+ (void) tcsetattr(STDIN_FILENO, TCSANOW, &stored_mode);
}
if (ctrl & FILTER_DEBUG) {