Turn ChanSess's tty and term attributes into char *

This commit is contained in:
Gaël PORTAY 2015-05-02 16:01:13 +02:00
parent 7928d83b02
commit 9f97511356
2 changed files with 4 additions and 4 deletions

View File

@ -45,8 +45,8 @@ struct ChanSess {
/* pty details */ /* pty details */
int master; /* the master terminal fd*/ int master; /* the master terminal fd*/
int slave; int slave;
unsigned char * tty; char * tty;
unsigned char * term; char * term;
/* exit details */ /* exit details */
struct exitinfo exit; struct exitinfo exit;

View File

@ -567,7 +567,7 @@ static int sessionpty(struct ChanSess * chansess) {
return DROPBEAR_FAILURE; return DROPBEAR_FAILURE;
} }
chansess->term = buf_getstring(ses.payload, &termlen); chansess->term = (char *) buf_getstring(ses.payload, &termlen);
if (termlen > MAX_TERM_LEN) { if (termlen > MAX_TERM_LEN) {
/* TODO send disconnect ? */ /* TODO send disconnect ? */
TRACE(("leave sessionpty: term len too long")) TRACE(("leave sessionpty: term len too long"))
@ -583,7 +583,7 @@ static int sessionpty(struct ChanSess * chansess) {
return DROPBEAR_FAILURE; return DROPBEAR_FAILURE;
} }
chansess->tty = (char*)m_strdup(namebuf); chansess->tty = m_strdup(namebuf);
if (!chansess->tty) { if (!chansess->tty) {
dropbear_exit("Out of memory"); /* TODO disconnect */ dropbear_exit("Out of memory"); /* TODO disconnect */
} }