mirror of
https://github.com/clearml/dropbear
synced 2025-02-12 07:25:30 +00:00
Turn ChanSess's tty and term attributes into char *
This commit is contained in:
parent
7928d83b02
commit
9f97511356
@ -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;
|
||||||
|
@ -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 */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user