rpms/qpxtool/F-8 qpxtool-0.6.1-fix-scsi-cmd.patch, NONE, 1.1 qpxtool.spec, 1.2, 1.3
Adel Gadllah (drago01)
fedora-extras-commits at redhat.com
Sun Mar 23 11:22:07 UTC 2008
Author: drago01
Update of /cvs/pkgs/rpms/qpxtool/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9482
Modified Files:
qpxtool.spec
Added Files:
qpxtool-0.6.1-fix-scsi-cmd.patch
Log Message:
fix scsi command length
qpxtool-0.6.1-fix-scsi-cmd.patch:
--- NEW FILE qpxtool-0.6.1-fix-scsi-cmd.patch ---
diff -upNr qpxtool-0.6.1.orign/lib/qpxtransport/qpx_transport.cpp qpxtool-0.6.1/lib/qpxtransport/qpx_transport.cpp
--- qpxtool-0.6.1.orign/lib/qpxtransport/qpx_transport.cpp 2007-08-19 16:04:14.000000000 +0200
+++ qpxtool-0.6.1/lib/qpxtransport/qpx_transport.cpp 2008-03-23 12:15:03.000000000 +0100
@@ -203,6 +203,15 @@ size_t Scsi_Command::residue() { return
#else
size_t Scsi_Command::residue() { return 0; }
#endif
+
+const unsigned char scsi_command_size[8] =
+{
+ 6, 10, 10, 12,
+ 16, 12, 10, 10
+};
+#define COMMAND_SIZE(opcode) scsi_command_size[((opcode) >> 5) & 7]
+
+
int Scsi_Command::transport(Direction dir=NONE,void *buf=NULL,size_t sz=0)
{
int ret = 0;
@@ -213,6 +222,11 @@ int Scsi_Command::transport(Direction di
sg_io.dxferp = buf;
sg_io.dxfer_len = sz;
sg_io.dxfer_direction = use_sg_io[dir];
+ /* cmd length fix */
+ //printf("cmd.len: %d\n",sg_io.cmd_len);
+ sg_io.cmd_len = (sg_io.cmd_len < COMMAND_SIZE(sg_io.cmdp[0])) ? COMMAND_SIZE(sg_io.cmdp[0]):sg_io.cmd_len;
+ //printf("new cmd.len: %d\n",sg_io.cmd_len);
+
if (ioctl (fd,SG_IO,&sg_io)) return -1;
#if !KERNEL_BROKEN
if ((sg_io.info&SG_INFO_OK_MASK) != SG_INFO_OK)
Index: qpxtool.spec
===================================================================
RCS file: /cvs/pkgs/rpms/qpxtool/F-8/qpxtool.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- qpxtool.spec 17 Oct 2007 06:15:15 -0000 1.2
+++ qpxtool.spec 23 Mar 2008 11:21:32 -0000 1.3
@@ -1,6 +1,6 @@
Name: qpxtool
Version: 0.6.1
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: CD/DVD Quality check tool
Group: Applications/System
@@ -11,6 +11,7 @@
Patch1: consolehelper.patch
Patch2: manpagefix.patch
Patch3: qpxtool-0.6.1-buildfix.patch
+Patch4: qpxtool-0.6.1-fix-scsi-cmd.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: qt-devel
@@ -40,6 +41,7 @@
%patch1 -p1 -b .consolehelper
%patch2 -p1 -b .manpagefix
%patch3 -p1 -b .buildfix
+%patch4 -p1 -b .scsicmd
sed -ie 's!/usr/local!%{_prefix}!g' Makefile
sed -ie 's!\$(PREFIX)/bin!%{_sbindir}!g' Makefile
@@ -110,6 +112,9 @@
%{_libdir}/libqpxtransport.so
%changelog
+* Sun Mar 23 2008 Adel Gadllah <adel.gadllah at gmail.com> 0.6.1-7
+- Don't use too short scsi cmd lengths (RH #428281)
+
* Thu Oct 17 2007 Adel Gadllah <adel.gadllah at gmail.com> 0.6.1-6
- Drop libata patch - no longer needed with fixed udev
More information about the fedora-extras-commits
mailing list