public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* SG_IO permissions
@ 2008-07-02 13:20 Arne Wiebalck
  2008-07-02 14:51 ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Arne Wiebalck @ 2008-07-02 13:20 UTC (permalink / raw)
  To: linux-scsi

Hi all,

I am trying to replace some read/write calls in our application
by SG_IO commands in order to have access to the sense bytes in 
case of an error. The underlying devices are tape drives. 

Part of our application, such as positioning or reading labels
from the tape, are run as root. This seems to work fine, I get 
the data I expect and the sense bytes in case of an error. 

However, the actual data transfer from and to the device is run 
under a user's ID. This part does not work anymore when switching
from read/write to SG_IO: 'Operation not permitted'. 

Does a user need some special rights to issue SG_IO (read) commands
(on a file descriptor that he opened for reading and that he 
can use without problems for read() calls)? 

The device node that the processes are accessing is a char special
file owned by the user and with all user bits set. This special file
is created on a per tape request basis. I also tried to use /dev/nst0
instead, but that made no difference. 

I am running a relatively old kernel (2.6.9 based), could that cause
any problem?

BTW, why does it say "except st" on the permission requirements table on
http://sg.torque.net/sg/sg_io.html ? :)


Any hints appreciated.


TIA,
 Arne




 




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-07-04  8:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 13:20 SG_IO permissions Arne Wiebalck
2008-07-02 14:51 ` James Bottomley
2008-07-02 18:00   ` Arne Wiebalck
2008-07-02 18:40     ` Arne Wiebalck
2008-07-02 20:28       ` James Bottomley
2008-07-03  9:15         ` Arne Wiebalck
2008-07-03 15:06           ` James Bottomley
2008-07-03 17:57       ` KELEMEN Peter
2008-07-04  8:13       ` Arne Wiebalck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox