[patch] ntfs-fuse and ntfs-3g support for gnome-mount

Bug #78375 reported by Florent Mertens
12
Affects Status Importance Assigned to Milestone
gnome-mount
Fix Released
Medium
gnome-mount (Ubuntu)
Fix Released
Undecided
Martin Pitt

Bug Description

Binary package hint: gnome-mount

In order to mount ntfs volume using ntfs-3g or ntfs-fuse with gnome-mount, we need good default options. This patch is an attempt to set default options for ntfs-3g & ntfs-fuse to make them usable.

Default option use (change in gnome-mount.schemas.in) :
ntfs-3g : locale=
ntfs-fuse : locale=,uid=,umask=077

Explanations :
locale= : is the option to set locale, it replace the utf8 option.
uid=,umask=077 : this is the default options use for vfat.
for ntfs-3g, default setting don't use uid & umask permission handling. To have the same behavior as for vfat, we can also use the following options : locale=,default_permissions,uid=,umask=077

Setting locale (change in gnome-mount.c) :
To set the locale, we use the setlocale( LC_ALL, "" ) function.
This is done in gnome-mount.c with the same kind of workaround use to set uid=.

Warning :
Before using those settings, "locale=" and "default_permissions" need to be set as valid option for ntfs in hal, which is currently not the case.
See related bug : https://bugs.launchpad.net/ubuntu/+source/hal/+bug/78370

Thanks.

Tags: ntfs-support
Revision history for this message
Florent Mertens (givre) wrote :
description: updated
Martin Pitt (pitti)
Changed in gnome-mount:
assignee: nobody → pitti
status: Unconfirmed → In Progress
Revision history for this message
Florent Mertens (givre) wrote :

For the record, here is a like to the ntfs-3g manual :
http://www.die.net/doc/linux/man/man8/ntfs-3g.8.html
and to the ntfsmount manual :
http://man.linux-ntfs.org/ntfsmount.8.html

After some test more test, it appears that uid change is not allowed for non root user, even with removable device. This is only allowed for vfat, iso9660 and udf :

hal-0.5.8.1/tools/hal-storage-mount.c : line 724
" /* don't consider uid= on vfat, iso9660, udf change-uid for the purpose of policy
   * (since these doesn't contain uid/gid bits)
   */
  if (strcmp (libhal_volume_get_fstype (volume), "vfat") != 0 &&
      strcmp (libhal_volume_get_fstype (volume), "iso9660") != 0 &&
      strcmp (libhal_volume_get_fstype (volume), "udf") != 0) {
   pol_change_uid = wants_to_change_uid;"

if we want to use uid= for ntfs-fuse and/or ntfs-3g we should add ntfs to that list. That make sense since ntfs don't contain uid/gid bits.

An other possibility could be to mount them with umask=0 and without uid=.

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

Uploaded, but main is currently frozen due to Herd-2. Will appear in a few days.

 gnome-mount (0.5-2ubuntu4) feisty; urgency=low
 .
   * debian/patches/03_root_mounting.patch:
     - Pass mount policy that was figured out from the user's gconf setup to
       the gksu'ed instance. Based on a patch from Florent Mertens, thank you!
     - Move gksu calling into separate function gksu_myself() to keep the code
       clean.
     - Closes: LP#78314
   * Add debian/patches/04_ntfs_mount_options.patch:
     - Supply sane default mount options for ntfs-3g and ntfs-fuse.
     - Patch from Florent Mertens, thank you!
     - Closes: LP#78375

Changed in gnome-mount:
status: In Progress → Fix Committed
Changed in gnome-mount:
status: Unknown → Unconfirmed
Revision history for this message
Martin Pitt (pitti) wrote :

In Feisty now.

Changed in gnome-mount:
status: Fix Committed → Fix Released
Changed in gnome-mount:
status: Unconfirmed → Fix Released
Changed in gnome-mount:
importance: Unknown → Medium
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

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