could not compile regex

Bug #49655 reported by Edmund Laugasson on 2006-06-14
4
Affects Status Importance Assigned to Milestone
pmount (Ubuntu)
Medium
Martin Pitt

Bug Description

Binary package hint: pmount

Perhaps is not only pmount package involved - there may be also dbus and hal and perhaps something more be involved. But if to read error message, then it says that pmount has the problem.

Reproduce:

1. Install Xubuntu 6.06 LTS from alternate ISO
2. Do all upgrades until 13th of June 2006 mid day (12:00 PM)
3. Plug in USB memory stick. You will see icon on desktop and from mouse right click menu you may see, that this is not mounted, because there is mount command available. Also if you use terminal and type 'sudo mount' without quotes, then you may see - no /dev/sd* device is not mounted.
I had USB 1.1 controller and Kingston Data Traveler I USB memory stick, which is also capable for USB 2.0.
The PC was with Intel motherboard with i810 chipset and CPU was 400MHz Intel Celeron and RAM were 128MB SDRAM, HDD was 10GB. So it's quite old PC and therefore I were happy, when Xubuntu (Ubuntu+XFCE) came out :)
4. Try to mount by choosing 'mount' command from mouse right click menu - it failes (as regular user) and gives pop-up window with message:

Internal error: device_whitelisted(): could not compile regex: Invalid range end
Error: could not execute pmount

Pleas look also the screenshot (PNG format picture) attached to this bug report.

I read ubuntuforums.org and mentioned, that this is not first time, when it appears - people have problem with it and some of them could somehow solve it but I did not. I tried to install gnome-volume-manager - it also installed me bunch of other Gnome stuff, which wasted a lot of disk space. I tried to run this gnome-volume-manager in background as teached in forum and tried to do it as regular user and as root - no result. I tried also restart XFCE - I logged out and then back in and tried again gnome volume manager in all ways - no result.

Then I tried to use ivman as teached in ubuntuforums.org - also no effect :(

Tried to install additional package called hal-device-manager but no effect. I just thought, that perhaps it could not create device.

Then I used command:
tail -f /var/log/messages

... and it shows properly, that /dev/sdb appeared and I even could mount and unmount it manually as root.
I just installed also BUM (Boot Up Manager) and mentioned, that makedev were not working even I saw, that makedev is installed. But as /var/log/messages showed - device has been created.

Also one case was, where people reinstalled dbus, hal and pmount but I already had those programs as newest versions...

This was the worst thing I ever afraid - USB will not work! Uuuhh.. I use a lot of USB-devices...

In Ubuntu 5.10 USB worked like a charm and I even wrote couple of articles in local computer magazine here in Estonia and I made couple of compliments, that USB is working in Ubuntu like a charm - I tried to connect simultaneously a lot of different USB-devices (USB-webcam, USB-memory stick, USB-FDD, USB CD Writer, USB Wacom drawing table, USB flash card reader, USB to IDE HDD) and all of them worked like a charm... I've never seen such a great USB work under Linux and I were really impressed. My Linux experience has been began from year 2000 and since this time I did not see such a great Linux distro.
I installed Edubuntu 5.10 to computer class room and pupils were also happy with this!

So - it would be big thing, if USB can work again :)

Edmund Laugasson (ed-lau) wrote :

Here is the screenshot, where is shown the error message if you try to mount USB memory stick under Xubuntu 6.06 LTS.
The picture is in PNG format made by Gimp.

description: updated
Edmund Laugasson (ed-lau) wrote :

Here is the description of my installed packages (which are probably involved), where this bug appeared.

$ sudo dpkg -l pmount
Password:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================-==================-====================================================
ii pmount 0.9.11-1 mount removable devices as normal user

$ sudo dpkg -l hal
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================-==================-====================================================
ii hal 0.5.7-1ubuntu18 Hardware Abstraction Layer

$ sudo dpkg -l dbus
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================-==================-====================================================
ii dbus 0.60-6ubuntu8 simple interprocess messaging system

$ sudo dpkg -l hal-device-manager
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================-==================-====================================================
ii hal-device-manager 0.5.7-1ubuntu18 Hardware Abstraction Layer user interface

Juan Jose Pablos (cheche) wrote :

usb seems to work fine with the live CD. But if you installed on the system, the behaviour changed.

Edmund Laugasson (ed-lau) wrote :

Found this address:
https://launchpad.net/distros/ubuntu/+source/pmount/+bug/18516

there is written:
----------------------
After reviewing pmount source code, I found this code snippet at policy.c:399:

    fwl = fopen( WHITELIST, "r" );
    if( !fwl )
        return 0;

    if( regcomp( &re, "^[[:space:]]*([a-zA-Z0-9/_+\\-\\.]+)[[:space:]]*(#.*)?$",
REG_EXTENDED ) ) {
        fprintf( stderr, "Internal error: device_whitelisted(): could not
compile regex\n" );
        exit( -1 );
    }

Hmm...

After I delete /etc/pmount.allow, I re-insert USB flash,
and gnome-volume-manager & pmount works properly.

Or, below code should be replaced with it:

  exit(-1); -> fclose(fwl); return 0;
----------------------

It seems like there are some locale problems. I use Estonian locale, which passes also utf8 but official codepage is ISO 8859-15. But utf8 does the job also very well.

So - my question is - why is pmount source code still not corrected?! And Ubuntu (and other branches) are called "enterprise ready"? Or is it U.S. enterprise ready and not other countries?

Martin Pitt (pitti) wrote :

Ah, the hint with 'Estonian' was helpful. I tried to reproduce it long ago without any success. With et_EE locale I get the error, too.

Changed in pmount:
assignee: nobody → pitti
importance: Untriaged → Medium
status: Unconfirmed → In Progress

debdiff for dapper-updates

Martin Pitt (pitti) wrote :

Matt, can you please approve the attached debdiff for dapper-updates? Thank you!

Changed in pmount:
status: In Progress → Fix Committed
Matt Zimmerman (mdz) wrote :

OK for dapper-updates

Martin Pitt (pitti) wrote :

Package was just released to dapper-updates.

Changed in pmount:
status: Fix Committed → Fix Released
Edmund Laugasson (ed-lau) wrote :

Yes, thanks for it!

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

Other bug subscribers