Mercurial > dropbear
comparison svr-chansession.c @ 1102:ae63de5caf81
Turn ChanSess's tty and term attributes into char *
author | Gaël PORTAY <gael.portay@gmail.com> |
---|---|
date | Sat, 02 May 2015 16:01:13 +0200 |
parents | c45d65392c1a |
children | 303e27a78d2e |
comparison
equal
deleted
inserted
replaced
1101:94ff5316980f | 1102:ae63de5caf81 |
---|---|
565 if (!svr_pubkey_allows_pty()) { | 565 if (!svr_pubkey_allows_pty()) { |
566 TRACE(("leave sessionpty : pty forbidden by public key option")) | 566 TRACE(("leave sessionpty : pty forbidden by public key option")) |
567 return DROPBEAR_FAILURE; | 567 return DROPBEAR_FAILURE; |
568 } | 568 } |
569 | 569 |
570 chansess->term = buf_getstring(ses.payload, &termlen); | 570 chansess->term = (char *) buf_getstring(ses.payload, &termlen); |
571 if (termlen > MAX_TERM_LEN) { | 571 if (termlen > MAX_TERM_LEN) { |
572 /* TODO send disconnect ? */ | 572 /* TODO send disconnect ? */ |
573 TRACE(("leave sessionpty: term len too long")) | 573 TRACE(("leave sessionpty: term len too long")) |
574 return DROPBEAR_FAILURE; | 574 return DROPBEAR_FAILURE; |
575 } | 575 } |
581 if (pty_allocate(&chansess->master, &chansess->slave, namebuf, 64) == 0) { | 581 if (pty_allocate(&chansess->master, &chansess->slave, namebuf, 64) == 0) { |
582 TRACE(("leave sessionpty: failed to allocate pty")) | 582 TRACE(("leave sessionpty: failed to allocate pty")) |
583 return DROPBEAR_FAILURE; | 583 return DROPBEAR_FAILURE; |
584 } | 584 } |
585 | 585 |
586 chansess->tty = (char*)m_strdup(namebuf); | 586 chansess->tty = m_strdup(namebuf); |
587 if (!chansess->tty) { | 587 if (!chansess->tty) { |
588 dropbear_exit("Out of memory"); /* TODO disconnect */ | 588 dropbear_exit("Out of memory"); /* TODO disconnect */ |
589 } | 589 } |
590 | 590 |
591 pw = getpwnam(ses.authstate.pw_name); | 591 pw = getpwnam(ses.authstate.pw_name); |