From: "Ilya N. Golubev" <gin@mo.msk.ru>
To: linux-kernel@vger.kernel.org
Subject: mount: can not restrict mode of iso9660 files
Date: Fri, 18 Jan 2008 19:39:20 +0300 [thread overview]
Message-ID: <518x2n9jgn.fsf@mo.msk.ru> (raw)
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.
next reply other threads:[~2008-01-18 17:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-18 16:39 Ilya N. Golubev [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2008-01-18 16:47 mount: can not restrict mode of iso9660 files Ilya N. Golubev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518x2n9jgn.fsf@mo.msk.ru \
--to=gin@mo.msk.ru \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox