linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mount: can not restrict mode of iso9660 files
@ 2008-01-18 16:39 Ilya N. Golubev
  2008-01-23 18:47 ` [PATCH] Implement dmode option for isofs Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya N. Golubev @ 2008-01-18 16:39 UTC (permalink / raw)
  To: linux-kernel

Versions: `2.6.17-1.2142_FC4' (fedora core) for x86_64;
`kernel-syms-2.6.22.5-31' (opensuse 10.3) for i586.

File system may contain data not to let any logged in user read.  Wish
to specify more restrictive mode of files in it - files of all types,
including not only regular ones, but also directories, even root one
of the file system.  This certainly must occur on mount itself, not in
subsequent `chmod' calls.  There is at least one obvious reason to
avoid explicit `chmod', just as many other uses of it: possible race
condition between it and other process opening the file.

When mounting read- only iso9660 file system, `mount' ignores
`mode=0400' file system option, at least for directories.  More
precisely,

mount -nv -t iso9660 -o ro,norock,mode=0400,uid=ID_OF_REGULAR_USER DEVICE DIR

completes without error messages and leaves DIR mounted, but with mode
`r-xr-xr-x'.  DIR uid is as specified.

Also ran that command in `strace -emount'.  Its outputs:

mount("DEVICE", "DIR", "iso9660", MS_RDONLY|MS_POSIXACL|MS_ACTIVE|MS_NOUSER|0xec0000, 0x50fe60) = 0

suggesting that data converted from `-o' argument are actually passed
to the kernel.  Permissions of regular files in mounted file system
are `0400', that is, restricted properly.  This suggests that the
request to restrict permissions, or at least part of it, is passed to
kernel.  However, kernel does not honor the request wrt directories in
mounted file system - or at best needs a separate request for
permissions of directories, which `mount' program does not make.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-28 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-18 16:39 mount: can not restrict mode of iso9660 files Ilya N. Golubev
2008-01-23 18:47 ` [PATCH] Implement dmode option for isofs Jan Kara
2008-01-27  6:02   ` Andrew Morton
2008-01-28 12:58     ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).