rpms/qpxtool/F-7 qpxtool-0.6.1-fix-scsi-cmd.patch, NONE, 1.1 qpxtool.spec, 1.1, 1.2

Adel Gadllah (drago01) fedora-extras-commits at redhat.com
Sun Mar 23 12:12:06 UTC 2008


Author: drago01

Update of /cvs/pkgs/rpms/qpxtool/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18134

Modified Files:
	qpxtool.spec 
Added Files:
	qpxtool-0.6.1-fix-scsi-cmd.patch 
Log Message:
fix scsi command lengths

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-7/qpxtool.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- qpxtool.spec	24 Sep 2007 16:43:42 -0000	1.1
+++ qpxtool.spec	23 Mar 2008 12:11:27 -0000	1.2
@@ -1,6 +1,6 @@
 Name: qpxtool
 Version: 0.6.1        
-Release: 5%{?dist}
+Release: 6%{?dist}
 Summary: CD/DVD Quality check tool
 
 Group: Applications/System         
@@ -12,6 +12,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
@@ -42,6 +43,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
@@ -112,6 +114,9 @@
 %{_libdir}/libqpxtransport.so
 
 %changelog
+* Sun Mar 23 2008 Adel Gadllah <adel.gadllah at gmail.com> 0.6.1-6
+- Don't use too short scsi cmd lengths (RH #428281)
+
 * Sat Sep 22 2007 Adel Gadllah <adel.gadllah at gmail.com> 0.6.1-5
 - Fix desktop file category
 




More information about the fedora-extras-commits mailing list