Bug 402621 - xfs_info doesn't handle mountpoint with spaces
Summary: xfs_info doesn't handle mountpoint with spaces
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xfsprogs
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-28 13:12 UTC by Zdenek Kabelac
Modified: 2008-01-22 03:15 UTC (History)
0 users

Fixed In Version: xfsprogs-2.9.5-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-21 15:35:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Zdenek Kabelac 2007-11-28 13:12:38 UTC
Description of problem:

xfs_info command (and probably some others as well) do not handle properly
mountpoints that contains spaces

Version-Release number of selected component (if applicable):
xfsprogs-2.9.4-4.fc8

How reproducible:

Steps to Reproduce:
1. mkdir "/mnt/t 1"
2. mount /dev/xfs_device_xyz  /mnt/t\ 1
3. xfs_info /mnt/t\ 1
  
Actual results:
# xfs_info /mnt/t\ 1
Usage: xfs_info [-V] [-t mtab] mountpoint


Expected results:
correctly shown info for given mountpoint

Additional info:

Comment 1 Eric Sandeen 2007-11-28 15:36:33 UTC
xfs_info is just a bash script, and it's that which isn't coping.  The
underlying command, xfs_growfs, is fine.

I'm no good at bash scripting :) but this seems to work:

--- /usr/sbin/xfs_info	2007-11-28 09:14:02.000000000 -0600
+++ /usr/sbin/xfs_info.new	2007-11-28 09:21:49.000000000 -0600
@@ -16,10 +16,10 @@
 		;;
 	esac
 done
-set -- extra $@
+set -- extra "$@"
 shift $OPTIND
 case $# in
-	1)	xfs_growfs -p xfs_info -n $OPTS $1
+	1)	xfs_growfs -p xfs_info -n $OPTS "$1"
 		status=$?
 		;;
 	*)	echo $USAGE 1>&2


xfs_freeze has the same problem.


Comment 2 Eric Sandeen 2007-11-28 15:40:08 UTC
I take it back, freeze is fine.

Comment 3 Eric Sandeen 2007-11-30 04:49:03 UTC
Sent upstream

http://oss.sgi.com/archives/xfs/2007-11/msg00297.html

Comment 4 Zdenek Kabelac 2007-11-30 14:31:30 UTC
And what about these tools :

xfs_admin  xfs_check xfs_info xfs_metadump xfs_ncheck

I think they have similar problem when the $1 is passed without ""


Comment 5 Eric Sandeen 2007-11-30 15:10:56 UTC
xfs_info is covered already.

xfs_admin, xfs_check, xfs_metadump, and xfs_ncheck all take a device as an
argument.  I thought a mount point with a space was unlikely; a device with a
space seems even more so (though, I guess the "device" could be a fs-in-a-file
with a space in the name...)

I'm not overly concerned about it, but if you have a patch, then by all means
send it along :)

Comment 6 Eric Sandeen 2008-01-21 15:35:40 UTC
xfsprogs-2.9.5-1, building into rawhide now, fixes this.

I'll push to f8 and f7 as well.

Comment 7 Eric Sandeen 2008-01-22 03:15:35 UTC
pushed to f8 and f7 testing as well


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