![]() |
|
#1
|
|||
|
|||
|
Those of us who have messed around with 'mount -o bind' know that 'mount -o bind,ro' sounds good in theory, but doesn't work in practice.
Code:
You can of course always do mount -o remount,ro. But this is rather inconvient. However... It turns out that things are even more broken than that. 'mount -l' lists mount flags such as noexec and nosuid as being applied, even though they are actually ignored. Observe: Code:
Nice little "gotcha" there. Are there any workarounds for this, short of setting up a boot script to remount everything? Any patches to the kernel to fix this? How long has this situation existed? Last edited by Gullible Jones : April 28th, 2012 at 01:02 AM. Reason: This issue is limited to Linux as far as I know. |
|
#2
|
|||
|
|||
|
Update: an explanation of why this won't work. But note that Debian includes a patch to make "mount --bind -r" create a read-only bind mount. Yay Debian, I guess... Though I do wonder why that patch hasn't been included upstream.
As for workarounds, there is apparently one, at least for Fedora 14, that involves paired entries in fstab. IMO this is even uglier than creating an initscript... I think I'll pass. BTW, the situation oddly seems to be better on Linux (which at least supports bind mounting, if in a half-broken fashion) than on the famously paranoid OpenBSD (which doesn't support the BSD equivalent, mount_nullfs, any more). Edit: Hmm, maybe the feature is missing from OpenBSD because it can create problems? I've already happened across some interesting cases where bind-mounted directories cannot be unmounted, despite nothing technically accessing their contents. OTOH, symbolic links are useless for this purpose... So what's the alternative? Is there one? Last edited by Gullible Jones : April 28th, 2012 at 05:26 PM. |
|
#3
|
|||
|
|||
|
Hmm. It seems there is an alternative for BSD, if you have portmap or rpc enabled...
Code:
Not sure about the security implications of that though (and I'm having trouble getting it working on Linux). |
| « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|
|