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

Incompatible remote shell (was: Can't create folder (because of fish shell on remote)) #1905

Open
TriplEight opened this issue Oct 15, 2024 · 1 comment
Labels
Bug Discussion decision or consensus needed External depends on others/upstream

Comments

@TriplEight
Copy link

Spent an hour checking that everything else works.
Please at least don't let this fail silently. cc #470

backintime-qt --backup:

DEBUG: [common/sshtools.py:664 SSH.checkRemoteFolder] Call command: ssh -o ServerAliveInterval=240 -o LogLevel=Error -o IdentityFile=/home/user/.ssh/backup -o Ciphers=aes192-ctr -p 22 user@192.168.10.10 d=0;test -e "/run/media/user/share/backups" || d=1;test $d -eq 1 && mkdir "/run/media/user/share/backups"; err=$?;test $d -eq 1 && exit $err;test -d "/run/media/user/share/backups" || exit 11;test -w "/run/media/user/share/backups" || exit 12;test -x "/run/media/user/share/backups" || exit 13;exit 20
DEBUG: [common/sshtools.py:674 SSH.checkRemoteFolder] Command returncode: 127

remote test:

$ ssh -o ServerAliveInterval=240 -o LogLevel=Error -o IdentityFile=/home/user/.ssh/backup -o Ciphers=aes128-ctr -p 22 user@192.168.10.10 d=0;test -e "/mounts/share/backups" || d=1;test $d -eq 1 && mkdir "/mounts/share/backups"; err=$?;test $d -eq 1 && exit $err;test -d "/mounts/share/backups" || exit 11;test -w "/mounts/share/backups" || exit 12;test -x "/mounts/share/backups" || exit 13;exit 20
fish: Unsupported use of '='. In fish, please use 'set d 0'.
d=0
^~^
mkdir: cannot create directory ‘/mounts/share/backups’: No such file or directory
exit
@buhtz
Copy link
Member

buhtz commented Oct 16, 2024

Hello Denis,

Thank you for taking the time to report the bug and providing the details. I appreciate your feedback.

I see several options how to "solve" this issue. Please let me know what you think from your perspective and experience. Maybe you see another option?

bash-only: We could check for the remote shell and give an error message if it is not bash. Easy to implement.

allowlist: Check the remote shell and see if it is a shell in an allowlist.

denylist: The opposite of an allowlist.

posix: Force posix shells. To my knowledge fish should does follow posix standard. Fish does not adher to posix, so it would not be allowed by BIT. But our own shell calls also not posix complaint. There might be some linters/checkers.

force bash: Isn't it possible to force using bash on remote? Not ssh -o ServerAliveInterval=240 foobar but ssh -o ServerAliveInterval=240 bash -c "foobar"?

Let me know what you think?

Please see the projects background information to get an idea about our workflow and priorities:

Best regards,
Christian

@buhtz buhtz added Discussion decision or consensus needed Bug External depends on others/upstream labels Oct 16, 2024
@buhtz buhtz changed the title Can't create folder (because of fish shell on remote) Incompatible remote shell (was: Can't create folder (because of fish shell on remote)) Oct 16, 2024
@buhtz buhtz added this to the 1.6.0 (2nd release from now) milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Discussion decision or consensus needed External depends on others/upstream
Projects
None yet
Development

No branches or pull requests

2 participants