blkid: iso9660/Joliet label has extra spaces appended

Bug #446897 reported by tsultana
This bug report is a duplicate of:  Bug #432215: labels are 'padded' with spaces. Edit Remove
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: nautilus

My IronKey usb drive has the label "IronKey" in Jaunty but in Beta Karmic it is "IronKey ".

In nautilus when I right-click in Karmic to run the ironkey executable with gksu it does not work, but in Jaunty it correctly opens a terminal window to allow me to enter my password.

To run ironkey executable in Karmic from a terminal I must enter;

sudo /media/IronKey\ \ \ \ \ \ \ \ \ /linux/ironkey

for Jaunty it is;

sudo /media/IronKey/linux/ironkey

ProblemType: Bug
Architecture: i386
CheckboxSubmission: b35b06d4b174bc3c76c37c39a58931b1
CheckboxSystem: 0531969bcfd4f03af7405c98dc94a948
Date: Fri Oct 9 03:19:06 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/nautilus
LiveMediaBuild: Ubuntu 9.10 "Karmic Koala" - Beta i386 (20090929.2)
NonfreeKernelModules: nvidia
Package: nautilus 1:2.28.0-0ubuntu3
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.36-generic
SourcePackage: nautilus
Uname: Linux 2.6.31-11-generic i686

Revision history for this message
tsultana (tsultana) wrote :
affects: nautilus (Ubuntu) → devicekit-disks (Ubuntu)
Revision history for this message
Martin Pitt (pitti) wrote :

I checked hal, it doesn't seem to strip spaces from volume labels itself, so it must be something lower-level. Do you have the chance of testing something in jaunty and karmic, by running a live system from a CD for the release which you do not have installed?

  1. Plug in stick
  2. Check "mount" for the device file of this stick; it's the first value of the line with "IronKey", and should look like /dev/sda1 or /dev/sdb1.
  3. On Jaunty, copy&paste the output of

     sudo vol_id /dev/sda1

    (with the device file from above)

  4. On Karmic, copy&paste the output of

      sudo blkid /dev/sda1

Thanks!

Changed in devicekit-disks (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
importance: Medium → Low
Revision history for this message
tsultana (tsultana) wrote :

Jaunty results sudo vol_id /dev/sr1
ID_FS_USAGE=filesystem
ID_FS_TYPE=iso9660
ID_FS_VERSION=Joliet\x20Extension
ID_FS_UUID=
ID_FS_UUID_ENC=
ID_FS_LABEL=IronKey
ID_FS_LABEL_ENC=IronKey

Karmic Beta LiveCD results sudo blkid /dev/sr1
/dev/sr1: LABEL="IronKey " TYPE="iso9660"

Revision history for this message
tsultana (tsultana) wrote :
Martin Pitt (pitti)
affects: devicekit-disks (Ubuntu) → util-linux (Ubuntu)
Changed in util-linux (Ubuntu):
status: Incomplete → New
summary: - IronKey drive as extra spaces on the label
+ VFAT label has extra spaces appended
Changed in util-linux (Ubuntu):
status: New → Confirmed
summary: - VFAT label has extra spaces appended
+ iso9660 label has extra spaces appended
Revision history for this message
Martin Pitt (pitti) wrote : Re: iso9660 label has extra spaces appended

It does not happen for a couple of my CDs, so I can only guess that the iso actually has trailing spaces, which vol_id cut off, but blkid doesn't.

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, not easy to reproduce, though:

$ mkdir /tmp/x; cd /tmp/x
$ touch foo bar
$ mkisofs -o /tmp/test.iso -v -V "Name " *
$ blkid -p ../test.iso
../test.iso: LABEL="Name" TYPE="iso9660" USAGE="filesystem"

So this basic case seems to work.

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, "joliet extensions":

$ mkdir /tmp/x; cd /tmp/x
$ touch foo bar
$ mkisofs -o ../test.iso -v -J -V "Name " *
$ blkid -p ../test.iso
../test.iso: LABEL="Name " VERSION="Joliet Extension" TYPE="iso9660" USAGE="filesystem"
$ blkid ../test.iso
../test.iso: LABEL="Name " TYPE="iso9660"

It seems to be a regression in karmic, since in Jaunty I get the correct name:

$ LANG= dchroot -c jaunty -d blkid /tmp/test.iso
I: [jaunty chroot] Running command: "blkid /tmp/test.iso"
/tmp/test.iso: LABEL="Name" TYPE="iso9660"

summary: - iso9660 label has extra spaces appended
+ iso9660/Joliet label has extra spaces appended
Changed in util-linux (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Martin Pitt (pitti) wrote : Re: iso9660/Joliet label has extra spaces appended

Oops, in my previous test I didn't actually supply a space to the name in mkisofs any more. So blkid really adds spaces which weren't given in the first place. The blkid output actually has about ten spaces appended, Launchpad just shamelessly ate most of them.

summary: - iso9660/Joliet label has extra spaces appended
+ blkid: iso9660/Joliet label has extra spaces appended
tags: added: regression-potential
Revision history for this message
Martin Pitt (pitti) wrote :

So the old udev's prober called volume_id_set_label_string() for all file system types, which stripped trailing whitespace.

In blkid, ./shlibs/blkid/src/probe.c blkid_probe_set_label() and ./shlibs/blkid/src/encode.c blkid_safe_string() do the same. But ./shlibs/blkid/src/probers/iso9660.c probe_iso9660() only calls blkid_probe_set_label() for non-Joliet, for Joliet it uses blkid_probe_set_utf8label().

So for consistency, blkid_probe_set_utf8label() should skip trailing spaces as well. Alternatively, spaces need to be stripped in probe_iso9660() directly.

Revision history for this message
Martin Pitt (pitti) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.