-----Original Message-----

> 
> "Andrey Borzenkov" <[EMAIL PROTECTED]> writes:
> 
> > > ------- Additional Comments From [EMAIL PROTECTED]  2003-28-07 19:11 -------
> > > Yes, a setuid wrapper could be made for exemple to solve the problem.
> > 
> > > I don't know if supermount can be modified safely to release floppy as soon as
> > > an application try to open /dev/fd0 in writing, but it should be possible too
> > > and it could be the best place to fix the problem.
> > 
> > supermount can release device (and block further access to it);
> > you have to do it manually using /proc interface.
> > 
> > doing this automatically involves too many cnages in kernel and I
> > won't do it; adding wrapper that does
> > 
> > echo /dev/fd0 release disable > /proc/fs/supermount/subfs
> > 
> > to GNOME formatter is far more simple.
> 
> Yes, I agree, I didn't want to parse /etc/mtab and do an umount (in root, or
> practically setuid root script) if the device was mounted.
>

you still have to parse something to know it is supermounted and
possibly busy. of course it is possible to "just" attempt to disable
it, still it probably have to warn user if subfs is currently mounted.
 
> > > Note: formating a floppy while mounted is impossible, the device is busy, there
> > > is nothing to do here unless umounting the floppy (in root furthermore when
> > > using supermount).
> > 
> > do not use real device name when mounting supermount; use "none". Then
> > nobody can ever check that /dev/fd0 is mounted by supermount.
> > 
> > use /proc interface to release it before formatting.
> > 
> > tell Juan to include my supermount to make it possible :)
> 
> Ah, does it means the current kernel doesn't support this functionnalities ?
> 

2.6 kernel package in cooker does AFAIK :)

> Can you make /proc/fs/supermount/subfs owner the user who has control over the
> floppy device ?

the simplest way is to use pam_console to reassign ownership.
I'll get a look. will it be OK?

else it seems possible; would something like

capable(CAP_SYS_RAWIO) || sys_access("/dev/fd0", W_OK)

do or we need better capability?

> It is maybe already the case but it will be much safer to allow
> the same user and only him to release the supermounted floppy.
>

"the same" - which one? I could add mout option to specify uid/gid
but is it not bloat?

I suggest trying pam_console first, if we hit problems. let's solve
them. /proc/fs/supermount/subfs is available as soon as supermount
modules is loaded so it does not depend on mounting/unmounting.
 
> FranГois.
> 

Reply via email to