Package: ntfs-3g Version: 1:2011.1.15AR.4+2011.4.12-2
Hello,
ntfs-3g doesn't mount any filesystem if it has write access to
/etc/mtab.
To reproduce the issue I did the following on a system booted into
emergency (plus started udev, fuse, ..., mounted /usr) where / is
initially ro-mounted:
root@(none):~# strace -o /run/ntfs-ro.trace ntfs-3g /dev/mapper/data /mnt
root@(none):~# ls -l /mnt
total 212
-rwxrwxrwx 2 root root 216550 Apr 21 11:32 some_stupid_document.doc
drwxrwxrwx 1 root root 0 May 29 19:22 System Volume Information
root@(none):~# umount /mnt
root@(none):~# mount -o remount,rw /
root@(none):~# strace -o /run/ntfs-rw.trace ntfs-3g /dev/mapper/data /mnt
root@(none):~# ls -l /mnt
total 0
root@(none):~# umount /mnt
umount: /mnt: not mounted
The straces show that in the rw case ntfs-3g umounts the fs after it has
been mounted.
the relevant strace part for the ro case:
...
stat64("/mnt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/dev/fuse", O_RDWR|O_LARGEFILE) = 4
getgid32() = 0
getuid32() = 0
mount("/dev/dm-5", "/mnt", "fuseblk", MS_NOSUID|MS_NODEV,
"allow_other,blksize=4096,fd=4,ro"...) = 0
geteuid32() = 0
lstat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=643, ...}) = 0
access("/etc/mtab", W_OK) = -1 EROFS (Read-only file system)
getuid32() = 0
brk(0x9dd1000) = 0x9dd1000
rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGHUP, {0xb7823f10, [], 0}, NULL, 8) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0xb7823f10, [], 0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {0xb7823f10, [], 0}, NULL, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGPIPE, {SIG_IGN, [], 0}, NULL, 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0xb763a728) = 2070
exit_group(0) = ?
and for the rw case:
...
stat64("/mnt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/dev/fuse", O_RDWR|O_LARGEFILE) = 4
getgid32() = 0
getuid32() = 0
mount("/dev/dm-5", "/mnt", "fuseblk", MS_NOSUID|MS_NODEV,
"allow_other,blksize=4096,fd=4,ro"...) = 0
geteuid32() = 0
lstat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=643, ...}) = 0
access("/etc/mtab", W_OK) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0xb7589728) = 2275
waitpid(2275, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0) = 2275
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
umount("/mnt", MNT_DETACH) = 0
close(4) = 0
fsync(3) = 0
fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0},
0xbff3de78) = 0
close(3) = 0
munmap(0xb7568000, 135168) = 0
exit_group(21) = ?
regards
Mario
--
This project is so important we can't let things that are more important
interfere with it.
-- Advertising/Marketing manager, United Parcel Service
signature.asc
Description: Digital signature

