Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2063703

Summary: The curl option CURLOPT_SSH_KNOWNHOSTS has no effect
Product: Red Hat Enterprise Linux 8 Reporter: dbodnarc
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Daniel Rusek <drusek>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.6CC: kdudka
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: curl-7.61.1-25.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 10:54:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test-rhbz-2063703.c none

Description dbodnarc 2022-03-14 07:57:07 UTC
Description of problem:
We found a limitation in `libcurl` that is actually fixed, but not in the version that is maintained by redhat.

CURLOPT_SSH_KNOWNHOSTS:
The curl option CURLOPT_SSH_KNOWNHOSTS has no effect.

Normally this option can be used to specify a user defined known hosts file when using SFTP, e.g.
curl_easy_setopt(mp_curlhandle, CURLOPT_SSH_KNOWNHOSTS, knownHosts);

Version-Release number of selected component (if applicable):
curl-7.61.1

Actual results:
CURLOPT_SSH_KNOWNHOSTS option has no effect

Expected results:
CURLOPT_SSH_KNOWNHOSTS option works


Additional info:
In older versions (e.g. curl-7.61.1) it can be seen that handling this open depends on certain compile flags, e.g. in lib/setopt.c:

#ifdef HAVE_LIBSSH2_KNOWNHOST_API
  case CURLOPT_SSH_KNOWNHOSTS:
  ...

(This dependency is removed in newer curl lib versions, e.g. curl-7.81.0.)

Comment 1 Kamil Dudka 2022-03-14 08:13:50 UTC
The #ifdef in question was removed in this upstream commit:

    https://github.com/curl/curl/commit/3cbf731d

Could you please check that the above commit is really sufficient to make it work on RHEL-8?

Comment 11 Kamil Dudka 2022-06-24 12:12:57 UTC
Created attachment 1892452 [details]
test-rhbz-2063703.c

Comment 19 errata-xmlrpc 2022-11-08 10:54:33 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 (curl 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-2022:7779