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

Fix "echo off" issues #1425

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Feb 17, 2023

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:

Additional description (if needed):

  1. Fix "echo off" for command .su

  2. Fix propagating telnet status for command .relay
    The propagation is necessary, so that the destination bot can send telnet control codes like "echo off"
    eggdrop has got a telnet detector

    eggdrop/src/dcc.c

    Lines 80 to 91 in ffb8c18

    static int detect_telnet(unsigned char *buf)
    {
    if (!buf || !buf[0] || !buf[1])
    return 0;
    while (buf[2]) {
    if (buf[0] == TLN_IAC && (buf[1] == TLN_DO || buf[1] == TLN_DONT) &&
    buf[2] == TLN_STATUS)
    return 1;
    buf++;
    }
    return 0;
    }

    so we will send it exactly what it is looking for

  3. Fix "echo on" for command .relay

Test cases demonstrating functionality (if applicable):
1. Fix "echo off" for command .su
Before:

$ telnet 127.0.0.1 3333
[...]
.su testuser
*** testuser2 left the party line.
Enter password for testuserÿû
123456
[...]
*** testuser joined the party line.

After:

$ telnet 127.0.0.1 3333
[...]
.su testuser
*** testuser2 left the party line.
Enter password for testuser
[...]
*** testuser joined the party line.

2. fix propagating telnet status for command .relay
Start 2 Bots, BotA and BotB
Telnet to BotA
Before:

.relay BotB
[...]
Enter your password.
123456
 
Connected[...]

After:

.relay BotB
[...]
Enter your password.

 
Connected[...]

3. Fix "echo on" for command .relay
.relay BotB
Before:


.quit
*** Ja mata!
*** testuser left the party line.
ÿü


*** RELAY CONNECTION DROPPED.

After:

.quit
*** Ja mata!
*** testuser left the party line.


*** RELAY CONNECTION DROPPED.

Additionally i successfully checked that the "echo on" is indeed working by temporarily commenting out the tputs() in source, then .relaying to BotB and entering a wrong password. The password request did send "echo off". So, with "echo on" commented out, echo was off after relay came back.

@michaelortmann michaelortmann changed the title Fix echo off for command su Fix "echo off" issues Feb 22, 2023
michaelortmann added a commit to michaelortmann/eggdrop that referenced this pull request Feb 22, 2023
@vanosg vanosg added this to the v1.10 milestone Apr 4, 2023
@vanosg vanosg modified the milestones: v1.10.0, v1.10.1 May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants