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

Watcher doesn't work with FreeBSD #2279

Open
jkazimierczak opened this issue Sep 4, 2023 · 0 comments
Open

Watcher doesn't work with FreeBSD #2279

jkazimierczak opened this issue Sep 4, 2023 · 0 comments

Comments

@jkazimierczak
Copy link

Due diligence
Please try searching the issue tracker for your problem if you haven't already!
If you find related issues that aren't an exact match, feel free to continue
making a report, and link to those issues.

Describe the bug
Responder doesn't respond to prompts, despite matching regex.

To Reproduce
Steps to reproduce the behaviour (please attach a minimal example):

  1. Create the script on the remote host and make it executable:
#!/bin/bash

read -s -p "Password: " password
echo -n

echo $password

I placed it in the user's home directory and named it "prompt.sh".

  1. Execute following fabric code:
from invoke import Responder
from fabric import Connection


user = ""
passwd = ""
host = ""

ssh = Connection(f"{user}@{host}", connect_kwargs={"password": passwd})
passwd_watcher = Responder(pattern=r"Password.*", response="somePassWD40")

ssh.run(
    "./prompt.sh",
    # encoding="utf-8",
    # echo=False,
    pty=True,
    watchers=[passwd_watcher],
)

Expected behaviour
Prompt is supplied with the response automatically and .run() invocation finishes successfully.

Environment
Make sure your report gets the attention it deserves: bug reports with missing
information may be ignored or punted back to you, delaying a fix. The below
constitutes a bare minimum; more info is almost always better:

Python 3.10
Client-side OS: Windows 10, 22H2 (19045.3324)  |  OpenSSH 8.1.0.1
Server-side OS: FreeBSD 13.2-RELEASE
Fabric version: 3.2.2

Also tried with these fabric versions: 3.1.0, 2.5.0, 2.6.0, 2.7.1, but the result is the same - response is not being handled correctly.

Additional context
Manually providing the response for prompts also causes .run() to "hang in place". I tried also providing the response with and without watchers specified.

@jkazimierczak jkazimierczak changed the title Watcher doesn't work on FreeBSD Watcher doesn't work with FreeBSD Sep 4, 2023
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

No branches or pull requests

1 participant