comparison svr-chansession.c @ 11:f76c9389e9e0

Mostly done with the listener changeover
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Jun 2004 17:22:48 +0000
parents 7f77962de998
children 469950e86d0f
comparison
equal deleted inserted replaced
9:7f77962de998 11:f76c9389e9e0
417 if (pty_allocate(&chansess->master, &chansess->slave, namebuf, 64) == 0) { 417 if (pty_allocate(&chansess->master, &chansess->slave, namebuf, 64) == 0) {
418 TRACE(("leave sessionpty: failed to allocate pty")); 418 TRACE(("leave sessionpty: failed to allocate pty"));
419 return DROPBEAR_FAILURE; 419 return DROPBEAR_FAILURE;
420 } 420 }
421 421
422 chansess->tty = (char*)strdup(namebuf); 422 chansess->tty = (char*)m_strdup(namebuf);
423 if (!chansess->tty) { 423 if (!chansess->tty) {
424 dropbear_exit("out of memory"); /* TODO disconnect */ 424 dropbear_exit("out of memory"); /* TODO disconnect */
425 } 425 }
426 426
427 pty_setowner(svr_ses.authstate.pw, chansess->tty); 427 pty_setowner(svr_ses.authstate.pw, chansess->tty);
539 } 539 }
540 if (issubsys) { 540 if (issubsys) {
541 #ifdef SFTPSERVER_PATH 541 #ifdef SFTPSERVER_PATH
542 if ((cmdlen == 4) && strncmp(chansess->cmd, "sftp", 4) == 0) { 542 if ((cmdlen == 4) && strncmp(chansess->cmd, "sftp", 4) == 0) {
543 m_free(chansess->cmd); 543 m_free(chansess->cmd);
544 chansess->cmd = strdup(SFTPSERVER_PATH); 544 chansess->cmd = m_strdup(SFTPSERVER_PATH);
545 } else 545 } else
546 #endif 546 #endif
547 { 547 {
548 return DROPBEAR_FAILURE; 548 return DROPBEAR_FAILURE;
549 } 549 }