RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2091512 - curl prints unexpected messages when using sftp URLs and LogLevel is set
Summary: curl prints unexpected messages when using sftp URLs and LogLevel is set
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libssh
Version: 8.6
Hardware: Unspecified
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Norbert Pócs
QA Contact: Stanislav Zidek
URL:
Whiteboard:
Depends On:
Blocks: 2132407
TreeView+ depends on / blocked
 
Reported: 2022-05-30 07:51 UTC by Daniel Reynolds
Modified: 2023-05-16 11:17 UTC (History)
5 users (show)

Fixed In Version: libssh-0.9.6-4.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2132407 (view as bug list)
Environment:
Last Closed: 2023-05-16 09:10:06 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-7487 0 None None None 2022-06-07 13:41:11 UTC
Red Hat Issue Tracker RHELPLAN-123624 0 None None None 2022-05-30 07:54:39 UTC
Red Hat Product Errata RHBA-2023:3008 0 None None None 2023-05-16 09:10:11 UTC

Description Daniel Reynolds 2022-05-30 07:51:27 UTC
Description of problem:
curl prints unexpected messages when using sftp URLs and LogLevel is set


Version-Release number of selected component (if applicable):
- curl-7.61.1-22.el8.x86_64


How reproducible:
Always


Steps to Reproduce:

1. Add LogLevel to `/etc/ssh/ssh_config`

    Similar errors shown for FATAL, ERROR, INFO

        LogLevel FATAL

2. Fetch file using curl

        [dareynol@localhost ~]$ curl -sk -u dareynol sftp://localhost/home/dareynol/test-file test-file.out

Actual results:

Enter host password for user 'dareynol':
[2022/05/30 03:47:59.356338, 1] ssh_config_parse_line:  line 3: Unsupported Match keyword 'final', skipping
[2022/05/30 03:47:59.356376, 1] ssh_config_parse_line:  Unknown option: GSSAPIKexAlgorithms, line: 3
[2022/05/30 03:47:59.356381, 1] ssh_config_parse_line:  Unknown option: CASignatureAlgorithms, line: 6
[2022/05/30 03:47:59.356397, 1] socket_callback_connected:  Socket connection callback: 1 (0)
[2022/05/30 03:47:59.356490, 1] ssh_known_hosts_read_entries:  Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
[2022/05/30 03:47:59.365865, 1] ssh_packet_userauth_failure:  Access denied for 'none'. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
[2022/05/30 03:47:59.551241, 1] ssh_pki_import_pubkey_file:  Error opening /home/dareynol/.ssh/id_ed25519.pub: No such file or directory
[2022/05/30 03:47:59.551273, 1] ssh_pki_import_privkey_file:  Error opening /home/dareynol/.ssh/id_ed25519: No such file or directory
[2022/05/30 03:47:59.551278, 1] ssh_pki_import_pubkey_file:  Error opening /home/dareynol/.ssh/id_ecdsa.pub: No such file or directory
[2022/05/30 03:47:59.551281, 1] ssh_pki_import_privkey_file:  Error opening /home/dareynol/.ssh/id_ecdsa: No such file or directory
[2022/05/30 03:47:59.551285, 1] ssh_pki_import_pubkey_file:  Error opening /home/dareynol/.ssh/id_rsa.pub: No such file or directory
[2022/05/30 03:47:59.551289, 1] ssh_pki_import_privkey_file:  Error opening /home/dareynol/.ssh/id_rsa: No such file or directory
[2022/05/30 03:47:59.551293, 1] ssh_pki_import_pubkey_file:  Error opening /home/dareynol/.ssh/id_dsa.pub: No such file or directory
[2022/05/30 03:47:59.551297, 1] ssh_pki_import_privkey_file:  Error opening /home/dareynol/.ssh/id_dsa: No such file or directory
[2022/05/30 03:47:59.573869, 1] ssh_packet_global_request:  Invalid SSH_MSG_GLOBAL_REQUEST packet


Expected results:

[dareynol@rhel7 ~]$ curl -sk -u dareynol sftp://localhost/home/dareynol/test-file -o test-file.out 
Enter host password for user 'dareynol':
[dareynol@rhel7 ~]$ q


Additional info:

RHEL 7 works as expected.
- rpm version curl-7.29.0-59.el7_9.1.x86_64

Comment 1 Kamil Dudka 2022-05-30 08:01:13 UTC
This seems to be printed by libssh, which libcurl uses for the SSH layer.  I am switching the component accordingly.

Comment 2 Norbert Pócs 2022-06-06 16:41:37 UTC
Hi Daniel,

Can you please clarify the bug; is curl failing with set loglevel in libssh config file?

Comment 3 Kamil Dudka 2022-06-06 17:16:12 UTC
Not that I was asked but I believe the info is already available in comment #0:

- LogLevel is set in `/etc/ssh/ssh_config`, which is installed by openssh-clients

- curl is not failing, it just prints unexpected messages

Comment 6 Kamil Dudka 2022-06-07 11:56:13 UTC
The ssh_config(5) man page says it is OpenSSH client configuration file though.  In particular, the documentation of LogLevel says:

    "Gives the verbosity level that is used when logging messages from ssh(1)."

I do not think it works as documented.

Comment 7 Norbert Pócs 2022-06-07 12:08:16 UTC
(In reply to Kamil Dudka from comment #6)
> The ssh_config(5) man page says it is OpenSSH client configuration file
> though.  In particular, the documentation of LogLevel says:
> 
>     "Gives the verbosity level that is used when logging messages from
> ssh(1)."
> 
> I do not think it works as documented.

Libssh in contrast to OpenSSH does not provide any client application (as ssh[1]) and uses LogLevel
(and overall the configuration file) for any connection being made as a client. (function ssh_connect)

Comment 8 Kamil Dudka 2022-06-07 12:40:51 UTC
Where is it documented?  I can see no mention of `/etc/ssh/ssh_config` in libssh documentation, even with libssh-devel installed.

Comment 9 Kamil Dudka 2022-06-07 13:12:22 UTC
Apart from the missing documentation, the implementation in libssh [1] is totally incompatible with OpenSSH:

(1) OpenSSH sets default LogLevel to INFO.  So setting LogLevel to INFO should not change the behavior.  libssh defaults to QUIET.

(2) Setting LogLevel to FATAL or ERROR causes OpenSSH to print fewer diagnostic messages, which quite opposite to what libssh does.

So the changes to a config file of OpenSSH lead to completely unexpected changes in the behavior of curl.  This needs to be fixed.

[1] https://git.libssh.org/projects/libssh.git/tree/src/bind_config.c?h=libssh-0.9.6#n412

Comment 11 Norbert Pócs 2022-06-07 13:29:43 UTC
I will add it to the documentation too.

Comment 24 errata-xmlrpc 2023-05-16 09:10:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libssh bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3008


Note You need to log in before you can comment on or make changes to this bug.