diff --git a/extensions/telnet/telnetd.c b/extensions/telnet/telnetd.c index f1c3c07..f11e55a 100644 --- a/extensions/telnet/telnetd.c +++ b/extensions/telnet/telnetd.c @@ -154,6 +154,11 @@ static void telnetdConnection(int client) shellCompanionAdd(telnetdShell, SHELL_COMPANION_ID_TELNETD, (void *)client); shellInit(telnetdShell, shellBuffer, TELNETD_SHELL_BUFFER_SIZE); + if (TELNETD_SHELL_USER) + { + shellRun(telnetdShell, TELNETD_SHELL_USER); + } + while (1) { len = recv(client, data, 1, 0); diff --git a/extensions/telnet/telnetd.h b/extensions/telnet/telnetd.h index 7db0c08..27a751a 100644 --- a/extensions/telnet/telnetd.h +++ b/extensions/telnet/telnetd.h @@ -36,6 +36,11 @@ */ #define TELNETD_SHELL_BUFFER_SIZE 512 +/** + * @brief telnet shell的用户名,使用默认shell用户设置为NULL即可 + */ +#define TELNETD_SHELL_USER NULL + /** * @brief 新线程接口 *