Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont send user telnet stuff to bot only port #1437

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 30 additions & 28 deletions src/dcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,39 +2408,41 @@ static void dcc_telnet_got_ident(int i, char *host)
dcc[i].u.chat = get_data_ptr(sizeof(struct chat_info));
egg_bzero(dcc[i].u.chat, sizeof(struct chat_info));

/* Note: we don't really care about telnet status here. We use the
* STATUS option as a hopefully harmless way to detect if the other
* side is a telnet client or not. */
#ifdef TLS
if (!dcc[i].ssl)
dprintf(i, TLN_IAC_C TLN_WILL_C TLN_STATUS_C);
#endif
/* Copy acceptable-nick/host mask */
dcc[i].status = STAT_TELNET | STAT_ECHO;
if (!strcmp(dcc[idx].nick, "(bots)"))
dcc[i].status |= STAT_BOTONLY;
if (!strcmp(dcc[idx].nick, "(users)"))
dcc[i].status |= STAT_USRONLY;
/* Copy acceptable-nick/host mask */
else {
/* Note: we don't really care about telnet status here. We use the STATUS
* option as a hopefully harmless way to detect if the other side is a
* telnet client or not. */
#ifdef TLS
if (!dcc[i].ssl)
dprintf(i, TLN_IAC_C TLN_WILL_C TLN_STATUS_C);
#endif
/* Displays a customizable banner. */
if (use_telnet_banner)
show_banner(i);
/* This is so we don't tell someone doing a portscan anything about
* ourselves. <cybah>
*/
if (stealth_telnets) {
/* Show here so it doesn't interfere with newline-less stealth_prompt */
if (allow_new_telnets)
dprintf(i, "(If you are new, enter 'NEW' here.)\n");
dprintf(i, "%s", stealth_prompt);
} else {
dprintf(i, "\n\n");
sub_lang(i, MISC_BANNER);
/* Show here so it doesn't get lost before the banner */
if (allow_new_telnets)
dprintf(i, "(If you are new, enter 'NEW' here.)\n");
}
/* Copy acceptable-nick/host mask */
if (!strcmp(dcc[idx].nick, "(users)"))
dcc[i].status |= STAT_USRONLY;
}
strlcpy(dcc[i].nick, dcc[idx].host, HANDLEN);
dcc[i].timeval = now;
strcpy(dcc[i].u.chat->con_chan, chanset ? chanset->dname : "*");
/* Displays a customizable banner. */
if (use_telnet_banner)
show_banner(i);
/* This is so we don't tell someone doing a portscan anything
* about ourselves. <cybah>
*/
if (stealth_telnets) {
/* Show here so it doesn't interfere with newline-less stealth_prompt */
if (allow_new_telnets)
dprintf(i, "(If you are new, enter 'NEW' here.)\n");
dprintf(i, "%s", stealth_prompt);
} else {
dprintf(i, "\n\n");
sub_lang(i, MISC_BANNER);
/* Show here so it doesn't get lost before the banner */
if (allow_new_telnets)
dprintf(i, "(If you are new, enter 'NEW' here.)\n");
}
}