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 1097665 - ssh-keygen with error : gethostname: File name too long
Summary: ssh-keygen with error : gethostname: File name too long
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssh
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Stanislav Zidek
URL:
Whiteboard:
: 1187689 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-14 09:33 UTC by bkopilov
Modified: 2015-03-05 09:27 UTC (History)
7 users (show)

Fixed In Version: openssh-6.6.1p1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1161454 (view as bug list)
Environment:
Last Closed: 2015-03-05 09:27:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenSSH Project 2239 0 None None None Never
Red Hat Product Errata RHSA-2015:0425 0 normal SHIPPED_LIVE Moderate: openssh security, bug fix and enhancement update 2015-03-05 14:26:20 UTC

Description bkopilov 2014-05-14 09:33:44 UTC
Description of problem:
when installing openstack on redhat 7.0 beta  with dynamic ipv4 address , ssh-keygen fails .
 

07:15:01 ERROR : Failed to run remote script, stdout: 
07:15:01 stderr: + trap t ERR
07:15:01 + ssh-keygen -t rsa -b 2048 -f /var/tmp/packstack/20140514-011453-k9pyaJ/nova_migration_key -N ''
07:15:01 gethostname: File name too long
07:15:01 ++ t
07:15:01 ++ exit 1

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


How reproducible:
1. vm redhat 7.0  with dynamic ip address 
2. installing openstack with packstack 
3. fails on ssh-keygen with error :  gethostname: File name too long



Actual results:


Expected results:
ssh-keygen should not fail 

Additional info:

Comment 1 Pavel Šimerda (pavlix) 2014-05-14 09:51:44 UTC
As `gethostname()` is a libc library call, I'm switching the bug report to the glibc package.

Comment 3 Siddhesh Poyarekar 2014-05-15 06:31:04 UTC
gethostname tells it like it is - the hostname is longer than what the application anticipated (with its len argument).  The fix to this is to increase the buffer size passed to gethostname and repeat the call.

That is, it's not a bug in glibc.

Comment 4 Pavel Šimerda (pavlix) 2014-05-15 15:15:30 UTC
Thanks Siddhesh, (In reply to Siddhesh Poyarekar from comment #3)
> gethostname tells it like it is - the hostname is longer than what the
> application anticipated (with its len argument).  The fix to this is to
> increase the buffer size passed to gethostname and repeat the call.

True enough, thanks.

> That is, it's not a bug in glibc.

Moving to OpenSSH then, where the calling program resides.

Comment 5 Petr Lautrbach 2014-07-15 11:47:11 UTC
upstream patch https://bugzilla.mindrot.org/attachment.cgi?id=2448&action=diff

Comment 7 Stanislav Zidek 2014-09-03 13:41:19 UTC
According to my tests, this is more +-1 error than anything else. The problem is relevant only when the hostname is precisely 64 bytes long, in which case gethostname(lname, MAXHOSTNAMELEN) (where MAXHOSTNAMELEN is 64) can not accomodate terminating byte. (Well, the problem might be there for longer names but they are not allowed to be longer when I tested it with 'hostname' command.)

Anyway, the patch helps, I just wanted to note my findings.

Comment 10 Jakub Jelen 2015-01-31 19:27:16 UTC
*** Bug 1187689 has been marked as a duplicate of this bug. ***

Comment 12 errata-xmlrpc 2015-03-05 09:27:48 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, 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://rhn.redhat.com/errata/RHSA-2015-0425.html


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