summaryrefslogtreecommitdiffstats
path: root/redhat/kdelibs/kdelibs-3.5.13-fix_iso_kioslave_not_parsing_large_image_properly.patch
blob: f55310ed8f0c99112c6710678c48bbcdb147d075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
commit b4bba7b553995a6b13214dbbabe18ff311007eea
Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Date:   1341113466 -0500

    Fix iso kioslave not parsing large images properly

diff --git a/kioslave/iso/kiso.cpp b/kioslave/iso/kiso.cpp
index c6faa65..6403f62 100644
--- a/kioslave/iso/kiso.cpp
+++ b/kioslave/iso/kiso.cpp
@@ -188,7 +188,7 @@ KIso::~KIso()
 }
 
 /* callback function for libisofs */
-static int readf(char *buf, int start, int len,void *udata) {
+static int readf(char *buf, long start, long len,void *udata) {
 
     TQIODevice* dev = ( static_cast<KIso*> (udata) )->device();
 
@@ -212,7 +212,7 @@ static int mycallb(struct iso_directory_record *idr,void *udata) {
     bool special=false;
     KArchiveEntry *entry=NULL,*oldentry=NULL;
     char z_algo[2],z_params[2];
-    int z_size=0;
+    long long z_size=0;
 
     if ((idr->flags[0] & 1) && !iso->showhidden) return 0;
     if (iso->level) {
@@ -289,7 +289,8 @@ static int mycallb(struct iso_directory_record *idr,void *udata) {
 
 void KIso::addBoot(struct el_torito_boot_descriptor* bootdesc) {
 
-    int i,size;
+    int i;
+    long long size;
     boot_head boot;
     boot_entry *be;
     TQString path;
diff --git a/kioslave/iso/kisofile.cpp b/kioslave/iso/kisofile.cpp
index afac16b..ffae0d3 100644
--- a/kioslave/iso/kisofile.cpp
+++ b/kioslave/iso/kisofile.cpp
@@ -20,7 +20,7 @@
 
 KIsoFile::KIsoFile( KArchive* archive, const TQString& name, int access,
     int date, int adate,int cdate, const TQString& user, const TQString& group,
-    const TQString& symlink,int pos, int size) :
+    const TQString& symlink,long long pos, long long size) :
         KArchiveFile(archive, name, access, date, user, group, symlink, pos, size) {
 
 
@@ -32,7 +32,7 @@ KIsoFile::KIsoFile( KArchive* archive, const TQString& name, int access,
 KIsoFile::~KIsoFile(){
 }
 
-void KIsoFile::setZF(char algo[2],char parms[2],int realsize) {
+void KIsoFile::setZF(char algo[2],char parms[2],long long realsize) {
     m_algo[0]=algo[0];m_algo[1]=algo[1];
     m_parms[0]=parms[0];m_parms[1]=parms[1];
     m_realsize=realsize;
diff --git a/kioslave/iso/kisofile.h b/kioslave/iso/kisofile.h
index 193509c..696a8c1 100644
--- a/kioslave/iso/kisofile.h
+++ b/kioslave/iso/kisofile.h
@@ -29,9 +29,9 @@ class KIsoFile : public KArchiveFile  {
 public: 
     KIsoFile( KArchive* archive, const TQString& name, int access, int date,
                     int adate,int cdate, const TQString& user, const TQString& group,
-                   const TQString& symlink, int pos, int size);
+                   const TQString& symlink, long long pos, long long size);
     ~KIsoFile();
-    void setZF(char algo[2],char parms[2],int realsize);
+    void setZF(char algo[2],char parms[2],long long realsize);
     int adate() const { return m_adate; }
     int cdate() const { return m_cdate; }
     long long realsize() const { return m_realsize; }
diff --git a/kioslave/iso/libisofs/isofs.c b/kioslave/iso/libisofs/isofs.c
index ab13d9e..e599450 100644
--- a/kioslave/iso/libisofs/isofs.c
+++ b/kioslave/iso/libisofs/isofs.c
@@ -122,8 +122,8 @@ void FreeBootTable(boot_head *boot) {
 	boot->defentry=NULL;
 }
 
-int BootImageSize(int media,int len) {
-	int ret;
+int BootImageSize(int media,long len) {
+	long long ret;
 
 	switch(media & 0xf) {
 		case 0:
@@ -158,7 +158,7 @@ static boot_entry *CreateBootEntry(char *be) {
 	return entry;
 }
 
-int ReadBootTable(readfunc *read,int sector, boot_head *head, void *udata) {
+int ReadBootTable(readfunc *read,long sector, boot_head *head, void *udata) {
 
 	char buf[2048], *c, *be;
 	int i,end=0;
@@ -221,7 +221,7 @@ err:
 /**
  * Creates the linked list of the volume descriptors
  */
-iso_vol_desc *ReadISO9660(readfunc *read,int sector,void *udata) {
+iso_vol_desc *ReadISO9660(readfunc *read,long sector,void *udata) {
 				
 	int i;
 	struct iso_volume_descriptor buf;
@@ -577,10 +577,10 @@ int level=0,joliet=0,dirs,files;
 iconv_t iconv_d;
 int fd;
 
-int readf(char *buf, int start, int len,void *udata) {
+int readf(char *buf, long start, long len,void *udata) {
 	int ret;
 	
-	if ((ret=lseek(fd, start << 11, SEEK_SET))<0) return ret;
+	if ((ret=lseek64(fd, start << 11, SEEK_SET))<0) return ret;
 	ret=read(fd, buf, len << 11);
 	if (ret<0) return ret;
 	return (ret >> 11);
diff --git a/kioslave/iso/libisofs/isofs.h b/kioslave/iso/libisofs/isofs.h
index 52190e6..b8971a4 100644
--- a/kioslave/iso/libisofs/isofs.h
+++ b/kioslave/iso/libisofs/isofs.h
@@ -50,7 +50,7 @@ typedef struct _rr_entry {
 	int		re; /* relocated */
 	char	z_algo[2]; /* zizofs algorithm */
 	char	z_params[2]; /* zizofs parameters */
-	int		z_size; /* zizofs real_size */
+	long		z_size; /* zizofs real_size */
 } rr_entry;
 
 typedef struct _iso_vol_desc {
@@ -78,7 +78,7 @@ typedef struct _boot_head {
 /**
  * this callback function needs to read 'len' sectors from 'start' into 'buf' 
  */
-typedef int readfunc(char *buf,int start, int len,void *);
+typedef int readfunc(char *buf,long start, long len,void *);
 
 /**
  * ProcessDir uses this callback
@@ -107,7 +107,7 @@ time_t isodate_84261(char * p, int hs);
  * If the function fails, returns NULL
  * Don't forget to call FreeISO9660 after using the volume descriptor list!
  */
-iso_vol_desc *ReadISO9660(readfunc *read,int sector,void *udata);
+iso_vol_desc *ReadISO9660(readfunc *read,long sector,void *udata);
 
 /**
  * Frees the linked list of volume descriptors
@@ -140,7 +140,7 @@ int JolietLevel(struct iso_volume_descriptor *ivd);
 /**
  * Returns the size of the boot image (in 512 byte sectors)
  */
-int BootImageSize(int media,int len);
+int BootImageSize(int media,long len);
 
 /**
  * Frees the boot catalog entries in 'boot'. If you ever called ReadBootTable,
@@ -151,7 +151,7 @@ void FreeBootTable(boot_head *boot);
 /**
  * Reads the boot catalog into 'head'. Don't forget to call FreeBootTable!
  */
-int ReadBootTable(readfunc *read,int sector, boot_head *head, void *udata);
+int ReadBootTable(readfunc *read,long sector, boot_head *head, void *udata);
 
 #ifdef __cplusplus
 } //extern "C"