On Fri, Sep 01 2000, Rene Mayrhofer wrote:
> Ok, now I think to know what you are meaning: The program locking the door
> should stay active until the CD-ROM should be unlocked, right ?

No, not necessarily. What matters is the open count of the drive. Currently
it will not unlock a tray, that is opened by other programs as well.

> I always though about issuing some single call to lock or unlock the drive
> (e.g. setcd), but I never thought about this. What do I have to do to make
> this possible ? Could you give me some hint on how to allow root to unlock
> it in a clean way ? I wouldn't be very happy to apply special 'CD-ROM
> bootable interim hack' patches to each kernel I build for the project. Is
> there a way to do this general enough so that it can go into the main
> kernel (maybe another config option in /proc/sys/dev/cdrom if root should
> be allowed to unlock under all conditions) ?

I don't think that allowing root to unlock a busy tray is that big a
deal, we have to assume he/she knows what they are doing anyway. But
for now, you can try this patch.

-- 
* Jens Axboe <[EMAIL PROTECTED]>
* SuSE Labs
--- drivers/cdrom/cdrom.c~      Fri Sep  1 13:14:23 2000
+++ drivers/cdrom/cdrom.c       Fri Sep  1 13:14:42 2000
@@ -1604,7 +1604,7 @@
                        return -EDRIVE_CANT_DO_THIS;
                keeplocked = arg ? 1 : 0;
                /* don't unlock the door on multiple opens */
-               if ((cdi->use_count != 1) && !arg)
+               if ((cdi->use_count != 1) && !arg && !capable(CAP_SYS_ADMIN))
                        return -EBUSY;
                return cdo->lock_door(cdi, arg);
                }

Reply via email to