Public bug reported:

Hi,

Since now ntfs-3g is in the repo, it's could be nice if pmount could
support it. I wrote a little patch to add this support :

diff -Nur pmount-0.9.13/src/fs.c pmount-0.9.13.new/src/fs.c
--- pmount-0.9.13/src/fs.c      2006-08-07 01:21:17.000000000 +0200
+++ pmount-0.9.13.new/src/fs.c  2006-09-12 19:55:42.000000000 +0200
@@ -23,6 +23,7 @@
     { "iso9660", "nosuid,nodev,user", 1, NULL, 1 },
     { "vfat", "nosuid,nodev,user,quiet,shortname=mixed", 1, "077", 1 },
     { "ntfs", "nosuid,nodev,user", 1, "077", 1 },
+    { "ntfs-3g", "nosuid,nodev,user,nonempty", 1, "077", 1 },
     { "hfsplus", "nosuid,nodev,user", 1, NULL, 0 },
     { "hfs", "nosuid,nodev,user", 1, NULL, 0 },
     { "ext3", "nodev,noauto,nosuid,user", 0, NULL, 0 },
diff -Nur pmount-0.9.13/src/pmount.c pmount-0.9.13.new/src/pmount.c
--- pmount-0.9.13/src/pmount.c  2006-08-15 22:47:45.000000000 +0200
+++ pmount-0.9.13.new/src/pmount.c      2006-09-12 19:57:00.000000000 +0200
@@ -286,6 +286,11 @@
             return -1;
         }
         snprintf( iocharset_opt, sizeof( iocharset_opt ), ",iocharset=%s", 
iocharset );
+               /* for ntfs-3g we will use the locale= option */
+               if (strcmp (fsname, "ntfs-3g") == 0) {
+                       debug( "filesystem is ntfs-3g. Setting locale to %s\n", 
setlocale( LC_ALL, "" ));
+                       snprintf( iocharset_opt, sizeof( iocharset_opt ), 
",locale=%s", setlocale( LC_ALL, "" ));
+               }
     }

Basically, it consist just of adding ntfs-3g to fs.c & add a little
thing to handle the special locale= option of ntfs-3g which replace the
iocharset stuff.

The main issue is that i have to add an nonempty option otherwise it
fails to mount, and i don't know actually what's the cause. Since pmount
itself check also if the directory is empty or not, that's not really an
issue, but it's quite silly.

This patch don't replace the ntfs driver which is still default, but it allow 
to mount easily an ntfs USB disk in the user space with read/write support 
quite easily, with a simple command : 
pmount -t ntfs-3g /dev/sda1.
And it's also could be use with a nautilus script which remount the drive with 
the -t ntfs-3g option (i'm trying to make such script)

Consider this bug as a wish.

Thanks

** Affects: pmount (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
ntfs-3g support for pmount
https://launchpad.net/bugs/63271

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to