~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to ttymodes.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: ttymodes.c,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */
 
1
/* $OpenBSD: ttymodes.c,v 1.28 2008/07/07 00:31:41 stevesk Exp $ */
2
2
/*
3
3
 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4
4
 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
298
298
        }
299
299
 
300
300
        if (tiop == NULL) {
 
301
                if (fd == -1) {
 
302
                        debug("tty_make_modes: no fd or tio");
 
303
                        goto end;
 
304
                }
301
305
                if (tcgetattr(fd, &tio) == -1) {
302
306
                        logit("tcgetattr: %.100s", strerror(errno));
303
307
                        goto end;
317
321
 
318
322
        /* Store values of mode flags. */
319
323
#define TTYCHAR(NAME, OP) \
320
 
        debug3("tty_make_modes: %d %d", OP, tio.c_cc[NAME]); \
321
324
        buffer_put_char(&buf, OP); \
322
325
        put_arg(&buf, special_char_encode(tio.c_cc[NAME]));
323
326
 
324
327
#define TTYMODE(NAME, FIELD, OP) \
325
 
        debug3("tty_make_modes: %d %d", OP, ((tio.FIELD & NAME) != 0)); \
326
328
        buffer_put_char(&buf, OP); \
327
329
        put_arg(&buf, ((tio.FIELD & NAME) != 0));
328
330
 
353
355
        int n_bytes = 0;
354
356
        int failure = 0;
355
357
        u_int (*get_arg)(void);
356
 
        int arg, arg_size;
 
358
        int arg_size;
357
359
 
358
360
        if (compat20) {
359
361
                *n_bytes_ptr = packet_get_int();
410
412
        case OP: \
411
413
          n_bytes += arg_size; \
412
414
          tio.c_cc[NAME] = special_char_decode(get_arg()); \
413
 
          debug3("tty_parse_modes: %d %d", OP, tio.c_cc[NAME]); \
414
415
          break;
415
416
#define TTYMODE(NAME, FIELD, OP) \
416
417
        case OP: \
417
418
          n_bytes += arg_size; \
418
 
          if ((arg = get_arg())) \
 
419
          if (get_arg()) \
419
420
            tio.FIELD |= NAME; \
420
421
          else \
421
422
            tio.FIELD &= ~NAME; \
422
 
          debug3("tty_parse_modes: %d %d", OP, arg); \
423
423
          break;
424
424
 
425
425
#include "ttymodes.h"