]> andersk Git - gssapi-openssh.git/blobdiff - openssh/ttymodes.c
The man2html from jbasney on pkilab2 works whereas the standard one doesn't.
[gssapi-openssh.git] / openssh / ttymodes.c
index c32e213a4399c67cb2e2089ba0a2d262887cbc9e..c0bb0b1f898cf7db1d62923a18eda4584c7eec1d 100644 (file)
@@ -43,7 +43,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ttymodes.c,v 1.19 2003/04/08 20:21:29 itojun Exp $");
+RCSID("$OpenBSD: ttymodes.c,v 1.14 2001/06/24 17:18:31 markus Exp $");
 
 #include "packet.h"
 #include "log.h"
@@ -267,7 +267,7 @@ tty_make_modes(int fd, struct termios *tiop)
 
        if (tiop == NULL) {
                if (tcgetattr(fd, &tio) == -1) {
-                       logit("tcgetattr: %.100s", strerror(errno));
+                       log("tcgetattr: %.100s", strerror(errno));
                        goto end;
                }
        } else
@@ -307,6 +307,7 @@ end:
        else
                packet_put_raw(buffer_ptr(&buf), buffer_len(&buf));
        buffer_free(&buf);
+       return;
 }
 
 /*
@@ -341,7 +342,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
         * modes, they will initially have reasonable values.
         */
        if (tcgetattr(fd, &tio) == -1) {
-               logit("tcgetattr: %.100s", strerror(errno));
+               log("tcgetattr: %.100s", strerror(errno));
                failure = -1;
        }
 
@@ -395,23 +396,23 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
 
                default:
                        debug("Ignoring unsupported tty mode opcode %d (0x%x)",
-                           opcode, opcode);
+                             opcode, opcode);
                        if (!compat20) {
                                /*
                                 * SSH1:
                                 * Opcodes 1 to 127 are defined to have
                                 * a one-byte argument.
-                                * Opcodes 128 to 159 are defined to have
-                                * an integer argument.
-                                */
+                                * Opcodes 128 to 159 are defined to have
+                                * an integer argument.
+                                */
                                if (opcode > 0 && opcode < 128) {
                                        n_bytes += 1;
                                        (void) packet_get_char();
                                        break;
                                } else if (opcode >= 128 && opcode < 160) {
-                                       n_bytes += 4;
-                                       (void) packet_get_int();
-                                       break;
+                                       n_bytes += 4;
+                                       (void) packet_get_int();
+                                       break;
                                } else {
                                        /*
                                         * It is a truly undefined opcode (160 to 255).
@@ -420,9 +421,10 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
                                         * left in the packet; hopefully there is nothing
                                         * more coming after the mode data.
                                         */
-                                       logit("parse_tty_modes: unknown opcode %d", opcode);
+                                       log("parse_tty_modes: unknown opcode %d", opcode);
+                                       packet_integrity_check(0, 1, SSH_CMSG_REQUEST_PTY);
                                        goto set;
-                               }
+                               }
                        } else {
                                /*
                                 * SSH2:
@@ -436,17 +438,17 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
                                        (void) packet_get_int();
                                        break;
                                } else {
-                                       logit("parse_tty_modes: unknown opcode %d", opcode);
+                                       log("parse_tty_modes: unknown opcode %d", opcode);
                                        goto set;
                                }
-                       }
+                       }
                }
        }
 
 set:
        if (*n_bytes_ptr != n_bytes) {
                *n_bytes_ptr = n_bytes;
-               logit("parse_tty_modes: n_bytes_ptr != n_bytes: %d %d",
+               log("parse_tty_modes: n_bytes_ptr != n_bytes: %d %d",
                    *n_bytes_ptr, n_bytes);
                return;         /* Don't process bytes passed */
        }
@@ -455,5 +457,6 @@ set:
 
        /* Set the new modes for the terminal. */
        if (tcsetattr(fd, TCSANOW, &tio) == -1)
-               logit("Setting tty modes failed: %.100s", strerror(errno));
+               log("Setting tty modes failed: %.100s", strerror(errno));
+       return;
 }
This page took 0.12539 seconds and 4 git commands to generate.