Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jun 1995 16:01:36 +0300
From:      "Gennady B. Sorokopud" <gena@NetVision.net.il>
To:        Peter Dufault <dufault@hda.com>
Cc:        <hackers@FreeBSD.org>, <gena@NetVision.net.il>
Subject:   Re: SCIOCCOMMAND ioctl - permission denied
Message-ID:  <XFMail.950617154730.gena@NetVision.net.il>
In-Reply-To: <199506171138.HAA11954@hda.com>

next in thread | previous in thread | raw e-mail | index | archive | help

In message <199506171138.HAA11954@hda.com> Peter Dufault writes:
>Gennady B. Sorokopud writes:
>> 
>> Hello!
>> 
>> I'm author of xmcd port to FreeBSD platform.
>> I received some reports from users that claims that xmcd SCSI
>> interface does not work any more on 2.0.5R.
>> 
>> After some checking i find out that SCIOCCOMMAND ioctl always fail
>> with "permission denied".
>> 
>> Looking at /sys/scsi/scsi_ioctl.c line 260:
>> 
>>         /* If we can't write the device we can't permit much:
>>          */
>>         if (cmd != SCIOCIDENTIFY && !(flags & FWRITE))
>>                 return EACCES;
>> 
>> After commenting out this 2 lines and recompiling the kernel
>> xmcd started to work fine.
>> 
>> All i need to know is how to call this ioctl so it will not fail.
>
>You are probably opening the device O_RDONLY.  The SCIOCCOMMAND

You right! How stupid i was :-(. Thanks.

>ioctl beginning in 2.05 is considered 'destructive' and requires
>write access to the device (even for a CD-ROM).  This is different
>from write permission to open the device.
>
>This is because I can't tell which SCIOCCOMMANDs do things (change
>the mode on the device, eject the CD, etc) that you want to restrict.
>Otherwise someone could open the CD device read-only, allow removal,
>change the modes, eject the device, etc.
>
>I can't protect based on whether you read or write data, since many
>destructive commands don't transfer data.
>
>Sorry, I should have considered this problem with existing programs.
>I hate to see your program break this way on 2.05.  Are there any
>ideas for better ways to handle this?
>
>Peter
>
>-- 
>Peter Dufault               Real Time Machine Control and Simulation
>HD Associates, Inc.         Voice: 508 433 6936
>dufault@hda.com             Fax:   508 433 5267

--------
 Gennady B. Sorokopud - System programmer at NetVision Israel.
 E-Mail: gena@NetVision.net.il
 Homepage: http://www.netvision.net.il/~gena

 This message was sent at 06/17/95 15:47:30 by XF-Mail




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.950617154730.gena>