Bug 617440
Summary: | guestfish: fails to tilde expand '~' when the $HOME env is unset | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Jinxin Zheng <jzheng> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 6.0 | CC: | dallan, llim, mbooth, virt-maint, yuzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.7.17-8.el6 | Doc Type: | Bug Fix |
Doc Text: |
If the $HOME variable was not set, guestfish did not expand a path containing "~" (tilde) into a path to the user's home directory. Guestfish now examines the current user's passwd file for the location of the user's home directory so that a path containing "~" can be expanded correctly.
Additionally, an off-by-one error was discovered in the same path-expansion algorithm. This error could potentially cause a crash. The off-by-one error has been corrected so that a crash is no longer possible. (BZ#617440)
|
Story Points: | --- |
Clone Of: | 617436 | Environment: | |
Last Closed: | 2011-05-19 11:45:27 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 617436 | ||
Bug Blocks: |
Description
Jinxin Zheng
2010-07-23 03:19:05 UTC
Upstream fix: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=7ce627fce02eae8c7db36b4090fa0ce1bf69bf44 Note that while I was fixing this I discovered an off-by-one bug in related code which should also be backported: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=a9802509184341e731de5c9af363184a9964a8a7 QA verified this bug with libguestfs-1.7.17-12.el6.x86_64 and
guestfish-1.7.17-12.el6.x86_64:
# unset HOME
# echo ~
/root
# guestfish
><fs> echo ~
/root
So change this bug to VERIFIED.
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: If the $HOME variable was not set, guestfish did not expand a path containing "~" (tilde) into a path to the user's home directory (/home/username by default). Guestfish now examines the current user's passwd file for the location of the user's home directory so that a path containing "~" can be expanded correctly. Additionally, an off-by-one error was discovered in the same path-expansion algorithm. This error could potentially cause a crash if the following command were attempted: echo 'echo ~root/foo' | guestfish The off-by-one error has been corrected so that a crash is no longer possible. (BZ#617440) Fixed. Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,7 +1,3 @@ -If the $HOME variable was not set, guestfish did not expand a path containing "~" (tilde) into a path to the user's home directory (/home/username by default). Guestfish now examines the current user's passwd file for the location of the user's home directory so that a path containing "~" can be expanded correctly. +If the $HOME variable was not set, guestfish did not expand a path containing "~" (tilde) into a path to the user's home directory. Guestfish now examines the current user's passwd file for the location of the user's home directory so that a path containing "~" can be expanded correctly. -Additionally, an off-by-one error was discovered in the same path-expansion algorithm. This error could potentially cause a crash if the following command were attempted: +Additionally, an off-by-one error was discovered in the same path-expansion algorithm. This error could potentially cause a crash. The off-by-one error has been corrected so that a crash is no longer possible. (BZ#617440)- -echo 'echo ~root/foo' | guestfish - -The off-by-one error has been corrected so that a crash is no longer possible. (BZ#617440) An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0586.html An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0586.html |