Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151257 - eject incorrectly handles mount points with spaces in name
Summary: eject incorrectly handles mount points with spaces in name
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 158252 166825 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-13 21:20 UTC by Adam Goossens
Modified: 2012-08-18 05:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fixes space handling (eject-space-handling.patch,1.50 KB, patch)
2006-10-13 21:20 UTC, Adam Goossens
Details | Diff
eject-2.1.5-handle-spaces.patch (eject-2.1.5-handle-spaces.patch,1.89 KB, patch)
2006-10-14 13:24 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Goossens 2006-10-13 21:20:07 UTC
Mount points with spaces in the name (such as "/media/LEXAR MEDIA") are stored with spaces encoded within /etc/mtab and /proc/mounts (i.e., as /media/LEXAR\040MEDIA). eject simply extracts this mountpoint and passes it to pumount/pmount without decoding these characters. As such, it becomes equivalent to executing "pumount /media/LEXAR\040MEDIA" which will fail.

I've attached a patch - this was taken out of debian's patch set for eject.

Portage 2.1.1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r4, 2.6.17-gentoo-r7 i686)
=================================================================
System uname: 2.6.17-gentoo-r7 i686 AMD Athlon(tm) XP 2800+
Gentoo Base System version 1.12.5
Last Sync: Fri, 13 Oct 2006 01:00:08 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-march=i686 -O2 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.isp.net.au/ftp/pub/gentoo http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"
LINGUAS=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/gentopia"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac alsa apache2 apm asf berkdb bitmap-fonts cdr cli crypt cups dbus dlloader dri dvd eds elibc_glibc emboss encode esd foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 hal imlib input_devices_keyboard input_devices_mouse ipod ipv6 isdnlog jpeg kde kdeenablefinal kernel_linux libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre perl png pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev userland_GNU video_cards_nvidia vorbis win32codecs xinerama xml xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Adam Goossens 2006-10-13 21:20:41 UTC
Created attachment 99632 [details, diff]
fixes space handling
Comment 2 SpanKY gentoo-dev 2006-10-14 13:24:25 UTC
Created attachment 99676 [details, diff]
eject-2.1.5-handle-spaces.patch

i dont really like that Debian patch ... try this one instead
Comment 3 Adam Goossens 2006-10-14 20:25:51 UTC
Thanks - new patch works fine for me.
Comment 4 SpanKY gentoo-dev 2006-10-15 19:07:53 UTC
2.1.5-r1 in portage with patch
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-12-16 01:10:09 UTC
*** Bug 158252 has been marked as a duplicate of this bug. ***
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-02-14 13:40:16 UTC
*** Bug 166825 has been marked as a duplicate of this bug. ***
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-02-14 13:40:38 UTC
Reopen wrt Bug 166825 
Comment 8 Jan 2007-02-14 13:46:21 UTC
Relevant information from closed bug (thanks for re-opening Jakub):

The patch does not resolve the problem in my opinion.

De-mangling of the mount points must be done *before* the strcmp(), not
afterwards. Additionally, I would suggest testing for "\0nn" when looking for
an octal number rather than testing for "\nnn".

Suggested patch: http://bugs.gentoo.org/attachment.cgi?id=110163&action=view
Comment 9 Mike Gualtieri 2009-03-11 17:11:37 UTC
It looks like this bug is still around... just encountered it today.  The patch (http://bugs.gentoo.org/attachment.cgi?id=110163&action=view) mentioned by Jan seems to fix it for me.
Comment 10 PM 2012-07-01 15:20:08 UTC
So what's the status on this one? This bug is still here, 6 years after reporting.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2012-07-01 17:24:01 UTC
(In reply to comment #10)
> So what's the status on this one? This bug is still here, 6 years after
> reporting.

The status might be changed or chaging since eject moved to be part of sys-apps/util-linux starting from version >= 2.22

Trying to fix sys-apps/eject is a lost cause at this point, but if you can verify the bug in util-linux's version of eject, then we have chances of getting this fixed...
Comment 12 PM 2012-07-01 18:12:02 UTC
I tried building util-linux-9999 but it fails:

CCLD     test_blkid_cache
libblkid/src/test_blkid_cache-cache.o: In function `blkid_get_cache_filename':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:113: undefined reference to `safe_getenv'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:115: undefined reference to `blkid_strdup'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:117: undefined reference to `blkid_strdup'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:119: undefined reference to `blkid_read_config'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:125: undefined reference to `blkid_free_config'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:121: undefined reference to `blkid_strdup'
libblkid/src/test_blkid_cache-cache.o: In function `blkid_get_cache':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:162: undefined reference to `blkid_read_cache'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:158: undefined reference to `blkid_strdup'
libblkid/src/test_blkid_cache-cache.o: In function `blkid_put_cache':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:178: undefined reference to `blkid_flush_cache'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:188: undefined reference to `blkid_free_dev'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:203: undefined reference to `blkid_free_tag'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:205: undefined reference to `blkid_free_tag'
libblkid/src/test_blkid_cache-cache.o: In function `blkid_gc_cache':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/cache.c:233: undefined reference to `blkid_free_dev'
  CCLD     test_blkid_config
collect2: error: ld returned 1 exit status
make[2]: *** [test_blkid_cache] Błąd 1
make[2]: *** Oczekiwanie na niezakończone zadania....
libblkid/src/test_blkid_config-config.o: In function `parse_next':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:105: undefined reference to `blkid_debug_mask'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:99: undefined reference to `blkid_strdup'
libblkid/src/test_blkid_config-config.o: In function `parse_evaluate':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:53: undefined reference to `blkid_debug_mask'
libblkid/src/test_blkid_config-config.o: In function `parse_next':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:74: undefined reference to `blkid_debug_mask'
libblkid/src/test_blkid_config-config.o: In function `blkid_read_config':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:128: undefined reference to `blkid_debug_mask'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:139: undefined reference to `blkid_debug_mask'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:133: undefined reference to `blkid_debug_mask'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:119: undefined reference to `safe_getenv'
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:151: undefined reference to `blkid_strdup'
libblkid/src/test_blkid_config-config.o: In function `main':
/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999/libblkid/src/config.c:181: undefined reference to `blkid_init_debug'
collect2: error: ld returned 1 exit status
make[2]: *** [test_blkid_config] Błąd 1
make[2]: Opuszczenie katalogu `/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999'
make[1]: *** [all-recursive] Błąd 1
make[1]: Opuszczenie katalogu `/var/tmp/portage/sys-apps/util-linux-9999/work/util-linux-9999'
make: *** [all] Błąd 2
emake failed
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2012-07-01 18:35:20 UTC
(In reply to comment #12)
> I tried building util-linux-9999 but it fails:
> 

Unrelated to this ticket. Try to build a stable or ~arch version and not -9999
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2012-07-01 19:12:51 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > I tried building util-linux-9999 but it fails:
> > 
> 
> Unrelated to this ticket. Try to build a stable or ~arch version and not
> -9999

I agree, this bug should not be for resolving building errors with util-linux.
Separate bug, forums or IRC might be better suitable for such.

But I did ask him to test version above 2.22 :-)
Comment 15 PM 2012-07-01 20:48:19 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > I tried building util-linux-9999 but it fails:
> > 
> 
> Unrelated to this ticket. Try to build a stable or ~arch version and not
> -9999

There is no stable or ~arch >=util-linux-2.22
Comment 16 SpanKY gentoo-dev 2012-08-18 05:32:21 UTC
eject in util-linux seems to work fine for me

sudo mount /dev/cdrom '/media/a b'
sudo ./eject '/media/a b'
<works>

strace shows:
umount("/media/a b", 0)           = 0