Bug 572301

Summary: libguestfs-supermin-helper fails if 'ls' is an exported function
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.0.86 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-27 09:43:15 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:

Description Richard W.M. Jones 2010-03-10 19:35:08 UTC
Description of problem:

The libguestfs-supermin-helper command is a /bin/bash script
and runs plain 'ls'.  Unfortunately this fails quite badly
if 'ls' has been redefined as an exported shell function.

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

libguestfs 1.0.85

How reproducible:

Always.

Steps to Reproduce:
1. Redefine function:

 ls ()
 {
   /bin/ls -F "$@"
 }

2. export -f ls
3. Run any libguestfs command, eg. guestfish or
 libguestfs-test-tool
  
Actual results:

Fails if the redefined 'ls' output isn't exactly
like the ordinary 'ls' output.

Expected results:

Should not be affected like this.

Additional info:

Comment 1 Richard W.M. Jones 2010-03-10 19:36:03 UTC
You'll see lots of error messages like this:

cpio: ./sbin/fsck.gfs2*: Cannot stat: No such file or directory
cpio: ./sbin/mkfs.gfs2*: Cannot stat: No such file or directory
cpio: ./sbin/mount.gfs2*: Cannot stat: No such file or directory
cpio: ./sbin/dracut*: Cannot stat: No such file or directory
cpio: ./sbin/lsinitrd*: Cannot stat: No such file or directory
cpio: ./sbin/mkinitrd*: Cannot stat: No such file or directory

Notice the asterisk that appears after each command
(because of the ls -F option).

Comment 2 Richard W.M. Jones 2010-03-27 09:43:15 UTC
libguestfs-supermin-helper was rewritten[1] as a C program
in 1.0.86, effectively making this bug obsolete.

[1] http://git.annexia.org/?p=libguestfs.git;a=commit;h=cb9613b993792c1c4b14fa0d9b5001ff644ac2f4