labels are 'padded' with spaces

Bug #432215 reported by Maxim Levitsky
114
This bug affects 29 people
Affects Status Importance Assigned to Milestone
Util-Linux-ng
Fix Released
Undecided
auto-util-linux-ng
util-linux (Ubuntu)
Fix Released
Medium
Scott James Remnant (Canonical)

Bug Description

Every cdrom/dvd that has short label or no label is padded.

I get something like that "CDROM "

maxim@maxim-laptop:~$ sudo /sbin/blkid -o udev -p /dev/sr0
ID_FS_LABEL=CDROM
ID_FS_LABEL_ENC=CDROM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_FS_VERSION=Joliet\x20Extension
ID_FS_TYPE=iso9660
ID_FS_USAGE=filesystem

I belive blkid is part of udev

Related branches

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

no, its part of util-linux

affects: udev (Ubuntu) → util-linux (Ubuntu)
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

I sent a patch to fix this issue to util-linux mailing list

Changed in util-linux (Ubuntu):
assignee: nobody → Maxim Levitsky (maximlevitsky)
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

A modified version of this patch committed upstream, please update the package

Changed in util-linux:
status: New → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

I saw, thanks.

I do plan to update util-linux but this may wait until after beta

Changed in util-linux (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Though it looks like Karel applied this fix to trunk, which has a near-rewrite of blkid, so it may not be trivial to backport :-(

Changed in util-linux (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This will have to wait until lynx when we update blkid to 2.17

Changed in util-linux (Ubuntu):
status: In Progress → Triaged
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

And every user of karamic will be greeted with damaged and truncated cdrom labels?

If you insist, I backport this myself...

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

Here is port for fixes for this and another related bug.
(Joiliet label was used even if was same as normal label, but joliet label can be truncated)

I hope now there is no problem to fix this

Pathes against debian git repostry, pulled today.
Compile and run tested (blkid library)

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

I jumped the gun it seems.
Here are updated series.

This time I compiled the package fully, and installed, the libblkid1_2.16-3_amd64.deb

Last patch in this series is a hack I had to do to make it compile. It isn't caused by these backported patches, so take a look.

I haven't written a changelog for these patches since they are loosely based on the original, I skipped few hunks that apply to code that isn't in this tree, few comments, etc...

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

+1

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

Will this ever be included?

Changed in util-linux (Ubuntu):
assignee: Maxim Levitsky (maximlevitsky) → Scott James Remnant (scott)
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 432215] Re: cdrom labels are 'padded' with spaces

On Sun, 2009-10-04 at 14:04 +0000, Maxim Levitsky wrote:

> Will this ever be included?
>
See my comment above.

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote : Re: cdrom labels are 'padded' with spaces

What comment.
The patches I have posted are backported on top of blkid that ubuntu uses!

What the problem to use that?

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

And I just tested that all these patches apply cleanly to ubuntu package (obtained by apt-get source util-linux)

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 432215] Re: cdrom labels are 'padded' with spaces

On Mon, 2009-10-05 at 21:17 +0000, Maxim Levitsky wrote:

> What comment.
> The patches I have posted are backported on top of blkid that ubuntu uses!
>
> What the problem to use that?
>
We have no further opportunity to test them before release, so they may
introduce regressions.

It's better to ship with a known relatively minor bug than potentially
introduce a major regression.

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote : Re: cdrom labels are 'padded' with spaces

I don't think that there is much potential for regression with these patches.

Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

Besides, _this_ is a regression, and the one everyone will see

Revision history for this message
LaMont Jones (lamont) wrote :

Fixed upstream, post 2.16.1. This will therefore land in lucid when we merge forward.

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

I just analyzed this all over again in bug 446897 (now a duplicate). This has a very easy test case:

$ 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"

summary: - cdrom labels are 'padded' with spaces
+ labels are 'padded' with spaces
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

I think that this bug can be fixed now, and not in next ubuntu version.

This might be not such big bug, but it will affect very many users.

Revision history for this message
Stefan Neis (stefan-neis) wrote :

I just want to express my support for Maxim Levitsky's position that this should be fixed now:
We (i.e. the company I'm working for) are distributing software that is installed on a USB stick and, unfortunately, the Linux (auto-)start scripts don't handle trailing whitespace in the volume label (or rather in the mount path that's automagically generated from it). I have no idea, what percentage of the end customers of our cross-platform product is actually using Linux (and how many of those are actually using Ubuntu), but having to warn all customers "Well, if you upgrade to the upcoming Ubuntu release, you'll always have to manually unmount the automatically mounted USB device and remount it to a path without trailing spaces prior to starting the application" is going to be bad publicity for everyone involved.
Thanks for your attention.

Revision history for this message
notaclou (ibu01b) wrote :

apropos minor bug. all the mobile-modem and netbook users will be stuck because their usb-stick with smartcard wants to mount as cd-rom.
..houston we've got a problem ,we're cut off .
  give it a try or make yourself many friends wirh the supportteams

thanks for your work anyway
 ..

Revision history for this message
gabriela (salvie) wrote :

Please fix that bug very soon. It affects some USB sticks that are used for internet banking. For us this bug is not "minor".

Regards
gabriela

Revision history for this message
Fritz Zaucker (fritz-zaucker) wrote :

This bug might make me go back to Jaunty. It's a shame that a known issue with an apparently simple and already known solution is not being fixed. I'd like to hear your comments if MS would do something like that (wait a few months until we release the next service pack ...).

Cheers,
Fritz

Revision history for this message
Paede (patrick-steiner-gmx) wrote :

In Debian testing and unstable, bug already fixed (Sat, 10 Oct 2009 19:29:39 -0600):

http://packages.debian.org/changelogs/pool/main/u/util-linux/util-linux_2.16.1-4/changelog

   [Karel Zak]

   * libblkid: fix blkid_probe_set_utf8label() call for Joliet
   * libblkid: trim tailing whitespace from unicode LABELs. LP: #432215
   * libblkid: prefer ISO9660 PVD Label to Joliet Label

Whats the plan for this bug in Ubuntu? How low should we wait until this really annoying bug is fixed.

Revision history for this message
André Barmasse (barmassus) wrote :

This bug is rather bad for Swiss people using Ubuntu and having a bank account at the «Migrosbank». About a year ago they have released a kind of high security USB stick to access the personal bank account over the internet. This stick has worked quite well - the only thing needed was manualy set access to the usb subsystem in /lib/udev/rules.d/50-udev-default.rules to 666.

After a fresh installation of Ubuntu Karmic Koala the usb stick has stopped working. I am not quite sure if this has something to do with an earlier update of the software on the stick or with the here mentioned blkid of the packet util-linux. The only thing that is quite sure is the fact, that Ubuntu 9.10 mounts the usb stick under /media/M-Identity - followed by six (sic!) whitespaces.

A closer look on the usb stick reveals that there are two device entries on the stick itself: ID_FS_LABEL (M-IDentity) and ID_FS_LABEL_ENC (also M-Identity, but with the additional six whitespaces). Therefore, it seems that Ubuntu 9.10 is not mounting the first correct entry, but the second wrong one.

The best workaround for the moment seems to be a small script, that unmounts the usb stick, kills the six whitespaces with «sed», and remounts it. Anyway, it would be nice if either the people at Kobil (developpers of the M-Identiy usb stick) or at Ubuntu could take again a closer look at their software to remove that bug ...

Keep up the good work!

------------ M-identity-Script ------------------

#!/bin/sh
MOUNTPOINT=/media/M-IDentity
DEVHANDLE=$(mount | grep "/media/M-IDentity" | awk -v FS=" " '{print $1}')
OPTIONS=$(mount | grep /media/M-IDentity | awk -v FS="(" '{print $2}' | sed "s/)//")
umount $MOUNTPOINT*
mkdir /media/M-IDentity
mount -t iso9660 $DEVHANDLE $MOUNTPOINT -o $OPTIONS

Revision history for this message
Paede (patrick-steiner-gmx) wrote :

it is the same bug (same reason why it not works), therefore i have merged the other bug with this one. i have also a m-identity usb stick from migrosbank which not work.

Revision history for this message
lugipfupf (lugi-lugipfupf) wrote :

The swiss Valiant Bank just switched to the same system lately, more are planning to do it. So the amount of affected users is about to grow.

Revision history for this message
madbiologist (me-again) wrote :

@Maxim: If you are still following this bug report, you might want to consider making a PPA with your fix and providing a link to it here.

Revision history for this message
Stefan Neis (stefan-neis) wrote :

@Scott: I assumed by your comment (#6) this would be fixed in "Lucid Lynx", but Alpha1 still seems to contain that same bug. Any hope for getting the fix at least in Alpha2?

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 432215] Re: labels are 'padded' with spaces

On Mon, 2010-01-04 at 17:14 +0000, Stefan Neis wrote:

> @Scott: I assumed by your comment (#6) this would be fixed in "Lucid
> Lynx", but Alpha1 still seems to contain that same bug. Any hope for
> getting the fix at least in Alpha2?
>
Still waiting for util-linux 2.17, if that comes out this week there is
hope - otherwise no. It'll be Alpha3 at the earliest.

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
André Barmasse (barmassus) wrote :

Just upgraded to Ubuntu Lucid Lynx Alpha 2 and my Migrosbank M-IDentity usb stick does not work anymore - once again! Neither the script mentioned above nor another suggested solution with a symbolic link in /media (sudo ln -s 'M-IDentity ' ./M-IDentity) help to talk this piece of crap into working again. Tested with and without HAL (as in Lucid Lynx HAL will be deprecated) and with permissions in /lib/udev/rules/50-udev-default.rules set to 666 and even 777. Klicking on the programm shows at least some flickering of the led on the stick, but then nothing happens - no error message, not even a tiny, nothing! Well, I think I am gonna have to change my bank, otherwise I will have to to my bank buisinesses on a Windows machine somewhere at work - which actually cannot be the point of having 24/7 online banking ... Damn!!!

Revision history for this message
GM_Ubuntu (gilles-mulon) wrote :
Download full text (3.5 KiB)

Hello

Here is a step by step workaround for André Barmasse and other swiss users - like me - who cannot use their Kobil M-Identity USB device on Ubuntu since Karmic. Please note : I have NOT tested this on Lucid. However it works on Karmic.

First, make sure your Kobil device is not plugged in.

Step 1 : Create a rule file suitable for the Kobil M-IDentity device

The Migros Bank suggest on their website to change the default udev rule.
Although this would probably work, I find it pretty risky as it will grant read/write priviledges to everyone for devices matching the default rule.
Instead I suggest to create a specific rule for the Kobil device and insert it in /etc/udev/user.rules as shown below

-> sudo gedit /etc/udev/user.rules

Then in the editor, copy and paste the following lines :

#######################################################
BUS!="usb", ACTION!="add", SUBSYSTEM!="usb_device", GOTO="user_rules_end"

# Kobil mIDentity XL USB
SYSFS{idVendor}=="0d46", SYSFS{idProduct}=="4081", MODE="666", GROUP="plugdev"

LABEL="user_rules_end"
#######################################################

Save the file and close gedit

Restart udev (-> sudo service udev restart) or simply reboot your computer.

---------------------------------------------------------------------

Step 2 - Create a valid persistent mount point for the Kobil device
In a terminal, type :

-> sudo mkdir /media/M-IDentity

----------------------------------------------------------------------

Step 3 - Check if the device is "seen" by Ubuntu
Plug the Kobil device and wait a few seconds.
If a window containing the Kobil files pops up after pluging the device, just close it.
In a terminal, type :

-> dmesg

You should see something like :

................................
[ 4919.751556] generic-usb 0003:0D46:4081.0009: hiddev96,hidraw2: USB HID v1.00 Device [KOBIL Systems mIDentity XL] on usb-0000:00:04.0-1/input1
[ 4924.742426] usb-storage: device scan complete
[ 4924.749361] scsi 15:0:0:0: CD-ROM KOBIL mIDentity 0001 PQ: 0 ANSI: 0
[ 4925.085346] sr1: scsi3-mmc drive: 11x/59x writer cd/rw caddy
[ 4925.085590] sr 15:0:0:0: Attached scsi CD-ROM sr1
[ 4925.085724] sr 15:0:0:0: Attached scsi generic sg2 type 5
[ 4925.751348] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 4925.786328] ISO 9660 Extensions: RRIP_1991A
................................

Note the device name assigned by the system to the Kobil device. In this example : sr1

----------------------------------------------------------------------------------------

Step 4 - The Kobil device should have been mounted automatically. Check this and unmount it.

In a terminal type :

-> mount | grep '/dev/srX'
(where srX should be replaced by the device name found at step 2)

You should get something like :
/dev/srX on /media/M-IDentity type iso9660 (ro,nosuid,nodev,uhelper=devkit,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500)

Unmount the device by typing :
-> sudo unmount /dev/srX

Finally mount the device on the mountpoint created at step 2 above :
-> mount /dev/srX /media/M-IDentity

You should now be able to open the shortcut "M-IDentity" and double-click on the executable ...

Read more...

Revision history for this message
GM_Ubuntu (gilles-mulon) wrote :

ahem .... there are a few typoes in my Step 4 above. Sorry about that !

...........................

where srX should be replaced by the device name found at step 3)

...........................

Finally mount the device on the mountpoint created at step 2 above :
-> sudo mount /dev/srX /media/M-IDentity
...........................

Cheers

Revision history for this message
turtok187 (turtok) wrote :

We were able to compile the util-linux-ng 2.17 into Karmic Koala and it seems that the problem with the spaces in the label is solved. We tested also with a Kobil device.
Hopefully the tools will make the way into the next beta!

Release Note:
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-ReleaseNotes

Tarballs:
Index von ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/

regards

Revision history for this message
Paede (patrick-steiner-gmx) wrote :

It looks that the new 2.17 version is landed on Lucid. Can somebody test if this bug is solved in Lucid?

https://launchpad.net/ubuntu/lucid/+source/util-linux

Changed in util-linux (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Maxim Levitsky (maximlevitsky) wrote :

This was fixed in util-linux-ng long long ago

Changed in util-linux-ng:
status: Fix Committed → Fix Released
Revision history for this message
André Barmasse (barmassus) wrote :
Download full text (3.8 KiB)

Today I upgrade to the Lucid Lynx release candidate and I was very happy to see that the problem with the spaces in the mounted M-IDentity usb stick are gone. Great work, Ubuntu team! Therefore the following bugs can be closed:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/432215
https://bugs.launchpad.net/ubuntu/+source/hal/+bug/468927

On the smelly side of it I was rather not surprised that Kobil's M-IDentity software does not start up at all - again!! So I edited /lib/udev/rules.d/50-udev-default.rules as described on the website of Migrosbank for Ubuntu 9.10 (http://www.migrosbank.ch/de/MBancNet/MIDentity/faq_linuxkonf.htm?popup=) and changed the value of the usb subsystem from 664 to 666.

After rebooting the computer nothing happens - except for the same old crappy error message saying that there is a problem with access rights on the usb device.

Then I found a tip from Stephan Schwerzmann from november 2008 (http://markmail.org/message/3szbsxyya7xj2xkm), saying that you should not change the rules directly in /lib/udev/rules.d/50-udev-default.rules, but create a separate udev rule for the M-IDentity device. A very good point! He proposed to create a file /etc/udev/rules.d/45-midentity-permissions.rules and put the following content in it:

SUBSYSTEM=="block", ATTR{vendor}=="KOBIL", ATTR{model}=="mIDentity", GROUP="plugdev"

After rebooting the computer nothing happens - except for the same old crappy error message saying that there is a problem with access rights on the usb device.

Therefore, I gave the well explained workaround of GM_Ubuntu (see above) a shot. I had my concerns that putting a personal udev rule into /etc/udev/user.rules is really the right way in Lucid Lynx? But I tried it that way and also with putting it under /lib/udev/ and /lib/udev/rules.d/. The content of the file user.rules was the following:

BUS!="usb", ACTION!="add", SUBSYSTEM!="usb_device", GOTO="user_rules_end"
SYSFS{idVendor}=="0d46", SYSFS{idProduct}=="4081", MODE="666", GROUP="plugdev"
LABEL="user_rules_end"

After rebooting the computer nothing happens - except for the same old crappy error message saying that there is a problem with access rights on the usb device.

Finally, I thought that at least at Kobil's website there should be solution for this problem. There is a FAQ for the M-IDentity device, where you can read that "KOBIL mIDentity supports Windows 2000 (min. Service Pack 3), Windows XP (min. Service Pack 1) and Windows 2003 Server (since Version 1.1.4)" (https://www.kobil.com/en/support/faqs/midentity/supported-operating-systems.html) and a PDF in German that offers solution approaches if the software does not start under Windows XP and Windows Vista (https://www.kobil.com/de/support/faqs/midentity/nach-dem-einstecken-des-kobil-mdentity-startet-die-datensafe-anwendung-nicht.html). As a linux user you start to get the feeling that the linux help offered by Kobil is rather FUCK that FAQ.

But, isn't there something written about linux support in the front page advertisement of the great Kobil M-IDentity device? Of course!! There it is: "User-friendliness and security are the principal concerns of KOBIL. The user simply inserts...

Read more...

Revision history for this message
GM_Ubuntu (gilles-mulon) wrote :

Unfortunately I can only agree with André Barmasse : I have just upgraded my computer from 9.10 to 10.04. The good news is, the label "M-IDentity" is not padded with spaces anymore, so the mountpoint does not contain spaces. From that point of view, the bug is indeed fixed with 10.04.

The bad news is, as mentioned by M. Barmasse, the piece of software embedded in the Kobil dongle now crashes after a while, complaining about permissions. It actually requires write access to the Kobil device and since the upgrade to 10.04, something prevents it. The same error happens even when run as root.

For information :
- the device file (/dev/sr1 on my computer) has read/write permissions for everyone
- the mountpoint has no write access for anyone and there is no way to change this with chmod, even as root.

I guess it is an issue either with Hal or Udev, but I have no clue whatsoever. Creating an Udev rule for that device does not help either.

I really have concerns here because it gets worse as new versions of Ubuntu get released. It used to work almost flawlessly with 9.04 by creating a specific Udev rule for the Kobil dongle, once for all. Then 9.10 introduced the "label padded with spaces" issue. So I found the simple workaround to unmount the device manually and mount it again on a correctly formed moint point. At least it used to work. Now with 10.04 nothing works anymore. It is very disappointing.

I used to be an enthusiastic fan of Linux. Now I have to consider re.installing the crap Windoz, just because I cannot use my netbanking anymore. Shame !

Of course I am happy to provide more information to anyone who could help. I am going to create a new bug for this anyway.

Revision history for this message
gabriela (salvie) wrote :

Yeah, same story over and over again. Soon after one bug has been fixed or a community workaround has been found, the device (or Ubuntu?) fails again. I've upgraded from 9.10 64bit to 10.04 64bit. It happens here exactly the same way as you (André Barmasse and GM_Ubuntu) describe it in msg #38 and #39.

Did anyone spot the buggy module? And how do we proceed? @GM_Ubuntu: Can you unveil the new bug ID for I can sign in? As 10.04 is supposed to be an LTS release, I really hope this one will be fixed soon - and fixed for good.

Revision history for this message
gabriela (salvie) wrote :

oh, sry, found it, bug ID #573690.

Revision history for this message
André Barmasse (barmassus) wrote :

As the padding problem has been solved a long time ago, there is no need to continue the debate about the Kobil M-IDentity stick here. Luckily (or rather of necessity) someone has opened a specific bug report about that piece of rubbish here:

https://bugs.launchpad.net/ubuntu/+source/hal/+bug/573690

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

  • auto-util-linux-ng Edit

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