Skip to content

Commit

Permalink
优化 telnet组件可独立设置用户
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindZZT committed Aug 10, 2021
1 parent a6e391b commit dc76d7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extensions/telnet/telnetd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions extensions/telnet/telnetd.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
*/
#define TELNETD_SHELL_BUFFER_SIZE 512

/**
* @brief telnet shell的用户名,使用默认shell用户设置为NULL即可
*/
#define TELNETD_SHELL_USER NULL

/**
* @brief 新线程接口
*
Expand Down

0 comments on commit dc76d7a

Please sign in to comment.