Bug 402621 - xfs_info doesn't handle mountpoint with spaces
xfs_info doesn't handle mountpoint with spaces
Product: Fedora
Classification: Fedora
Component: xfsprogs (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-11-28 08:12 EST by Zdenek Kabelac
Modified: 2008-01-21 22:15 EST (History)
0 users

See Also:
Fixed In Version: xfsprogs-2.9.5-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-21 10:35:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Zdenek Kabelac 2007-11-28 08:12:38 EST
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):

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 10:36:33 EST
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 @@
-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"
 	*)	echo $USAGE 1>&2

xfs_freeze has the same problem.
Comment 2 Eric Sandeen 2007-11-28 10:40:08 EST
I take it back, freeze is fine.
Comment 3 Eric Sandeen 2007-11-29 23:49:03 EST
Sent upstream

Comment 4 Zdenek Kabelac 2007-11-30 09:31:30 EST
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 10:10:56 EST
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 10:35:40 EST
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-21 22:15:35 EST
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.