You are not logged in.

#1 2010-09-23 19:36:47

Sander
Member
Registered: 2006-02-26
Posts: 138

[solved] changing HAL automount permissions causes strange behaviour

I'm trying to change the permissions with which my two NTFS-formatted external harddrives are mounted. Currently, they are mounted as drwx------, which I want to change to drwxr-xr-x.

After scouring the web for a while, I happened upon the file /usr/share/hal/fdi/policy/10osvendor/25-ntfs-config-write-policy.fdi, which looks like this by default:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
       <match key="volume.fstype" string="ntfs">
        <append key="volume.fstype.alternative" type="copy_property">volume.fstype</append>
        <merge key="volume.mount.ntfs.valid_options" type="copy_property">volume.mount.valid_options</merge>
        <merge key="volume.unmount.ntfs.valid_options" type="copy_property">volume.unmount.valid_options</merge>
        <merge key="volume.fstype" type="string">ntfs-3g</merge>
           <merge key="volume.mount.valid_options" type="strlist">ro</merge>
        <append key="volume.mount.valid_options" type="strlist">atime</append>
        <append key="volume.mount.valid_options" type="strlist">noatime</append>
           <append key="volume.mount.valid_options" type="strlist">relatime</append>
           <append key="volume.mount.valid_options" type="strlist">fake_rw</append>
           <append key="volume.mount.valid_options" type="strlist">no_def_opts</append>
           <append key="volume.mount.valid_options" type="strlist">default_permissions</append>
           <append key="volume.mount.valid_options" type="strlist">umask=</append>
           <append key="volume.mount.valid_options" type="strlist">fmask=</append>
           <append key="volume.mount.valid_options" type="strlist">dmask=</append>
           <append key="volume.mount.valid_options" type="strlist">uid=</append>
           <append key="volume.mount.valid_options" type="strlist">gid=</append>
          <append key="volume.mount.valid_options" type="strlist">show_sys_files</append>
           <append key="volume.mount.valid_options" type="strlist">silent</append>
           <append key="volume.mount.valid_options" type="strlist">force</append>
           <append key="volume.mount.valid_options" type="strlist">remove_hiberfile</append>
           <append key="volume.mount.valid_options" type="strlist">locale=</append>
           <append key="volume.mount.valid_options" type="strlist">streams_interface=</append>
           <append key="volume.mount.valid_options" type="strlist">debug</append>
           <append key="volume.mount.valid_options" type="strlist">no_detatch</append>
           <append key="volume.mount.valid_options" type="strlist">sync</append>
           <append key="volume.mount.valid_options" type="strlist">dirsync</append>
           <append key="volume.mount.valid_options" type="strlist">nodiratime</append>
           <append key="volume.mount.valid_options" type="strlist">noexec</append>
        <append key="volume.mount.valid_options" type="strlist">quiet</append>
           <append key="volume.mount.valid_options" type="strlist">remount</append>
           <append key="volume.mount.valid_options" type="strlist">exec</append>
           <append key="volume.mount.valid_options" type="strlist">recover</append>
           <append key="volume.mount.valid_options" type="strlist">norecover</append>
           <merge key="volume.unmount.valid_options" type="strlist">lazy</merge>
           <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
    </match>
  </device>
</deviceinfo>

I figured that changing the line:
<append key="volume.mount.valid_options" type="strlist">umask=</append>
to read:
<append key="volume.mount.valid_options" type="strlist">umask=0022</append>
would fix it.

When I insert a umask in that position (any umask, even 7777), the drives are suddenly mounted as drwxrwxrwx, which is definitely not what I want. I have no idea why it would do that, it completely baffles me. Maybe I'm misunderstanding how HAL works? All it does lately is piss me off, really tongue

Anyway, can anyone explain this behaviour? Or better yet, can anyone tell me what I should do to get HAL to automount my external harddrives with drwxr-xr-x permissions? Thanks!

Last edited by Sander (2010-09-23 20:27:31)


You like cheese? You like peas? You'll love cheezy peas!

Offline

#2 2010-09-23 19:41:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] changing HAL automount permissions causes strange behaviour

Have you tested this with drives formatted with a Linux fs? NTFS doesn't know about permissions, so maybe that's why you get drwxrwxrwx.

Offline

#3 2010-09-23 19:45:22

Sander
Member
Registered: 2006-02-26
Posts: 138

Re: [solved] changing HAL automount permissions causes strange behaviour

I don't have any USB drives formatted with a linux fs lying around, but I just checked with a vfat-formatted USB stick, and this seems to receive the desired drwxr-xr-x permissions by default.

NTFS doesn't know about permissions indeed, which is why HAL needs to provide them when mounting in the first place smile And I would like to change the way in which it does this.


EDIT: this seems to be the exact same problem: http://ubuntuforums.org/showthread.php?t=1502775
Samba is also the reason why it is an issue. I think I might go with the solution suggested there and add a 'force user' line in my samba configuration file for the time being.

Last edited by Sander (2010-09-23 19:50:58)


You like cheese? You like peas? You'll love cheezy peas!

Offline

#4 2010-09-23 19:51:19

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [solved] changing HAL automount permissions causes strange behaviour

using udev could also be an option. I don't use hal at all now for auto-mounting.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2010-09-23 19:52:41

Sander
Member
Registered: 2006-02-26
Posts: 138

Re: [solved] changing HAL automount permissions causes strange behaviour

I'm just using what XFce is using smile if I can make that use udev, that might also be a good solution. If I'm not mistaken HAL is pretty much end-of-life anyway.

EDIT: putting force user = sander in my /etc/samba/smb.conf file has made my external harddrives accessible through Samba again, which was my original problem. This is not a solution for the problem I described in the first post of this topic of course, but I still thought I'd mention it.
I'm still curious about how I could get my NTFS drives to be mounted with drwxr-xr-x permissions, but at least I don't have to be pissed off about it anymore tongue

Last edited by Sander (2010-09-23 20:01:17)


You like cheese? You like peas? You'll love cheezy peas!

Offline

#6 2010-09-23 20:24:46

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [solved] changing HAL automount permissions causes strange behaviour

If you want to change how stuff gets mounted via HAL, you need to configure the actual mount handler. In the case of XFCE that would be Thunar, or more specifically /etc/xdg/xfce4/mount.rc

Last edited by Gusar (2010-09-23 20:25:21)

Offline

#7 2010-09-23 20:27:09

Sander
Member
Registered: 2006-02-26
Posts: 138

Re: [solved] changing HAL automount permissions causes strange behaviour

well I'll be damned, there it is:

[ntfs-3g]
uid=<auto>
# Make sure the device does not get 0777 permissions
umask=0077

Thanks man! I'll just change this to 0022 and be on my way smile


You like cheese? You like peas? You'll love cheezy peas!

Offline

Board footer

Powered by FluxBB