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 711445 - LVM vgcreate fails if hostname is invalid
Summary: LVM vgcreate fails if hostname is invalid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.0
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Rajnoha
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-07 14:27 UTC by Frank Lin PIAT
Modified: 2011-12-06 16:57 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.86-1.el6
Doc Type: Bug Fix
Doc Text:
A hostname containing '/' character caused LVM commands to fail while generating an archive of current metadata. Since the hostname is part of the temporary archive filename, we ended up with a file path that was ambiguous and it caused the whole archive operation to fail. To fix this, we replace any '/' character with '?' character in the hostname string and then we use it to compose the temporary archive filename.
Clone Of:
Environment:
Last Closed: 2011-12-06 16:57:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1522 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2011-12-06 00:50:10 UTC

Description Frank Lin PIAT 2011-06-07 14:27:08 UTC
Description of problem:

LVM will fail to create volumegroup if the hostname contains invalid caracter (especialy a slash)

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


How reproducible:

Yes, it is reproducible.

Steps to Reproduce:
1. change hostname to something invalid, for example, execute:
   hostname foo/bar
2. Try creating a VG, for example, execute
   lvm vgcreate TEST /dev/sdd9
  
Actual results:

% lvm vgcreate TESTVG /dev/sdd9
Couldn't create temporary archive name.
Volume group "TESTVG" metadata archive failed.


Expected results:

a more explicit error message.

Additional info:
This problem occured while doing automatic kickstart deployment with anaconda.

Comment 2 Peter Rajnoha 2011-06-07 14:44:43 UTC
Well, we definitely need to escape such characters.

Comment 3 Peter Rajnoha 2011-06-08 08:56:44 UTC
OK, this is only a temporary file name creation. Also, we can't set the hostname containing '/' with recent versions of the 'hostname' command (I don't know the exact version, but the Fedora rawhide version if 'hostname' already checks that). Though we can still set it directly using 'sethostname' from unistd.h.

Since this is really a corner case, I think we don't need any complex escape sequences here. We'll simply replace the '/' with '?'. Patch is upstream now (v2.02.86).

Comment 4 Peter Rajnoha 2011-06-08 11:50:09 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A hostname containing '/' character caused LVM commands to fail while generating an archive of current metadata. Since the hostname is part of the temporary archive filename, we ended up with a file path that was ambiguous and it caused the whole archive operation to fail. To fix this, we replace any '/' character with '?' character in the hostname string and then we use it to compose the temporary archive filename.

Comment 5 Corey Marthaler 2011-06-09 14:21:53 UTC
Adding QA ack for 6.2.

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.

Comment 7 Corey Marthaler 2011-09-08 20:18:04 UTC
Fixed verified in the latest rpms.

[root@grant-01 ~]# hostname foo/bar

[root@foo/bar ~]#  vgcreate TEST /dev/sd[bc][12]
  Volume group "TEST" successfully created

2.6.32-193.el6.x86_64

lvm2-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
lvm2-libs-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
lvm2-cluster-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
udev-147-2.37.el6    BUILT: Wed Aug 10 07:48:15 CDT 2011
device-mapper-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-libs-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-event-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-event-libs-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
cmirror-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011

Comment 8 errata-xmlrpc 2011-12-06 16:57:02 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.

http://rhn.redhat.com/errata/RHBA-2011-1522.html


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