Bug 149035

Summary: hal only supports boolean mount_option type, cannot set e.g. umask/user/group mount options
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Walter Haidinger <walter.haidinger>
Component: BasesystemAssignee: Danny Kukawka <dkukawka>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Walter Haidinger 2006-02-08 11:41:12 UTC
Shouldn't storage.policy.default.mount_option.* have type string?

Right now, only boolean options like sync or ro can be set, right?
With string, any options of mount(8) like user, group, umask etc 
could be set, e.g.: 
<merge key="storage.policy.mount_option.user"  type="string">foobar</merge>
<merge key="storage.policy.mount_option.umask" type="string">0700</merge>

Or is this already possible with the current boolean implementation?
Comment 1 Walter Haidinger 2006-02-08 11:55:29 UTC
Wrong mount options, please

s/user/uid/g; s/group/gid/g

Thanks.
Comment 2 Walter Haidinger 2006-02-08 11:59:39 UTC
And, just before someone mentions: The umask value is nuts too, I know...
Comment 3 Danny Al-Gaaf 2006-02-08 12:28:13 UTC
take a look at the spec:

<merge key="storage.policy.mount_option.user=foobar"  type="bool">true</merge>
<merge key="storage.policy.mount_option.umask=0700" type="bool">true</merge>
Comment 4 Walter Haidinger 2006-02-09 10:46:25 UTC
I'm sorry, but it's definitely not that easy!

Please note that I've read the spec and searched the hal mailing-list at
freedesktop.org. Although, your solution above is suggested at some places,
there are also posts that it doesn't work, just as for me.

Now for some details: With SuSE 10.0 (with hal-0.5.4-6.4):
Created a file /usr/share/hal/fdi/policy/95userpolicy/usbstick.fdi

What is working (and to show I have at least some clues about what I'm doing ;-):

Disable mounting of floppy-partition of usbstick (would be /dev/sdb):
<match key="volume.uuid" string="8C0A-11E1">
  <merge key="volume.policy.should_mount" type="bool">false</merge>
</match>

Or, setting the following _known_ options without parameters works too:
<match key="volume.uuid" string="AEBE-5B5A"> <!-- disk partition (dev/sda1) -->
  <merge key="volume.policy.desired_mount_point" type="string">stick1</merge>
  <merge key="volume.policy.mount_option.sync"   type="bool">false</merge>    
</match>

Indeed, entries in syslog show that the usbstick is mount _without_ sync:
hal-subfs-mount[32487]: Collected mount options and Called(0) /bin/mount -t
 subfs -o fs=floppyfss,procuid,nosuid,nodev,exec,utf8=true /dev/sda1 "/media/stick1" 

However, the following merge keys are ignored (it's a vfat partition):
<merge key="volume.policy.mount_option.uid=501" type="bool">true</merge>   
<merge key="volume.policy.mount_option.umask=0077" type="bool">true</merge> 

The mount_options never show in hal-subfs-mount syslog messages, therefore I
suspect they're not passed to it at all, right?

Also, I cannot specify a different mount_root as, e.g.
<merge key="storage.policy.default.mount_root" type="string">/usbdev</merge>
is ignored unless directly changed in 10osvendor/10-storage-policy.fdi.

Perhaps, hal-0.5.4 has a bug and it simply doesn't work. If I'm told to upgrade
to latest hal or set some configure options and recompile from the Source-RPM, 
it's all ok with me. However, just looking at the spec doesn't solve the problem. :-(

Btw, regarding the spec: storage.policy.default.mount_option.* shows
.fscontext=system_u:object_r:removable_t as an example and nothing more.
Is the format documented somewhere in more detail?

Regards, Walter
Comment 5 Danny Al-Gaaf 2006-02-09 13:59:13 UTC
I close this bug again, because we don't use this keys for automount. We use currently only a couple of defined keys and ignore all other. The submount helper for hal is only designed for default mount and not really for customize. Btw. This helper is no longer under development, because we dropped subfs.
Comment 6 Walter Haidinger 2006-02-09 15:29:10 UTC
Ok, I see. What will be the replacement for subfs?
Comment 7 Walter Haidinger 2006-02-09 15:37:09 UTC
No need to answer - Google is your fried: Found your Blog entry:
http://dkukawka.blogspot.com/2006/02/subfs-dropped-and-now.html

And, btw, I'm one of the "no desktop" users you're regarding to.
No Gnome, KDE or even xfce. Just console and IceWM.
Comment 8 Walter Haidinger 2006-02-09 15:52:17 UTC
Here is the announcement from the mailing list:

[opensuse-factory] subfs dropped in 10.1 Beta 2
http://lists.opensuse.org/archive/opensuse-factory/2006-Jan/0116.html

Regarding this very bug report , the following 
(see: 2) Mount options.) says it all:
http://lists.opensuse.org/archive/opensuse-factory/2006-Jan/0123.html