commit 07e7307a79f64dbb05d06263664dc2ca7796b7ab
Author: Jakub Bogusz <[email protected]>
Date:   Sat Mar 2 21:42:42 2013 +0100

    - added format patch, but disable -Werror=format-security anyway because of 
hdfimport.c

 hdf-format.patch | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hdf.spec         |   5 +++
 2 files changed, 139 insertions(+)
---
diff --git a/hdf.spec b/hdf.spec
index 0c481bb..d8e35c9 100644
--- a/hdf.spec
+++ b/hdf.spec
@@ -17,6 +17,7 @@ Source1:      
http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-man-pages.tar.
 Patch0:                %{name}-shared.patch
 Patch1:                %{name}-morearchs.patch
 Patch2:                %{name}-link.patch
+Patch3:                %{name}-format.patch
 URL:           http://hdf.ncsa.uiuc.edu/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -32,6 +33,9 @@ BuildRequires:        which
 BuildRequires: zlib-devel >= 1.1.4
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# because of mfhdf/hdfimport/hdfimport.c false positives (const strings as 
format arguments)
+%define                filterout_c     -Werror=format-security
+
 %description
 HDF is a multi-object file format that facilitates the transfer of
 various types of scientific data between machines and operating
@@ -100,6 +104,7 @@ Narzędzia do konwersji z i do formatu HDF.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 # evil -R
 sed -i '/^if HDF_BUILD_XDR/,/^endif/d;/^if HDF_BUILD_SHARED/,/^endif/d' 
config/commence.am
diff --git a/hdf-format.patch b/hdf-format.patch
new file mode 100644
index 0000000..9d37e63
--- /dev/null
+++ b/hdf-format.patch
@@ -0,0 +1,134 @@
+--- hdf-4.2.9/hdf/util/writehdf.c.orig 2013-02-08 05:44:54.000000000 +0100
++++ hdf-4.2.9/hdf/util/writehdf.c      2013-03-02 21:21:51.253874517 +0100
+@@ -75,15 +75,13 @@
+       /*Start HDF file*/
+       file_id = Hopen(HDFName, DFACC_CREATE, 0);
+       if(file_id == -1) {
+-              printf("Unable to create HDF file");
+               status = HEvalue(1);
+-              printf(HEstring(status));
++              printf("Unable to create HDF file: %s", HEstring(status));
+               exit(0);
+       }
+ 
+       if ((status = Vstart(file_id)) == -1) {
+-              printf("Could not start VGroup interface\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not start VGroup interface\n%s", 
HEstring(HEvalue(1)));
+               exit(-1);
+       }
+ 
+@@ -98,8 +96,7 @@
+       if (gifHead.PackedField & 0x80) {
+               status = Vsetattr (vgroup_id, "Global Palette" , DFNT_UINT8, 3 
* gifHead.TableSize , (VOIDP)gifHead.HDFPalette);
+               if (status) {
+-                      printf("Could not add global palette.\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not add global palette.\n%s", 
HEstring(HEvalue(1)));
+               }
+       }
+       for (i = 0 ; i < CommentCount ; i++) {
+@@ -143,15 +140,13 @@
+ 
+               /* GRSetCompress */
+               if ((status = GRsetcompress(ri_id, comp_type, &c_info)) == -1) {
+-                      printf("Error occured while setting compression\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Error occured while setting compression\n%s", 
HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+ 
+               /* Write the GR Image */
+               if ((status = GRwriteimage(ri_id, start, NULL, edges, 
(VOIDP)gifImageDesc.Image)) == -1) {
+-                      printf("Error occured while trying to write GR 
image\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Error occured while trying to write GR 
image\n%s", HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+ 
+@@ -159,8 +154,7 @@
+               pal_id = GRgetlutid (ri_id , 0);
+ 
+               if ((status = GRwritelut (pal_id , 3, DFNT_UINT8, 
interlace_mode, 256, (VOIDP)gifImageDesc.HDFPalette)) == -1) {
+-                      printf("Could not write palette\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not write palette\n%s", 
HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+               
+@@ -168,8 +162,7 @@
+               gr_ref = GRidtoref(ri_id);
+               
+               if ((status = GRendaccess(ri_id)) == -1) {
+-                      printf("Could not terminate GR access\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not terminate GR access\n%s", 
HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+ 
+@@ -177,8 +170,7 @@
+               
+               /* Adding GR to vgroup */
+               if((status = Vaddtagref(vgroup_id,(int32)1965,gr_ref))==-1) {
+-                      printf("Could not add tag to Vgroup");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not add tag to Vgroup: %s", 
HEstring(HEvalue(1)));
+               }
+ 
+               
+@@ -186,29 +178,25 @@
+ 
+       /* Terminate GR access */
+       if ((status = GRend (gr_id))==-1) {
+-              printf("Could not end GR access\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not end GR access\n%s", HEstring(HEvalue(1)));
+               printf("Trying to continue (file may be corrupt)...\n");
+       }
+       
+       /* Terminate access to the VGroup */
+       if ((status = Vdetach(vgroup_id))==-1) {
+-              printf("Could not detach Vgroup\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not detach Vgroup\n%s", HEstring(HEvalue(1)));
+               printf("Trying to continure (file may be corrupt)...\n");
+       }
+ 
+       /* Terminate access to the V interface */
+       if ((status = Vend(file_id))==-1) {
+-              printf("Could not end VGroup access\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not end VGroup access\n%s", HEstring(HEvalue(1)));
+               printf("Trying to continure (file may be corrupt)... \n");
+       }
+ 
+       /* Close the HDF file */
+       if ((status = Hclose (file_id))==-1) {
+-              printf("Could not close HDF file. Fatal Error");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not close HDF file. Fatal Error: %s", 
HEstring(HEvalue(1)));
+               return(-1);
+       }
+       return(0);
+--- hdf-4.2.9/hdf/util/hdf2gif.c.orig  2013-02-08 05:44:54.000000000 +0100
++++ hdf-4.2.9/hdf/util/hdf2gif.c       2013-03-02 21:23:06.247339787 +0100
+@@ -141,9 +141,8 @@
+       /*Start HDF file*/
+       file_id = Hopen(HDFName, DFACC_READ, 0);
+       if(file_id == -1) {
+-              printf("Unable to open HDF file");
+               status = HEvalue(1);
+-              printf(HEstring(status));
++              printf("Unable to open HDF file: %s", HEstring(status));
+               exit(0);
+       }
+       
+@@ -162,7 +161,7 @@
+       
+       if ((status = GRfileinfo(gr_id , &n_images , &n_fileattributes)) == -1) 
{
+               status = HEvalue(1);
+-              printf(HEstring(status));
++              fputs(HEstring(status), stdout);
+               exit(0);
+       }
+       
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/hdf.git/commitdiff/07e7307a79f64dbb05d06263664dc2ca7796b7ab

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to