You are not logged in.

#1 2009-05-10 03:58:51

xchllataa
Member
Registered: 2008-01-24
Posts: 12

HAL, ntfs-3g and uid option

Hello,

I just upgraded hal (0.5.11-4 -> 0.5.12git20090421.4fc367-2) and ntfs-3g (2009.2.1-1 -> 2009.4.4-1) and got this problem with my NTFS volumes. GNOME refuses to mount a volume and displays the message "Cannot mount volume. Invalid mount option when attempting to mount the volume 'XXX'".

Here is my /etc/PolicyKit/PolicyKit.conf

<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
    
    <match user="xchllataa">
        <match action="org.freedesktop.hal.storage.*">
            <return result="yes"/>
        </match>
        <match action="hal-storage-mount-fixed-extra-options">
            <return result="yes" />
        </match>
        <match action="hal-storage-mount-removable-extra-options">
            <return result="yes" />
        </match>
    </match>

</config>

and /etc/hal/fdi/policy/20-ntfs-config-write-policy.fdi

<?xml version="1.0" encoding="UTF-8"?> 
<deviceinfo version="0.2">
   <device>
       <match key="volume.fstype" string="ntfs">
           <merge key="volume.fstype" type="string">ntfs-3g</merge>
           <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
           <append key="volume.mount.valid_options" type="strlist">locale=</append>
           <append key="volume.mount.valid_options" type="strlist">dmask=</append>
           <append key="volume.mount.valid_options" type="strlist">fmask=</append>
           <append key="volume.mount.valid_options" type="strlist">uid=</append>
       </match>
   </device>
</deviceinfo>

The gconf key /system/storage/default_options/ntfs-3g/mount_options is 'locale=,fmask=0113,dmask=0002,uid='.

If I remove the uid option from the gconf key, GNOME mounts an NTFS volume just fine, but it does not work with the uid option.

How can I fix this problem?

Thanks.

Offline

#2 2009-05-10 04:08:24

xchllataa
Member
Registered: 2008-01-24
Posts: 12

Re: HAL, ntfs-3g and uid option

It seems HAL does not pick up "<append key="volume.mount.valid_options" type="strlist">uid=</append>" from the configuration file.

$  lshal -u volume_uuid_153B4AB22943D772 | grep volume.mount.valid_options
  volume.mount.valid_options = {'locale=', 'dmask=', 'fmask=', 'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet', 'remount', 'exec'} (string list)

But if I do

$  sudo hal-set-property --udi /org/freedesktop/Hal/devices/volume_uuid_153B4AB22943D772 --key volume.mount.valid_options --strlist-post uid=

then GNOME is able to mount a volume.

Is it a bug?

Offline

#3 2009-05-10 04:26:15

xchllataa
Member
Registered: 2008-01-24
Posts: 12

Re: HAL, ntfs-3g and uid option

Well, I removed /etc/hal/fdi/policy/20-ntfs-config-write-policy.fdi at all and edited /usr/share/hal/fdi/policy/10osvendor/20-ntfs-config-write-policy.fdi instead, and it works now.

Offline

Board footer

Powered by FluxBB