1 |
xmerlin 08/01/15 12:05:22 |
2 |
|
3 |
Added: partimage-0.6.6-chown.patch |
4 |
partimage-0.6.6-andre-przywara_warnings.patch |
5 |
partimage-0.6.6-gui.diff |
6 |
partimage-0.6.6-andre-przywara_amd64.patch |
7 |
partimage-0.6.6-datadir-path.patch |
8 |
partimage-0.6.6-not_install_info.patch |
9 |
partimage-0.6.6-thread-privilege-fix.patch |
10 |
digest-partimage-0.6.6 |
11 |
partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch |
12 |
partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch |
13 |
partimage-0.6.6-disable_header_check.patch |
14 |
Log: |
15 |
Version bump, ported patches, fixed pam auth, fixed amd64. |
16 |
(Portage version: 2.1.3.9) |
17 |
|
18 |
Revision Changes Path |
19 |
1.1 sys-block/partimage/files/partimage-0.6.6-chown.patch |
20 |
|
21 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-chown.patch?rev=1.1&view=markup |
22 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-chown.patch?rev=1.1&content-type=text/plain |
23 |
|
24 |
Index: partimage-0.6.6-chown.patch |
25 |
=================================================================== |
26 |
diff -uNr partimage-0.6.6.orig/Makefile.am partimage-0.6.6/Makefile.am |
27 |
--- partimage-0.6.6.orig/Makefile.am 2006-04-22 16:59:22.000000000 +0200 |
28 |
+++ partimage-0.6.6/Makefile.am 2008-01-14 23:11:00.000000000 +0100 |
29 |
@@ -23,8 +23,6 @@ |
30 |
rm ${sysconfdir}/partimaged/partimaged.csr ;\ |
31 |
chmod 600 ${sysconfdir}/partimaged/partimaged.key ;\ |
32 |
chmod 600 ${sysconfdir}/partimaged/partimaged.cert ;\ |
33 |
- chown partimag:root ${sysconfdir}/partimaged/partimaged.key ;\ |
34 |
- chown partimag:root ${sysconfdir}/partimaged/partimaged.cert ;\ |
35 |
else \ |
36 |
echo "SSL disabled, no certificate will be generated." ;\ |
37 |
fi |
38 |
@@ -57,7 +55,6 @@ |
39 |
echo "#sample # user 'sample' is allowed to connect partimaged" >> \ |
40 |
${sysconfdir}/partimaged/partimagedusers ;\ |
41 |
chmod 600 ${sysconfdir}/partimaged/partimagedusers ;\ |
42 |
- chown partimag:root ${sysconfdir}/partimaged/partimagedusers ;\ |
43 |
fi |
44 |
|
45 |
$(mkinstalldirs) ${infodir} |
46 |
diff -uNr partimage-0.6.6.orig/Makefile.in partimage-0.6.6/Makefile.in |
47 |
--- partimage-0.6.6.orig/Makefile.in 2008-01-14 23:09:15.000000000 +0100 |
48 |
+++ partimage-0.6.6/Makefile.in 2008-01-14 23:11:07.000000000 +0100 |
49 |
@@ -670,8 +670,6 @@ |
50 |
rm ${sysconfdir}/partimaged/partimaged.csr ;\ |
51 |
chmod 600 ${sysconfdir}/partimaged/partimaged.key ;\ |
52 |
chmod 600 ${sysconfdir}/partimaged/partimaged.cert ;\ |
53 |
- chown partimag:root ${sysconfdir}/partimaged/partimaged.key ;\ |
54 |
- chown partimag:root ${sysconfdir}/partimaged/partimaged.cert ;\ |
55 |
else \ |
56 |
echo "SSL disabled, no certificate will be generated." ;\ |
57 |
fi |
58 |
@@ -703,7 +701,6 @@ |
59 |
echo "#sample # user 'sample' is allowed to connect partimaged" >> \ |
60 |
${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
61 |
chmod 600 ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
62 |
- chown partimag:root ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
63 |
fi |
64 |
|
65 |
$(mkinstalldirs) ${DESTDIR}${infodir} |
66 |
|
67 |
|
68 |
|
69 |
1.1 sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch |
70 |
|
71 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch?rev=1.1&view=markup |
72 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch?rev=1.1&content-type=text/plain |
73 |
|
74 |
Index: partimage-0.6.6-andre-przywara_warnings.patch |
75 |
=================================================================== |
76 |
diff -uNr partimage-0.6.6.orig/src/client/fs/fs_base.cpp partimage-0.6.6/src/client/fs/fs_base.cpp |
77 |
--- partimage-0.6.6.orig/src/client/fs/fs_base.cpp 2008-01-14 01:34:19.000000000 +0100 |
78 |
+++ partimage-0.6.6/src/client/fs/fs_base.cpp 2008-01-14 01:34:47.000000000 +0100 |
79 |
@@ -134,6 +134,7 @@ |
80 |
check.cMagic[0] = 'C'; |
81 |
check.cMagic[1] = 'H'; |
82 |
check.cMagic[2] = 'K'; |
83 |
+ check.cMagic[3] = 0; |
84 |
|
85 |
dwStats = 0; |
86 |
i = 0; |
87 |
diff -uNr partimage-0.6.6.orig/src/client/fs/fs_base.h partimage-0.6.6/src/client/fs/fs_base.h |
88 |
--- partimage-0.6.6.orig/src/client/fs/fs_base.h 2006-04-22 16:24:14.000000000 +0200 |
89 |
+++ partimage-0.6.6/src/client/fs/fs_base.h 2008-01-14 01:34:47.000000000 +0100 |
90 |
@@ -39,7 +39,7 @@ |
91 |
// ================================================ |
92 |
struct CCheck |
93 |
{ |
94 |
- char cMagic[3]; // must be 'C','H','K' |
95 |
+ char cMagic[4]; // must be 'C','H','K' |
96 |
DWORD dwCRC; // CRC of the CHECK_FREQUENCY blocks |
97 |
QWORD qwPos; // number of the last block written |
98 |
}; |
99 |
diff -uNr partimage-0.6.6.orig/src/client/misc.cpp partimage-0.6.6/src/client/misc.cpp |
100 |
--- partimage-0.6.6.orig/src/client/misc.cpp 2008-01-14 01:34:19.000000000 +0100 |
101 |
+++ partimage-0.6.6/src/client/misc.cpp 2008-01-14 01:34:47.000000000 +0100 |
102 |
@@ -2392,7 +2392,7 @@ |
103 |
} |
104 |
p = strdup(p); |
105 |
char *q; |
106 |
- while (q = strchr(p, '/')) *q = '_'; |
107 |
+ while ((q = strchr(p, '/'))!=NULL) *q = '_'; |
108 |
|
109 |
return p; |
110 |
} |
111 |
|
112 |
|
113 |
|
114 |
1.1 sys-block/partimage/files/partimage-0.6.6-gui.diff |
115 |
|
116 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-gui.diff?rev=1.1&view=markup |
117 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-gui.diff?rev=1.1&content-type=text/plain |
118 |
|
119 |
Index: partimage-0.6.6-gui.diff |
120 |
=================================================================== |
121 |
diff -uNr partimage-0.6.6.orig/src/server/partimaged-main.cpp partimage-0.6.6/src/server/partimaged-main.cpp |
122 |
--- partimage-0.6.6.orig/src/server/partimaged-main.cpp 2006-04-22 16:24:14.000000000 +0200 |
123 |
+++ partimage-0.6.6/src/server/partimaged-main.cpp 2008-01-14 23:30:21.000000000 +0100 |
124 |
@@ -98,6 +98,11 @@ |
125 |
else if (signo == SIGINT) |
126 |
{ |
127 |
g_bSigInt = true; |
128 |
+ delete g_Server; |
129 |
+ delete g_Window; |
130 |
+ g_Server = NULL; |
131 |
+ g_Window = NULL; |
132 |
+ exit(0); |
133 |
} |
134 |
else if (signo == SIGSEGV) |
135 |
{ |
136 |
@@ -235,7 +240,7 @@ |
137 |
case 'd': |
138 |
if (chdir(optarg) != 0) |
139 |
{ |
140 |
- printf("%s: %s\n", optarg, strerror(errno)); |
141 |
+ printf("Directory %s: %s\n", optarg, strerror(errno)); |
142 |
exit(-1); |
143 |
} |
144 |
break; |
145 |
@@ -313,9 +318,9 @@ |
146 |
#endif |
147 |
|
148 |
// register signals |
149 |
-// signal(SIGTERM, catch_sigint); |
150 |
-// signal(SIGINT, catch_sigint); |
151 |
-// signal(SIGSEGV, catch_sigint); // segmentation fault |
152 |
+ signal(SIGTERM, catch_sigint); |
153 |
+ signal(SIGINT, catch_sigint); |
154 |
+ signal(SIGSEGV, catch_sigint); // segmentation fault |
155 |
// signal(SIGHUP, catch_sigint); |
156 |
// signal(SIGQUIT, catch_sigint); |
157 |
// signal(SIGCHLD, catch_sigint); |
158 |
|
159 |
|
160 |
|
161 |
1.1 sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch |
162 |
|
163 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch?rev=1.1&view=markup |
164 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch?rev=1.1&content-type=text/plain |
165 |
|
166 |
Index: partimage-0.6.6-andre-przywara_amd64.patch |
167 |
=================================================================== |
168 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_afs.cpp |
169 |
--- a/src/client/fs/fs_afs.cpp Tue Sep 04 21:36:14 2007 +0200 |
170 |
+++ b/src/client/fs/fs_afs.cpp Tue Sep 04 21:43:30 2007 +0200 |
171 |
@@ -285,10 +285,10 @@ void CAfsPart::printfInformations() |
172 |
getStdInfos(szText, sizeof(szText), false); |
173 |
|
174 |
SNPRINTF(szFullText, i18n("%s" // standard infos |
175 |
- "Allocation groups count:......%lu\n" |
176 |
- "Byte order:...................%lu\n" |
177 |
- "Blocks per group:.............%lu\n" |
178 |
- "Boot loader size:.............%lu blocks\n"), |
179 |
+ "Allocation groups count:......%u\n" |
180 |
+ "Byte order:...................%u\n" |
181 |
+ "Blocks per group:.............%u\n" |
182 |
+ "Boot loader size:.............%u blocks\n"), |
183 |
szText, m_info.dwAllocGroupCount, m_info.dwByteOrder, |
184 |
m_info.dwBlockPerGroup, m_info.dwBootLoaderSize); |
185 |
|
186 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_base.cpp |
187 |
--- a/src/client/fs/fs_base.cpp Tue Sep 04 21:36:14 2007 +0200 |
188 |
+++ b/src/client/fs/fs_base.cpp Tue Sep 04 21:43:30 2007 +0200 |
189 |
@@ -14,6 +14,9 @@ |
190 |
* (at your option) any later version. * |
191 |
* * |
192 |
***************************************************************************/ |
193 |
+ |
194 |
+#define __STDC_FORMAT_MACROS |
195 |
+#include <inttypes.h> |
196 |
|
197 |
#include "fs_base.h" |
198 |
#include "partimage.h" |
199 |
@@ -727,10 +730,10 @@ int CFSBase::getStdInfos(char *szDest, i |
200 |
|
201 |
if (bShowBlocksInfo) |
202 |
{ |
203 |
- SNPRINTF(szBlocksInfo, i18n("Block size....................%llu bytes\n" |
204 |
- "Total blocks count............%llu\n" |
205 |
- "Used blocks count.............%llu\n" |
206 |
- "Free blocks count.............%llu\n"), |
207 |
+ SNPRINTF(szBlocksInfo, i18n("Block size....................%"PRIu64" bytes\n" |
208 |
+ "Total blocks count............%"PRIu64"\n" |
209 |
+ "Used blocks count.............%"PRIu64"\n" |
210 |
+ "Free blocks count.............%"PRIu64"\n"), |
211 |
m_header.qwBlockSize, |
212 |
m_header.qwBlocksCount, |
213 |
m_header.qwUsedBlocks, |
214 |
@@ -742,7 +745,7 @@ int CFSBase::getStdInfos(char *szDest, i |
215 |
} |
216 |
|
217 |
snprintf(szDest, nMaxLen, i18n("%s" // Blocks infos |
218 |
- "Space usage:..................%llu %%\n" |
219 |
+ "Space usage:..................%"PRIu64" %%\n" |
220 |
"Used space....................%s\n" |
221 |
"Free space....................%s\n" |
222 |
"Bitmap size...................%s\n" |
223 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_ext2.cpp |
224 |
--- a/src/client/fs/fs_ext2.cpp Tue Sep 04 21:36:14 2007 +0200 |
225 |
+++ b/src/client/fs/fs_ext2.cpp Tue Sep 04 21:43:30 2007 +0200 |
226 |
@@ -103,12 +103,12 @@ void CExt2Part::printfInformations() |
227 |
getStdInfos(szText, sizeof(szText), false); |
228 |
|
229 |
SNPRINTF(szFullText, i18n("%s" // standard infos |
230 |
- "Number of groups..............%lu\n" |
231 |
- "First block...................%lu\n" |
232 |
+ "Number of groups..............%u\n" |
233 |
+ "First block...................%u\n" |
234 |
"Ext3fs journalization.........%s\n" |
235 |
"Sparse super block............%s\n" |
236 |
"Large files support...........%s\n" |
237 |
- "File system revision..........%lu\n"), |
238 |
+ "File system revision..........%u\n"), |
239 |
szText, m_info.dwGroupsCount, m_info.dwFirstBlock, |
240 |
(m_info.dwFeatureCompat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) ? i18n("yes") : i18n("no"), |
241 |
(m_info.dwFeatureRoCompat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER) ? i18n("yes") : i18n("no"), |
242 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_fat.cpp |
243 |
--- a/src/client/fs/fs_fat.cpp Tue Sep 04 21:36:14 2007 +0200 |
244 |
+++ b/src/client/fs/fs_fat.cpp Tue Sep 04 21:43:30 2007 +0200 |
245 |
@@ -124,14 +124,14 @@ void CFatPart::printfInformations() |
246 |
"Sector Size...................%u\n" |
247 |
"Sectors per cluster...........%u\n" |
248 |
"Reserved Sectors count........%u\n" |
249 |
- "Root directory sectors........%lu\n" |
250 |
+ "Root directory sectors........%u\n" |
251 |
"FAT tables count..............%u\n" |
252 |
- "Total Sectors Count...........%lu\n" |
253 |
- "Sectors per FAT...............%lu\n" |
254 |
- "Clusters count:...............%lu\n" |
255 |
- "Used clusters.................%lu\n" |
256 |
- "Free clusters.................%lu\n" |
257 |
- "Damaged clusters..............%lu\n"), |
258 |
+ "Total Sectors Count...........%u\n" |
259 |
+ "Sectors per FAT...............%u\n" |
260 |
+ "Clusters count:...............%u\n" |
261 |
+ "Used clusters.................%u\n" |
262 |
+ "Free clusters.................%u\n" |
263 |
+ "Damaged clusters..............%u\n"), |
264 |
szText, m_info.wBytesPerSector, m_info.cSectorsPerCluster, |
265 |
m_info.wReservedSectorsCount, m_info.dwRootDirSectors, |
266 |
m_info.cNumberOfFATs,m_info.dwTotalSectorsCount, |
267 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_hfs.cpp |
268 |
--- a/src/client/fs/fs_hfs.cpp Tue Sep 04 21:36:14 2007 +0200 |
269 |
+++ b/src/client/fs/fs_hfs.cpp Tue Sep 04 21:43:30 2007 +0200 |
270 |
@@ -22,6 +22,8 @@ |
271 |
#include "gui_text.h" |
272 |
|
273 |
#include <stdio.h> |
274 |
+#define __STDC_FORMAT_MACROS |
275 |
+#include <inttypes.h> |
276 |
|
277 |
// ======================================================= |
278 |
CHfsPart::CHfsPart(char *szDevice, FILE *fDeviceFile, QWORD qwPartSize): CFSBase(szDevice, fDeviceFile, qwPartSize) |
279 |
@@ -140,10 +142,10 @@ void CHfsPart::printfInformations() |
280 |
getStdInfos(szText, sizeof(szText), true); |
281 |
|
282 |
SNPRINTF(szFullText, i18n("%s" // standard infos |
283 |
- "Allocation Group count:.......%llu\n" |
284 |
- "Blocks per Allocation Group...%lu\n" |
285 |
+ "Allocation Group count:.......%"PRIu64"\n" |
286 |
+ "Blocks per Allocation Group...%u\n" |
287 |
"Allocation Group size:........%s\n" |
288 |
- "First allocation block:.......%llu\n"), |
289 |
+ "First allocation block:.......%"PRIu64"\n"), |
290 |
szText, m_info.qwAllocCount, m_info.dwBlocksPerAlloc, |
291 |
formatSize(m_info.dwAllocSize,szTemp1), m_info.qwFirstAllocBlock); |
292 |
|
293 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_ntfs.cpp |
294 |
--- a/src/client/fs/fs_ntfs.cpp Tue Sep 04 21:36:14 2007 +0200 |
295 |
+++ b/src/client/fs/fs_ntfs.cpp Tue Sep 04 21:43:30 2007 +0200 |
296 |
@@ -18,6 +18,9 @@ |
297 |
#include "partimage.h" |
298 |
#include "imagefile.h" |
299 |
#include "fs_ntfs.h" |
300 |
+ |
301 |
+#define __STDC_FORMAT_MACROS |
302 |
+#include <inttypes.h> |
303 |
|
304 |
// ======================================================= |
305 |
CNtfsPart::CNtfsPart(char *szDevice, FILE *fDeviceFile, QWORD qwPartSize): CFSBase(szDevice, fDeviceFile, qwPartSize) |
306 |
@@ -308,8 +311,8 @@ void CNtfsPart::printfInformations() |
307 |
SNPRINTF(szFullText, i18n("%s" // standard infos |
308 |
"Bytes per sector..............%u\n" |
309 |
"Sectors per cluster...........%u\n" |
310 |
- "File record size..............%lu\n" |
311 |
- "LCN of MFT Data attrib........%llu\n"), |
312 |
+ "File record size..............%u\n" |
313 |
+ "LCN of MFT Data attrib........%"PRIu64"\n"), |
314 |
szText, m_info.nBytesPerSector, m_info.cSectorsPerCluster, |
315 |
m_info.dwFileRecordSize, m_info.qwLCNOfMftDataAttrib); |
316 |
|
317 |
@@ -726,7 +729,7 @@ void CNtfsRunList::show() |
318 |
QWORD i; |
319 |
|
320 |
for (i=0L; i < m_qwClustersCount; i++) |
321 |
- fprintf(stderr, "cluster[%llu] = %llu\n", i, m_qwOffset[i]); |
322 |
+ fprintf(stderr, "cluster[%llu] = %"PRIu64"\n", i, m_qwOffset[i]); |
323 |
|
324 |
} |
325 |
|
326 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_ufs.cpp |
327 |
--- a/src/client/fs/fs_ufs.cpp Tue Sep 04 21:36:14 2007 +0200 |
328 |
+++ b/src/client/fs/fs_ufs.cpp Tue Sep 04 21:43:30 2007 +0200 |
329 |
@@ -25,6 +25,9 @@ |
330 |
#include <stdio.h> |
331 |
#include <string.h> |
332 |
#include <stdlib.h> |
333 |
+ |
334 |
+#define __STDC_FORMAT_MACROS |
335 |
+#include <inttypes.h> |
336 |
|
337 |
#include "fs_ufs.h" |
338 |
#include "partimage.h" |
339 |
@@ -210,11 +213,11 @@ void CUfsPart::printfInformations() |
340 |
getStdInfos(szText, sizeof(szText), true); |
341 |
|
342 |
SNPRINTF(szFullText, i18n("%s" // standard infos |
343 |
- "Cylinder groups count:........%lu\n" |
344 |
+ "Cylinder groups count:........%u\n" |
345 |
"Cylinder group size:..........%s\n" |
346 |
- "Basic blocks per CG:..........%lu\n" |
347 |
- "Basic block size:.............%lu\n" |
348 |
- "Data frags count:.............%llu\n"), |
349 |
+ "Basic blocks per CG:..........%u\n" |
350 |
+ "Basic block size:.............%u\n" |
351 |
+ "Data frags count:.............%"PRIu64"\n"), |
352 |
szText, m_info.dwCylinderGroupsCount, |
353 |
formatSize(m_info.dwCylinderGroupSize*m_info.dwBasicBlockSize,szTemp1), |
354 |
m_info.dwCylinderGroupSize, m_info.dwBasicBlockSize, m_info.qwDataFrags); |
355 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_xfs.cpp |
356 |
--- a/src/client/fs/fs_xfs.cpp Tue Sep 04 21:36:14 2007 +0200 |
357 |
+++ b/src/client/fs/fs_xfs.cpp Tue Sep 04 21:43:30 2007 +0200 |
358 |
@@ -208,8 +208,8 @@ void CXfsPart::printfInformations() |
359 |
getStdInfos(szText, sizeof(szText), true); |
360 |
|
361 |
SNPRINTF(szFullText, i18n("%s" // standard infos |
362 |
- "Allocation Group count:.......%lu\n" |
363 |
- "Blocks per Allocation Group...%lu\n" |
364 |
+ "Allocation Group count:.......%u\n" |
365 |
+ "Blocks per Allocation Group...%u\n" |
366 |
"Allocation Group size:........%s\n"), |
367 |
szText, m_info.dwAgCount, m_info.dwAgBlocksCount, |
368 |
formatSize(m_info.dwAgBlocksCount*m_header.qwBlockSize,szTemp1)); |
369 |
@@ -300,7 +300,7 @@ char* blocknum(char *szBuffer, DWORD dwB |
370 |
char* blocknum(char *szBuffer, DWORD dwBn) |
371 |
{ |
372 |
if (dwBn != NULLAGBLOCK) |
373 |
- sprintf(szBuffer, "%lu", dwBn); |
374 |
+ sprintf(szBuffer, "%u", dwBn); |
375 |
else |
376 |
sprintf(szBuffer, "NULLAGBLOCK"); |
377 |
return szBuffer; |
378 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/gui_text.cpp |
379 |
--- a/src/client/gui_text.cpp Tue Sep 04 21:36:14 2007 +0200 |
380 |
+++ b/src/client/gui_text.cpp Tue Sep 04 21:43:30 2007 +0200 |
381 |
@@ -29,6 +29,8 @@ |
382 |
#include <stdlib.h> |
383 |
#include <errno.h> |
384 |
|
385 |
+#define __STDC_FORMAT_MACROS |
386 |
+#include <inttypes.h> |
387 |
// ======================================================= |
388 |
void CRestoreMbrWindow::addHardDisk(char *szText, DWORD dwNumber) |
389 |
{ |
390 |
@@ -81,12 +83,12 @@ int CRestoreMbrWindow::create() |
391 |
} |
392 |
|
393 |
// ======================================================= |
394 |
-void CRestoreMbrWindow::getValues(DWORD *dwCurrentMbrNb, DWORD *dwOriginalMbrNb, int *nRestoreMode) |
395 |
-{ |
396 |
- BEGIN; |
397 |
- |
398 |
- *dwCurrentMbrNb = (DWORD) newtListboxGetCurrent(m_list1); |
399 |
- *dwOriginalMbrNb = (DWORD) newtListboxGetCurrent(m_list2); |
400 |
+void CRestoreMbrWindow::getValues(uintptr_t *dwCurrentMbrNb, uintptr_t *dwOriginalMbrNb, int *nRestoreMode) |
401 |
+{ |
402 |
+ BEGIN; |
403 |
+ |
404 |
+ *dwCurrentMbrNb = (uintptr_t) newtListboxGetCurrent(m_list1); |
405 |
+ *dwOriginalMbrNb = (uintptr_t) newtListboxGetCurrent(m_list2); |
406 |
|
407 |
if (newtRadioGetCurrent(m_radioFull) == m_radioFull) |
408 |
*nRestoreMode = MBR_RESTORE_WHOLE; |
409 |
@@ -339,7 +341,7 @@ int CSaveOptWindow::create(char *szImage |
410 |
m_labelSplit = newtLabel(1, 12, i18n("Image split mode")); |
411 |
m_radioSplitAuto = newtRadiobutton(1, 13, i18n("Automatic split (when no space left)"), !options.qwSplitSize, NULL); |
412 |
m_radioSplitSize = newtRadiobutton(1, 14, i18n("Into files whose size is:............"), !!options.qwSplitSize, m_radioSplitAuto); |
413 |
- SNPRINTF(szTemp, "%llu", (!!options.qwSplitSize) ? (options.qwSplitSize/1024/1024) : 2048); |
414 |
+ SNPRINTF(szTemp, "%"PRIu64"", (!!options.qwSplitSize) ? (options.qwSplitSize/1024/1024) : 2048); |
415 |
m_editSplitSize = newtEntry(43, 14, szTemp, 8, NULL, 0); |
416 |
m_labelSplitSizeKB = newtLabel(52, 14, i18n("MiB")); |
417 |
m_checkSplitWait = newtCheckbox(1, 15, i18n("Wait after each volume change"), (!!options.bSplitWait ? 'X' : ' '), " X", NULL); |
418 |
@@ -460,7 +462,7 @@ int CSavingWindow::create(const char *sz |
419 |
SNPRINTF(szTemp, i18n("Partition to save:...........%s"), szDevice); |
420 |
m_labelPartition = newtLabel(1, 0, szTemp); |
421 |
|
422 |
- SNPRINTF(szTemp, i18n("Size of the Partition:.......%s = %llu bytes"), formatSize(qwPartSize, szTemp2), qwPartSize); |
423 |
+ SNPRINTF(szTemp, i18n("Size of the Partition:.......%s = %"PRIu64" bytes"), formatSize(qwPartSize, szTemp2), qwPartSize); |
424 |
m_labelPartitionSize = newtLabel(1, 1, szTemp); |
425 |
|
426 |
SNPRINTF(szTemp, i18n("Image file to create.........%s"), szImageFile); |
427 |
@@ -608,7 +610,7 @@ void CSavingWindow::showImageFileInfo(ch |
428 |
newtLabelSetText(m_labelImageFileSize, szTemp); |
429 |
} |
430 |
|
431 |
- SNPRINTF (szTemp, i18n("Available space for image:...%s = %llu bytes"), formatSize(qwFreeSpace, szTemp2), qwFreeSpace); |
432 |
+ SNPRINTF (szTemp, i18n("Available space for image:...%s = %"PRIu64" bytes"), formatSize(qwFreeSpace, szTemp2), qwFreeSpace); |
433 |
newtLabelSetText(m_labelFreeSpace, szTemp); |
434 |
|
435 |
//option -B gui=no |
436 |
@@ -696,8 +698,27 @@ int CRestoreOptWindow::getValues(COption |
437 |
RETURN_int(0); |
438 |
} |
439 |
|
440 |
-// ======================================================= |
441 |
-int CRestoringWindow::create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, tm dateCreate, QWORD qwOrigPartSize, COptions * options) |
442 |
+static char *asctime_portable (const struct portable_tm *__tp) |
443 |
+{ |
444 |
+struct tm tms; |
445 |
+ |
446 |
+ tms.tm_sec=__tp->tm_sec; |
447 |
+ tms.tm_min=__tp->tm_min; |
448 |
+ tms.tm_hour=__tp->tm_hour; |
449 |
+ tms.tm_mday=__tp->tm_mday; |
450 |
+ tms.tm_mon=__tp->tm_mon; |
451 |
+ tms.tm_year=__tp->tm_year; |
452 |
+ tms.tm_wday=__tp->tm_wday; |
453 |
+ tms.tm_yday=__tp->tm_yday; |
454 |
+ tms.tm_isdst=__tp->tm_isdst; |
455 |
+ tms.tm_gmtoff=__tp->tm_gmtoff; |
456 |
+ tms.tm_zone="UTC"; |
457 |
+ |
458 |
+ return asctime (&tms); |
459 |
+} |
460 |
+ |
461 |
+// ======================================================= |
462 |
+int CRestoringWindow::create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, struct portable_tm dateCreate, QWORD qwOrigPartSize, COptions * options) |
463 |
{ |
464 |
BEGIN; |
465 |
|
466 |
@@ -713,7 +734,7 @@ int CRestoringWindow::create(char *szDev |
467 |
SNPRINTF(szTemp, i18n("Partition to restore:.............%s"), szDevice); |
468 |
m_labelPartition = newtLabel(1, 0, szTemp); |
469 |
|
470 |
- SNPRINTF(szTemp, i18n("Size of partition to restore:.....%s = %llu bytes"), formatSize(qwCurPartSize, szTemp2), qwCurPartSize); |
471 |
+ SNPRINTF(szTemp, i18n("Size of partition to restore:.....%s = %"PRIu64" bytes"), formatSize(qwCurPartSize, szTemp2), qwCurPartSize); |
472 |
m_labelPartitionSize = newtLabel(1, 1, szTemp); |
473 |
|
474 |
SNPRINTF(szTemp, i18n("Image file to use.................%s"), szImageFile); |
475 |
@@ -727,10 +748,10 @@ int CRestoringWindow::create(char *szDev |
476 |
SNPRINTF(szTemp, i18n("Partition was on device:..........%s\n"), szOriginalDevice); |
477 |
m_labelOldDevice = newtLabel(1, 5, szTemp); |
478 |
|
479 |
- SNPRINTF(szTemp, i18n("Image created on:.................%s\n"), asctime(&dateCreate)); |
480 |
+ SNPRINTF(szTemp, i18n("Image created on:.................%s\n"), asctime_portable(&dateCreate)); |
481 |
m_labelDate = newtLabel(1, 6, szTemp); |
482 |
|
483 |
- SNPRINTF(szTemp, i18n("Size of the original partition:...%s = %llu bytes"), formatSize(qwOrigPartSize, szTemp2), qwOrigPartSize); |
484 |
+ SNPRINTF(szTemp, i18n("Size of the original partition:...%s = %"PRIu64" bytes"), formatSize(qwOrigPartSize, szTemp2), qwOrigPartSize); |
485 |
m_labelOriginalPartitionSize = newtLabel(1, 7, szTemp); |
486 |
|
487 |
// stats |
488 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/gui_text.h |
489 |
--- a/src/client/gui_text.h Tue Sep 04 21:36:14 2007 +0200 |
490 |
+++ b/src/client/gui_text.h Tue Sep 04 21:43:30 2007 +0200 |
491 |
@@ -56,7 +56,7 @@ class CRestoreMbrWindow: public COptions |
492 |
void addMbr(char *szText, DWORD dwNumber); |
493 |
//int runForm(); |
494 |
//void destroyForm(); |
495 |
- void getValues(DWORD *dwCurrentMbrNb, DWORD *dwOriginalMbrNb, int *nRestoreMode); |
496 |
+ void getValues(uintptr_t *dwCurrentMbrNb, uintptr_t *dwOriginalMbrNb, int *nRestoreMode); |
497 |
|
498 |
private: |
499 |
//newtComponent m_formMain; |
500 |
@@ -124,7 +124,7 @@ class CRestoringWindow |
501 |
class CRestoringWindow |
502 |
{ |
503 |
public: |
504 |
- int create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, tm dateCreate, QWORD qwOrigPartSize, COptions * options); |
505 |
+ int create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, struct portable_tm dateCreate, QWORD qwOrigPartSize, COptions * options); |
506 |
int runForm(); |
507 |
void destroyForm(); |
508 |
void showImageFileInfo(char *szImageFile, int nCompressionMode, char *szFullyBatchMode); |
509 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/imagefile.cpp |
510 |
--- a/src/client/imagefile.cpp Tue Sep 04 21:36:14 2007 +0200 |
511 |
+++ b/src/client/imagefile.cpp Tue Sep 04 21:43:30 2007 +0200 |
512 |
@@ -488,7 +488,7 @@ void CImage::splitChangeImageFileWrite() |
513 |
} |
514 |
|
515 |
set_dwVolumeNumber(get_dwVolumeNumber()+1); // increase the volume number |
516 |
- SNPRINTF(aux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
517 |
+ SNPRINTF(aux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
518 |
//*(aux+MAXPATHLEN-1) = '\0'; |
519 |
|
520 |
set_szImageFilename(aux); |
521 |
@@ -514,7 +514,7 @@ void CImage::splitChangeImageFileRead() |
522 |
|
523 |
// increase volume number |
524 |
set_dwVolumeNumber(get_dwVolumeNumber()+1); |
525 |
- SNPRINTF(aux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
526 |
+ SNPRINTF(aux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
527 |
//*(aux+MAXPATHLEN-1) = '\0'; |
528 |
set_szImageFilename(aux); |
529 |
|
530 |
@@ -700,7 +700,7 @@ int CImage::openWritingFdDisk() |
531 |
set_szPath(aux2); |
532 |
extractFilenameFromFullPath(szAux, aux2); // filename without path |
533 |
set_szOriginalFilename(aux2); |
534 |
- SNPRINTF(szAux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
535 |
+ SNPRINTF(szAux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
536 |
set_szImageFilename(szAux); |
537 |
nRes = openWritingFdDisk(); |
538 |
RETURN_int(nRes); |
539 |
@@ -728,7 +728,7 @@ int CImage::openWritingFdDisk() |
540 |
case ERR_RETRY: |
541 |
strcpy(szAux, excep->getNewString()); // endding '/' were removed |
542 |
set_szPath(szAux); |
543 |
- SNPRINTF(aux2, "%s/%s.%.3ld", szAux, get_szOriginalFilename(), |
544 |
+ SNPRINTF(aux2, "%s/%s.%.3d", szAux, get_szOriginalFilename(), |
545 |
get_dwVolumeNumber()); |
546 |
set_szImageFilename(aux2); |
547 |
|
548 |
@@ -1068,7 +1068,7 @@ void CImage::openReading(CVolumeHeader * |
549 |
set_szPath(aux2); |
550 |
extractFilenameFromFullPath(szAux, aux2); |
551 |
set_szOriginalFilename(aux2); |
552 |
- SNPRINTF(szAux, "%s/%s.%.3ld", get_szPath(), |
553 |
+ SNPRINTF(szAux, "%s/%s.%.3d", get_szPath(), |
554 |
get_szOriginalFilename(), get_dwVolumeNumber()); |
555 |
set_szImageFilename(szAux); |
556 |
umountImageLocation(); |
557 |
@@ -1132,7 +1132,7 @@ void CImage::openReading(CVolumeHeader * |
558 |
|
559 |
if (strcmp(headVolume.szMagicString, MAGIC_BEGIN_VOLUME) != 0) |
560 |
{ |
561 |
- SNPRINTF(szAux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
562 |
+ SNPRINTF(szAux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber()); |
563 |
THROW(ERR_NOTAPARTIMAGEFILE, szAux); |
564 |
} |
565 |
|
566 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/imginfo.cpp |
567 |
--- a/src/client/imginfo.cpp Tue Sep 04 21:36:14 2007 +0200 |
568 |
+++ b/src/client/imginfo.cpp Tue Sep 04 21:43:30 2007 +0200 |
569 |
@@ -26,6 +26,29 @@ |
570 |
#include "imagefile.h" |
571 |
#include "interface_newt.h" |
572 |
|
573 |
+#define __STDC_FORMAT_MACROS |
574 |
+#include <inttypes.h> |
575 |
+ |
576 |
+static char *asctime_portable (const struct portable_tm *__tp) |
577 |
+{ |
578 |
+struct tm tms; |
579 |
+ |
580 |
+ tms.tm_sec=__tp->tm_sec; |
581 |
+ tms.tm_min=__tp->tm_min; |
582 |
+ tms.tm_hour=__tp->tm_hour; |
583 |
+ tms.tm_mday=__tp->tm_mday; |
584 |
+ tms.tm_mon=__tp->tm_mon; |
585 |
+ tms.tm_year=__tp->tm_year; |
586 |
+ tms.tm_wday=__tp->tm_wday; |
587 |
+ tms.tm_yday=__tp->tm_yday; |
588 |
+ tms.tm_isdst=__tp->tm_isdst; |
589 |
+ tms.tm_gmtoff=__tp->tm_gmtoff; |
590 |
+ tms.tm_zone="UTC"; |
591 |
+ |
592 |
+ return asctime (&tms); |
593 |
+} |
594 |
+ |
595 |
+ |
596 |
// ======================================================= |
597 |
void imageInfoShowRegular(char *szText, int nMaxTextLen, CMainHeader *head, char *szImagefile, DWORD dwCompression) |
598 |
{ |
599 |
@@ -65,20 +88,20 @@ void imageInfoShowRegular(char *szText, |
600 |
"Description:...........%s\n" |
601 |
"Original device:.......%s\n" |
602 |
"Original filepath:.... %s\n" |
603 |
- "Flags:.................%ld: %s\n" |
604 |
+ "Flags:.................%d: %s\n" |
605 |
"Creation date:.........%s" |
606 |
"Partition size:........%s\n" |
607 |
"Hostname:..............%s\n" |
608 |
"Compatible Version:....%s\n" |
609 |
- "Encryption algorithm:..%ld -> %s\n" |
610 |
- "MBR saved count:.......%lu\n\n" |
611 |
+ "Encryption algorithm:..%d -> %s\n" |
612 |
+ "MBR saved count:.......%u\n\n" |
613 |
"System of the backup:\n" |
614 |
"- machine:.............%s\n" |
615 |
"- operating system:....%s\n" |
616 |
"- release:.............%s\n" |
617 |
"\n\n"), |
618 |
head->szFileSystem, szDescription, head->szOriginalDevice, head->szFirstImageFilepath, |
619 |
- head->dwMainFlags, szFlags, asctime(&head->dateCreate), formatSize(head->qwPartSize, cTemp), head->szHostname, |
620 |
+ head->dwMainFlags, szFlags, asctime_portable(&head->dateCreate), formatSize(head->qwPartSize, cTemp), head->szHostname, |
621 |
head->szVersion, head->dwEncryptAlgo, szEncryption, head->dwMbrCount, head->szUnameMachine, |
622 |
head->szUnameSysname, head->szUnameRelease); |
623 |
} |
624 |
@@ -88,7 +111,7 @@ void imageInfoShowMBR(char *szText, int |
625 |
{ |
626 |
snprintf(szText, nMaxTextLen, i18n("-------------------- MBR %.3d -------------------\n" |
627 |
"Device:................%s\n" |
628 |
- "Device blocks count:...%llu\n" |
629 |
+ "Device blocks count:...%"PRIu64"\n" |
630 |
"Device model:..........%s\n\n"), |
631 |
i, mbr->szDevice, mbr->qwBlocksCount, mbr->szDescModel); |
632 |
} |
633 |
@@ -127,10 +150,10 @@ void imageInfoShowVolume(char *szText, i |
634 |
break; |
635 |
} |
636 |
|
637 |
- snprintf(szText, nMaxTextLen, i18n("Volume number:.........%lu\n" |
638 |
+ snprintf(szText, nMaxTextLen, i18n("Volume number:.........%u\n" |
639 |
"Volume size:...........%s\n" |
640 |
- "Compression level: ....%ld -> %s\n" |
641 |
- "Identificator:.........%llu=%llX\n\n"), |
642 |
+ "Compression level: ....%d -> %s\n" |
643 |
+ "Identificator:.........%"PRIu64"=%"PRIX64"\n\n"), |
644 |
head->dwVolumeNumber, formatSize(qwImageSize, cTemp), dwCompression, |
645 |
szCompression, head->qwIdentificator, head->qwIdentificator); |
646 |
} |
647 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/interface_newt.cpp |
648 |
--- a/src/client/interface_newt.cpp Tue Sep 04 21:36:14 2007 +0200 |
649 |
+++ b/src/client/interface_newt.cpp Tue Sep 04 21:43:30 2007 +0200 |
650 |
@@ -239,7 +239,7 @@ int CInterfaceNewt::guiInitMainWindow(ch |
651 |
labelNetwork = newtLabel(5, 18, i18n("IP/name of the server:")); |
652 |
editNetwork = newtEntry(28, 18, szNetworkIP, 25, NULL, 0); |
653 |
labelPort = newtLabel(54, 18, i18n("Port:")); |
654 |
- SNPRINTF(szTemp, "%lu", *dwServerPort); |
655 |
+ SNPRINTF(szTemp, "%u", *dwServerPort); |
656 |
editPort = newtEntry(60, 18, szTemp, 6, NULL, 0); |
657 |
|
658 |
btnContinue = newtCompactButton(50, 12, i18n("Next (F5)")); |
659 |
@@ -473,7 +473,7 @@ WORD CInterfaceNewt::askNewPath(char * s |
660 |
char szMess[2048]; |
661 |
|
662 |
SNPRINTF(szMess, i18n("Disk full! Can't write next volume file " |
663 |
- "(%s.%.3ld)\nto %s\nPlease, enter another directory path " |
664 |
+ "(%s.%.3d)\nto %s\nPlease, enter another directory path " |
665 |
"(without filename):"), szOrigFilename, dwVolume, szPath); |
666 |
//*(szMess+2047) = '\0'; |
667 |
|
668 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/main.cpp |
669 |
--- a/src/client/main.cpp Tue Sep 04 21:36:14 2007 +0200 |
670 |
+++ b/src/client/main.cpp Tue Sep 04 21:43:30 2007 +0200 |
671 |
@@ -29,6 +29,10 @@ |
672 |
#include <stdlib.h> |
673 |
#include <stdio.h> |
674 |
#include <unistd.h> |
675 |
+ |
676 |
+#define __STDC_FORMAT_MACROS |
677 |
+#include <inttypes.h> |
678 |
+ |
679 |
#include <sched.h> |
680 |
#include <sys/types.h> |
681 |
#include <sys/param.h> |
682 |
@@ -278,7 +282,7 @@ int main(int argc, char *argv[]) |
683 |
case 'V': // split image into multiple files |
684 |
|
685 |
options.qwSplitSize = (QWORD)atol(optarg) * 1024 * 1024; |
686 |
- fprintf (stderr, i18n("Volume size: %llu bytes (%ld MiB)\n"), |
687 |
+ fprintf (stderr, i18n("Volume size: %"PRIu64" bytes (%ld MiB)\n"), |
688 |
options.qwSplitSize, atol(optarg)); |
689 |
break; |
690 |
|
691 |
@@ -971,15 +975,15 @@ int checkStructSizes() |
692 |
{ |
693 |
// ---- check types sizes |
694 |
|
695 |
- if (sizeof(unsigned long int) != 4) |
696 |
+ if (sizeof(DWORD) != 4) |
697 |
{ |
698 |
- fprintf (stderr, "Error: sizeof(DWORD) != 4 (%d)\n", sizeof(unsigned long int)); |
699 |
- goto errcheck; |
700 |
- } |
701 |
- |
702 |
- if (sizeof(unsigned long long int) != 8) |
703 |
+ fprintf (stderr, "Error: sizeof(DWORD) != 4 (%zd)\n", sizeof(DWORD)); |
704 |
+ goto errcheck; |
705 |
+ } |
706 |
+ |
707 |
+ if (sizeof(QWORD) != 8) |
708 |
{ |
709 |
- fprintf (stderr, "Error: sizeof(QWORD) != 8 (%d)\n", sizeof(unsigned long long int)); |
710 |
+ fprintf (stderr, "Error: sizeof(QWORD) != 8 (%zd)\n", sizeof(QWORD)); |
711 |
goto errcheck; |
712 |
} |
713 |
|
714 |
@@ -988,7 +992,7 @@ int checkStructSizes() |
715 |
// check main header size is 16384 |
716 |
if (sizeof(CMainHeader) != 16384) |
717 |
{ |
718 |
- fprintf (stderr, "Error: main header size != 16384 (%d)\n", |
719 |
+ fprintf (stderr, "Error: main header size != 16384 (%zd)\n", |
720 |
sizeof(CMainHeader)); |
721 |
goto errcheck; |
722 |
} |
723 |
@@ -996,7 +1000,7 @@ int checkStructSizes() |
724 |
// check ext2 header size is 16384 |
725 |
if (sizeof(CInfoExt2Header) != INFOS_STRUCT_SIZE) |
726 |
{ |
727 |
- fprintf (stderr, "Error: ext2 header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
728 |
+ fprintf (stderr, "Error: ext2 header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
729 |
sizeof(CInfoExt2Header)); |
730 |
goto errcheck; |
731 |
} |
732 |
@@ -1004,7 +1008,7 @@ int checkStructSizes() |
733 |
// check reiserfs header size is 16384 |
734 |
if (sizeof(CInfoReiserHeader) != INFOS_STRUCT_SIZE) |
735 |
{ |
736 |
- fprintf (stderr, "Error: reiserfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
737 |
+ fprintf (stderr, "Error: reiserfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
738 |
sizeof(CInfoReiserHeader)); |
739 |
goto errcheck; |
740 |
} |
741 |
@@ -1012,7 +1016,7 @@ int checkStructSizes() |
742 |
// check fat header size is 16384 |
743 |
if (sizeof(CInfoFatHeader) != INFOS_STRUCT_SIZE) |
744 |
{ |
745 |
- fprintf (stderr, "Error: fat header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
746 |
+ fprintf (stderr, "Error: fat header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
747 |
sizeof(CInfoFatHeader)); |
748 |
goto errcheck; |
749 |
} |
750 |
@@ -1020,7 +1024,7 @@ int checkStructSizes() |
751 |
// check ntfs header size is 16384 |
752 |
if (sizeof(CInfoNtfsHeader) != INFOS_STRUCT_SIZE) |
753 |
{ |
754 |
- fprintf (stderr, "Error: ntfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
755 |
+ fprintf (stderr, "Error: ntfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
756 |
sizeof(CInfoNtfsHeader)); |
757 |
goto errcheck; |
758 |
} |
759 |
@@ -1028,7 +1032,7 @@ int checkStructSizes() |
760 |
// check hpfs header size is 16384 |
761 |
if (sizeof(CInfoHpfsHeader) != INFOS_STRUCT_SIZE) |
762 |
{ |
763 |
- fprintf (stderr, "Error: hpfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
764 |
+ fprintf (stderr, "Error: hpfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
765 |
sizeof(CInfoHpfsHeader)); |
766 |
goto errcheck; |
767 |
} |
768 |
@@ -1036,7 +1040,7 @@ int checkStructSizes() |
769 |
// check jfs header size is 16384 |
770 |
if (sizeof(CInfoJfsHeader) != INFOS_STRUCT_SIZE) |
771 |
{ |
772 |
- fprintf (stderr, "Error: jfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
773 |
+ fprintf (stderr, "Error: jfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
774 |
sizeof(CInfoJfsHeader)); |
775 |
goto errcheck; |
776 |
} |
777 |
@@ -1044,7 +1048,7 @@ int checkStructSizes() |
778 |
// check xfs header size is 16384 |
779 |
if (sizeof(CInfoXfsHeader) != INFOS_STRUCT_SIZE) |
780 |
{ |
781 |
- fprintf (stderr, "Error: xfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
782 |
+ fprintf (stderr, "Error: xfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
783 |
sizeof(CInfoXfsHeader)); |
784 |
goto errcheck; |
785 |
} |
786 |
@@ -1052,7 +1056,7 @@ int checkStructSizes() |
787 |
// check hfs header size is 16384 |
788 |
if (sizeof(CInfoHfsHeader) != INFOS_STRUCT_SIZE) |
789 |
{ |
790 |
- fprintf (stderr, "Error: hfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
791 |
+ fprintf (stderr, "Error: hfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE, |
792 |
sizeof(CInfoHfsHeader)); |
793 |
goto errcheck; |
794 |
} |
795 |
@@ -1060,36 +1064,39 @@ int checkStructSizes() |
796 |
// check ufs header size is 16384 |
797 |
if (sizeof(CInfoUfsHeader) != INFOS_STRUCT_SIZE) |
798 |
{ |
799 |
- fprintf (stderr, "Error: jfs header size != %d (%d)\n", INFOS_STRUCT_SIZE, |
800 |
- sizeof(CInfoUfsHeader)); |
801 |
+ fprintf (stderr, "Error: jfs header size != %d (%zd)\n", |
802 |
+ INFOS_STRUCT_SIZE, sizeof(CInfoUfsHeader)); |
803 |
goto errcheck; |
804 |
} |
805 |
|
806 |
// check tail size is 16384 |
807 |
if (sizeof(CMainTail) != 16384) |
808 |
{ |
809 |
- fprintf (stderr, "Error: main footer size != 16384 (%d)\n", sizeof(CMainTail)); |
810 |
+ fprintf (stderr, "Error: main footer size != 16384 (%zd)\n", |
811 |
+ sizeof(CMainTail)); |
812 |
goto errcheck; |
813 |
} |
814 |
|
815 |
// check volume header size is 512 |
816 |
if (sizeof(CVolumeHeader) != 512) |
817 |
{ |
818 |
- fprintf (stderr, "Error: volume hedaer size != 512 (%d)\n", sizeof(CVolumeHeader)); |
819 |
+ fprintf (stderr, "Error: volume hedaer size != 512 (%zd)\n", |
820 |
+ sizeof(CVolumeHeader)); |
821 |
goto errcheck; |
822 |
} |
823 |
|
824 |
// check MBR size is 2048 |
825 |
if (sizeof(CMbr) != 2048) |
826 |
{ |
827 |
- fprintf (stderr, "Error: MBR size != 2048 (%d)\n", sizeof(CMbr)); |
828 |
+ fprintf (stderr, "Error: MBR size != 2048 (%zd)\n", sizeof(CMbr)); |
829 |
goto errcheck; |
830 |
} |
831 |
|
832 |
// check volume header size is 512 |
833 |
if (sizeof(CLocalHeader) != 16384) |
834 |
{ |
835 |
- fprintf (stderr, "Error: local header size != 16384 (%d)\n", sizeof(CLocalHeader)); |
836 |
+ fprintf (stderr, "Error: local header size != 16384 (%zd)\n", |
837 |
+ sizeof(CLocalHeader)); |
838 |
goto errcheck; |
839 |
} |
840 |
|
841 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/mbr_backup.cpp |
842 |
--- a/src/client/mbr_backup.cpp Tue Sep 04 21:36:14 2007 +0200 |
843 |
+++ b/src/client/mbr_backup.cpp Tue Sep 04 21:43:30 2007 +0200 |
844 |
@@ -164,7 +164,7 @@ int mbrParseProcPart(char *szHdList, int |
845 |
//if (isDriveReady(szTemp)) |
846 |
{ |
847 |
nCount++; // number of hard disks |
848 |
- SNPRINTF(szTemp, "/dev/%s#%lu#",szDevice, (DWORD)nBlocks); |
849 |
+ SNPRINTF(szTemp, "/dev/%s#%u#",szDevice, (DWORD)nBlocks); |
850 |
if (szHdList) |
851 |
strncat(szHdList, szTemp, nMaxLen); |
852 |
} |
853 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/misc.cpp |
854 |
--- a/src/client/misc.cpp Tue Sep 04 21:36:14 2007 +0200 |
855 |
+++ b/src/client/misc.cpp Tue Sep 04 21:43:30 2007 +0200 |
856 |
@@ -22,6 +22,8 @@ |
857 |
#include <stdio.h> |
858 |
#include <stdlib.h> |
859 |
#include <unistd.h> |
860 |
+#define __STDC_FORMAT_MACROS |
861 |
+#include <inttypes.h> |
862 |
|
863 |
#ifdef HAVE_SYS_PARAM_H |
864 |
#include <sys/param.h> |
865 |
@@ -88,8 +90,8 @@ void restoreMbr(char *szImageFile, COpti |
866 |
|
867 |
CRestoreMbrWindow optGui; |
868 |
DWORD dwDiskCount; |
869 |
- DWORD dwOriginalMbrNb; |
870 |
- DWORD dwCurrentMbrNb; |
871 |
+ uintptr_t dwOriginalMbrNb; |
872 |
+ uintptr_t dwCurrentMbrNb; |
873 |
char szHdList[2048]; |
874 |
char szTemp[512]; |
875 |
char szTemp2[512]; |
876 |
@@ -209,7 +211,7 @@ void restoreMbr(char *szImageFile, COpti |
877 |
image.closeReading(true); |
878 |
throw excep; |
879 |
} |
880 |
- SNPRINTF(szTemp, "%.3lu: %s [%llu blocks]", i, mbrOriginal[i].szDevice, mbrOriginal[i].qwBlocksCount); |
881 |
+ SNPRINTF(szTemp, "%.3u: %s [%"PRIu64" blocks]", i, mbrOriginal[i].szDevice, mbrOriginal[i].qwBlocksCount); |
882 |
if (options->bBatchMode == false) |
883 |
optGui.addMbr(szTemp, i); |
884 |
|
885 |
@@ -319,6 +321,28 @@ void restoreMbr(char *szImageFile, COpti |
886 |
THROW(ERR_ERRNO, errno); |
887 |
|
888 |
RETURN; |
889 |
+} |
890 |
+ |
891 |
+struct portable_tm *localtime_portable (const time_t *__timer) |
892 |
+{ |
893 |
+static struct portable_tm ret; |
894 |
+struct tm *host_tm; |
895 |
+ |
896 |
+ host_tm=localtime (__timer); |
897 |
+ ret.tm_sec=host_tm->tm_sec; |
898 |
+ ret.tm_min=host_tm->tm_min; |
899 |
+ ret.tm_hour=host_tm->tm_hour; |
900 |
+ ret.tm_mday=host_tm->tm_mday; |
901 |
+ ret.tm_mon=host_tm->tm_mon; |
902 |
+ ret.tm_year=host_tm->tm_year; |
903 |
+ ret.tm_wday=host_tm->tm_wday; |
904 |
+ ret.tm_yday=host_tm->tm_yday; |
905 |
+ ret.tm_isdst=host_tm->tm_isdst; |
906 |
+ |
907 |
+ ret.tm_gmtoff=host_tm->tm_gmtoff; |
908 |
+ ret.tm_zone=0; |
909 |
+ |
910 |
+ return &ret; |
911 |
} |
912 |
|
913 |
// ======================================================= |
914 |
@@ -467,7 +491,7 @@ void savePartition(char *szDevice, char |
915 |
time(&dt); |
916 |
|
917 |
// current time/date (date of image creation) |
918 |
- headMain.dateCreate = *localtime(&dt); |
919 |
+ headMain.dateCreate = *localtime_portable(&dt); |
920 |
|
921 |
// file format version |
922 |
strcpy(headMain.szVersion, CURRENT_IMAGE_FORMAT); |
923 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/partimage.h |
924 |
--- a/src/client/partimage.h Tue Sep 04 21:36:14 2007 +0200 |
925 |
+++ b/src/client/partimage.h Tue Sep 04 21:43:30 2007 +0200 |
926 |
@@ -21,6 +21,7 @@ |
927 |
#include <errno.h> |
928 |
#include <libintl.h> // intl translation |
929 |
#include <stdio.h> |
930 |
+#include <stdint.h> |
931 |
#include <time.h> |
932 |
|
933 |
#ifdef HAVE_CONFIG_H |
934 |
@@ -53,10 +54,10 @@ extern time_t g_timeEnd; // End of the |
935 |
extern time_t g_timeEnd; // End of the operation |
936 |
|
937 |
typedef bool BOOL; // variant size |
938 |
-typedef unsigned char BYTE; // 8 bits |
939 |
-typedef unsigned short int WORD; // 16 bits |
940 |
-typedef unsigned long int DWORD; // 32 bits |
941 |
-typedef unsigned long long int QWORD; // 64 bits |
942 |
+typedef uint8_t BYTE; // 8 bits |
943 |
+typedef uint16_t WORD; // 16 bits |
944 |
+typedef uint32_t DWORD; // 32 bits |
945 |
+typedef uint64_t QWORD; // 64 bits |
946 |
|
947 |
#include "endianess.h" |
948 |
|
949 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/shared/common.cpp |
950 |
--- a/src/shared/common.cpp Tue Sep 04 21:36:14 2007 +0200 |
951 |
+++ b/src/shared/common.cpp Tue Sep 04 21:43:30 2007 +0200 |
952 |
@@ -23,6 +23,9 @@ |
953 |
#include <stdlib.h> |
954 |
#include <ctype.h> |
955 |
#include <fcntl.h> |
956 |
+ |
957 |
+#define __STDC_FORMAT_MACROS |
958 |
+#include <inttypes.h> |
959 |
|
960 |
#include <sys/types.h> |
961 |
#include <sys/ioctl.h> |
962 |
@@ -268,7 +271,7 @@ char *formatSize2(QWORD qwSize, char *sz |
963 |
|
964 |
if (qwSize < llKiloB) // In Bytes |
965 |
{ |
966 |
- snprintf(szText, nMaxLen, i18n("%lld bytes"), qwSize); |
967 |
+ snprintf(szText, nMaxLen, i18n("%"PRId64" bytes"), qwSize); |
968 |
} |
969 |
else if (qwSize < llMegaB) // In KiloBytes |
970 |
{ |
971 |
@@ -307,7 +310,7 @@ char *formatSizeNoGui(QWORD qwSize, char |
972 |
|
973 |
if (qwSize < llKiloB) // In Bytes |
974 |
{ |
975 |
- snprintf(szText, nMaxLen, i18n("%lldb"), qwSize); |
976 |
+ snprintf(szText, nMaxLen, i18n("%"PRId64"b"), qwSize); |
977 |
} |
978 |
else if (qwSize < llMegaB) // In KiloBytes |
979 |
{ |
980 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/shared/common.h |
981 |
--- a/src/shared/common.h Tue Sep 04 21:36:14 2007 +0200 |
982 |
+++ b/src/shared/common.h Tue Sep 04 21:43:30 2007 +0200 |
983 |
@@ -146,6 +146,23 @@ struct COptions |
984 |
|
985 |
#define MAX_UNAMEINFOLEN 65 //SYS_NMLN |
986 |
|
987 |
+struct portable_tm |
988 |
+{ |
989 |
+ uint32_t tm_sec; |
990 |
+ uint32_t tm_min; |
991 |
+ uint32_t tm_hour; |
992 |
+ uint32_t tm_mday; |
993 |
+ uint32_t tm_mon; |
994 |
+ uint32_t tm_year; |
995 |
+ uint32_t tm_wday; |
996 |
+ uint32_t tm_yday; |
997 |
+ uint32_t tm_isdst; |
998 |
+ |
999 |
+ uint32_t tm_gmtoff; |
1000 |
+ uint32_t tm_zone; |
1001 |
+}; |
1002 |
+ |
1003 |
+ |
1004 |
// ================================================ |
1005 |
struct CMainHeader // size must be 16384 (adjust the reserved data) |
1006 |
{ |
1007 |
@@ -163,7 +180,7 @@ struct CMainHeader // size must be 16384 |
1008 |
|
1009 |
DWORD dwCompression; // COMPRESS_XXXXXX |
1010 |
DWORD dwMainFlags; |
1011 |
- struct tm dateCreate; // date of image creation |
1012 |
+ struct portable_tm dateCreate; // date of image creation |
1013 |
QWORD qwPartSize; // size of the partition in bytes |
1014 |
char szHostname[MAX_HOSTNAMESIZE]; |
1015 |
char szVersion[64]; // version of the image file |
1016 |
diff -r 0ffb61b8c31d -r 88ac9824fc14 src/shared/image_disk.cpp |
1017 |
--- a/src/shared/image_disk.cpp Tue Sep 04 21:36:14 2007 +0200 |
1018 |
+++ b/src/shared/image_disk.cpp Tue Sep 04 21:43:30 2007 +0200 |
1019 |
@@ -524,7 +524,7 @@ void CImageDisk::openWriting() // [Main- |
1020 |
if (m_bIsOpened == true) |
1021 |
THROW(ERR_OPENED); |
1022 |
|
1023 |
- SNPRINTF(szShortName, "pi%.8lx", (DWORD)generateIdentificator()); |
1024 |
+ SNPRINTF(szShortName, "pi%.8x", (DWORD)generateIdentificator()); |
1025 |
extractFilepathFromFullPath(m_szImageFilename, szPathDir); // filepath without filename |
1026 |
if (access(szPathDir, R_OK) == -1) mkdir(szPathDir, 0755); |
1027 |
snprintf(m_szSpaceFilename, MAXPATHLEN, "%s/%8s.tmp", szPathDir, szShortName); |
1028 |
|
1029 |
|
1030 |
|
1031 |
1.1 sys-block/partimage/files/partimage-0.6.6-datadir-path.patch |
1032 |
|
1033 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-datadir-path.patch?rev=1.1&view=markup |
1034 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-datadir-path.patch?rev=1.1&content-type=text/plain |
1035 |
|
1036 |
Index: partimage-0.6.6-datadir-path.patch |
1037 |
=================================================================== |
1038 |
--- partimage-0.6.6/Makefile.in.orig 2007-08-11 12:36:57.000000000 +0200 |
1039 |
+++ partimage-0.6.6/Makefile.in 2008-01-14 00:39:42.000000000 +0100 |
1040 |
@@ -688,34 +688,34 @@ |
1041 |
@echo "/etc/pam.d/partimaged" |
1042 |
|
1043 |
install-data-local: |
1044 |
- $(mkinstalldirs) ${sysconfdir} |
1045 |
- $(mkinstalldirs) ${sysconfdir}/partimaged |
1046 |
+ $(mkinstalldirs) ${DESTDIR}${sysconfdir} |
1047 |
+ $(mkinstalldirs) ${DESTDIR}${sysconfdir}/partimaged |
1048 |
|
1049 |
- if test ! -f ${sysconfdir}/partimaged/partimagedusers ; then \ |
1050 |
+ if test ! -f ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ; then \ |
1051 |
echo "# note: '#' introduces comments" > \ |
1052 |
- ${sysconfdir}/partimaged/partimagedusers ;\ |
1053 |
+ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1054 |
echo -n "#add only users allowed to " >> \ |
1055 |
- ${sysconfdir}/partimaged/partimagedusers ;\ |
1056 |
- echo "connect partimaged" >> ${sysconfdir}/partimaged/partimagedusers ;\ |
1057 |
+ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1058 |
+ echo "connect partimaged" >> ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1059 |
echo "# (only one login per line)" >> \ |
1060 |
- ${sysconfdir}/partimaged/partimagedusers ;\ |
1061 |
- echo "" >> ${sysconfdir}/partimaged/partimagedusers ;\ |
1062 |
+ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1063 |
+ echo "" >> ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1064 |
echo "#sample # user 'sample' is allowed to connect partimaged" >> \ |
1065 |
- ${sysconfdir}/partimaged/partimagedusers ;\ |
1066 |
- chmod 600 ${sysconfdir}/partimaged/partimagedusers ;\ |
1067 |
- chown partimag:root ${sysconfdir}/partimaged/partimagedusers ;\ |
1068 |
+ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1069 |
+ chmod 600 ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1070 |
+ chown partimag:root ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1071 |
fi |
1072 |
|
1073 |
- $(mkinstalldirs) ${infodir} |
1074 |
- $(INSTALL_DATA) AUTHORS ${infodir}/AUTHORS |
1075 |
- $(INSTALL_DATA) BUGS ${infodir}/BUGS |
1076 |
- $(INSTALL_DATA) COPYING ${infodir}/COPYING |
1077 |
- $(INSTALL_DATA) ChangeLog ${infodir}/ChangeLog |
1078 |
- $(INSTALL_DATA) INSTALL ${infodir}/INSTALL |
1079 |
- $(INSTALL_DATA) README ${infodir}/README |
1080 |
- $(INSTALL_DATA) README.partimaged ${infodir}/README.partimaged |
1081 |
- $(INSTALL_DATA) TODO ${infodir}/TODO |
1082 |
- $(INSTALL_DATA) partimage.lsm ${infodir}/partimage.lsm |
1083 |
+ $(mkinstalldirs) ${DESTDIR}${infodir} |
1084 |
+ $(INSTALL_DATA) AUTHORS ${DESTDIR}${infodir}/AUTHORS |
1085 |
+ $(INSTALL_DATA) BUGS ${DESTDIR}${infodir}/BUGS |
1086 |
+ $(INSTALL_DATA) COPYING ${DESTDIR}${infodir}/COPYING |
1087 |
+ $(INSTALL_DATA) ChangeLog ${DESTDIR}${infodir}/ChangeLog |
1088 |
+ $(INSTALL_DATA) INSTALL ${DESTDIR}${infodir}/INSTALL |
1089 |
+ $(INSTALL_DATA) README ${DESTDIR}${infodir}/README |
1090 |
+ $(INSTALL_DATA) README.partimaged ${DESTDIR}${infodir}/README.partimaged |
1091 |
+ $(INSTALL_DATA) TODO ${DESTDIR}${infodir}/TODO |
1092 |
+ $(INSTALL_DATA) partimage.lsm ${DESTDIR}${infodir}/partimage.lsm |
1093 |
|
1094 |
uninstall-local: |
1095 |
-rm -f ${infodir}/AUTHORS |
1096 |
|
1097 |
|
1098 |
|
1099 |
1.1 sys-block/partimage/files/partimage-0.6.6-not_install_info.patch |
1100 |
|
1101 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-not_install_info.patch?rev=1.1&view=markup |
1102 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-not_install_info.patch?rev=1.1&content-type=text/plain |
1103 |
|
1104 |
Index: partimage-0.6.6-not_install_info.patch |
1105 |
=================================================================== |
1106 |
diff -uNr partimage-0.6.6.orig/Makefile.in partimage-0.6.6/Makefile.in |
1107 |
--- partimage-0.6.6.orig/Makefile.in 2008-01-14 23:11:07.000000000 +0100 |
1108 |
+++ partimage-0.6.6/Makefile.in 2008-01-14 23:14:55.000000000 +0100 |
1109 |
@@ -703,17 +703,6 @@ |
1110 |
chmod 600 ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\ |
1111 |
fi |
1112 |
|
1113 |
- $(mkinstalldirs) ${DESTDIR}${infodir} |
1114 |
- $(INSTALL_DATA) AUTHORS ${DESTDIR}${infodir}/AUTHORS |
1115 |
- $(INSTALL_DATA) BUGS ${DESTDIR}${infodir}/BUGS |
1116 |
- $(INSTALL_DATA) COPYING ${DESTDIR}${infodir}/COPYING |
1117 |
- $(INSTALL_DATA) ChangeLog ${DESTDIR}${infodir}/ChangeLog |
1118 |
- $(INSTALL_DATA) INSTALL ${DESTDIR}${infodir}/INSTALL |
1119 |
- $(INSTALL_DATA) README ${DESTDIR}${infodir}/README |
1120 |
- $(INSTALL_DATA) README.partimaged ${DESTDIR}${infodir}/README.partimaged |
1121 |
- $(INSTALL_DATA) TODO ${DESTDIR}${infodir}/TODO |
1122 |
- $(INSTALL_DATA) partimage.lsm ${DESTDIR}${infodir}/partimage.lsm |
1123 |
- |
1124 |
uninstall-local: |
1125 |
-rm -f ${infodir}/AUTHORS |
1126 |
-rm -f ${infodir}/BUGS |
1127 |
|
1128 |
|
1129 |
|
1130 |
1.1 sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch |
1131 |
|
1132 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch?rev=1.1&view=markup |
1133 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch?rev=1.1&content-type=text/plain |
1134 |
|
1135 |
Index: partimage-0.6.6-thread-privilege-fix.patch |
1136 |
=================================================================== |
1137 |
diff -uNr partimage-0.6.6.orig/src/server/partimaged-main.cpp partimage-0.6.6/src/server/partimaged-main.cpp |
1138 |
--- partimage-0.6.6.orig/src/server/partimaged-main.cpp 2008-01-15 12:32:50.000000000 +0100 |
1139 |
+++ partimage-0.6.6/src/server/partimaged-main.cpp 2008-01-15 12:36:06.000000000 +0100 |
1140 |
@@ -32,6 +32,8 @@ |
1141 |
#include <sys/stat.h> |
1142 |
#include <signal.h> |
1143 |
#include <fcntl.h> |
1144 |
+#include <errno.h> |
1145 |
+#include <cstring> |
1146 |
|
1147 |
#include "net.h" |
1148 |
#include "netserver.h" |
1149 |
@@ -321,6 +323,7 @@ |
1150 |
signal(SIGTERM, catch_sigint); |
1151 |
signal(SIGINT, catch_sigint); |
1152 |
signal(SIGSEGV, catch_sigint); // segmentation fault |
1153 |
+ signal(SIGCHLD, SIG_IGN); // ignore child exits |
1154 |
// signal(SIGHUP, catch_sigint); |
1155 |
// signal(SIGQUIT, catch_sigint); |
1156 |
// signal(SIGCHLD, catch_sigint); |
1157 |
@@ -426,9 +429,15 @@ |
1158 |
g_Window->SetLocation(client, "(wrong password)"); |
1159 |
} |
1160 |
else |
1161 |
- pthread_create(&threads[client], NULL, |
1162 |
- partimaged, &client); |
1163 |
- |
1164 |
+ { |
1165 |
+ int rv = fork(); |
1166 |
+ if ( rv < 0 ) |
1167 |
+ { |
1168 |
+ showDebug(1, "Cannot fork() on incoming connection - %s\n", strerror(errno)); |
1169 |
+ continue; |
1170 |
+ } |
1171 |
+ if ( ! rv ) partimaged(&client); // child process |
1172 |
+ } |
1173 |
} // infernal loop |
1174 |
|
1175 |
showDebug(1, "end of partimaged-main\n"); |
1176 |
|
1177 |
|
1178 |
|
1179 |
1.1 sys-block/partimage/files/digest-partimage-0.6.6 |
1180 |
|
1181 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/digest-partimage-0.6.6?rev=1.1&view=markup |
1182 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/digest-partimage-0.6.6?rev=1.1&content-type=text/plain |
1183 |
|
1184 |
Index: digest-partimage-0.6.6 |
1185 |
=================================================================== |
1186 |
MD5 abfa9fd02f3ab46bcc636eadf2308580 partimage-0.6.6.tar.bz2 524695 |
1187 |
RMD160 8bad0dd706d88dee27531766daf7611d95bb0a04 partimage-0.6.6.tar.bz2 524695 |
1188 |
SHA256 0bf5d720094777ae0aa258a00f30cee6988c026558eea20087aa20d46b81b2bd partimage-0.6.6.tar.bz2 524695 |
1189 |
|
1190 |
|
1191 |
|
1192 |
1.1 sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch |
1193 |
|
1194 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch?rev=1.1&view=markup |
1195 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch?rev=1.1&content-type=text/plain |
1196 |
|
1197 |
Index: partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch |
1198 |
=================================================================== |
1199 |
diff -uNr partimage-0.6.6.orig/src/client/interface_none.cpp partimage-0.6.6/src/client/interface_none.cpp |
1200 |
--- partimage-0.6.6.orig/src/client/interface_none.cpp 2006-04-22 16:24:14.000000000 +0200 |
1201 |
+++ partimage-0.6.6/src/client/interface_none.cpp 2008-01-14 01:48:22.000000000 +0100 |
1202 |
@@ -96,7 +96,8 @@ |
1203 |
void CInterfaceNone::msgBoxError(char *title, ...) { |
1204 |
va_list al; |
1205 |
va_start(al,title); |
1206 |
- message_only("Error", title, "", al, 0); |
1207 |
+ vfprintf(stderr,title,al); |
1208 |
+ fputc('\n',stderr); |
1209 |
va_end(al); |
1210 |
} |
1211 |
|
1212 |
diff -uNr partimage-0.6.6.orig/src/client/main.cpp partimage-0.6.6/src/client/main.cpp |
1213 |
--- partimage-0.6.6.orig/src/client/main.cpp 2008-01-14 01:44:21.000000000 +0100 |
1214 |
+++ partimage-0.6.6/src/client/main.cpp 2008-01-14 01:47:46.000000000 +0100 |
1215 |
@@ -139,6 +139,12 @@ |
1216 |
}*/ |
1217 |
} |
1218 |
|
1219 |
+void ensure_interface_is_non_interactive() |
1220 |
+{ |
1221 |
+ delete g_interface; |
1222 |
+ g_interface = new CInterfaceNone(""); |
1223 |
+} |
1224 |
+ |
1225 |
// ======================================================= |
1226 |
int main(int argc, char *argv[]) |
1227 |
{ |
1228 |
@@ -579,8 +585,9 @@ |
1229 |
goto beginMainWin; |
1230 |
} |
1231 |
|
1232 |
- if (!options.bBatchMode) |
1233 |
- g_interface -> Error(excep, szImageFile, szDevice); |
1234 |
+ if (options.bBatchMode) ensure_interface_is_non_interactive(); |
1235 |
+ |
1236 |
+ g_interface -> Error(excep, szImageFile, szDevice); |
1237 |
|
1238 |
showDebug(1, "\nFINAL ERROR\n\n"); |
1239 |
|
1240 |
@@ -591,8 +598,11 @@ |
1241 |
else |
1242 |
{ |
1243 |
showDebug(1, "The file system of [%s] is [%s], and is not supported\n", szDevice, szFileSystem); |
1244 |
- if (!options.bBatchMode) |
1245 |
- g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem); |
1246 |
+ |
1247 |
+ if (options.bBatchMode) ensure_interface_is_non_interactive(); |
1248 |
+ |
1249 |
+ g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem); |
1250 |
+ |
1251 |
nRes = -1; |
1252 |
} |
1253 |
//#endif // DEVEL_SUPPORT |
1254 |
@@ -696,7 +706,7 @@ |
1255 |
{ |
1256 |
if (options.bBatchMode) |
1257 |
fprintf(stderr,"\n\n"); |
1258 |
- g_interface -> StatusLine(i18n("commiting buffer cache to disk.")); |
1259 |
+ if (!options.bBatchMode) g_interface -> StatusLine(i18n("commiting buffer cache to disk.")); |
1260 |
sync(); |
1261 |
} |
1262 |
closeDebugFiles(); |
1263 |
|
1264 |
|
1265 |
|
1266 |
1.1 sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch |
1267 |
|
1268 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch?rev=1.1&view=markup |
1269 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch?rev=1.1&content-type=text/plain |
1270 |
|
1271 |
Index: partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch |
1272 |
=================================================================== |
1273 |
diff --unified --recursive partimage-0.6.7_beta1.org/src/client/fs/fs_base.cpp partimage-0.6.7_beta1/src/client/fs/fs_base.cpp |
1274 |
--- partimage-0.6.7_beta1.org/src/client/fs/fs_base.cpp 2007-09-17 02:59:23.000000000 +0800 |
1275 |
+++ partimage-0.6.7_beta1/src/client/fs/fs_base.cpp 2007-10-08 16:51:29.000000000 +0800 |
1276 |
@@ -773,6 +773,7 @@ |
1277 |
QWORD qwFreeBlocksCount = 0; |
1278 |
QWORD i; |
1279 |
|
1280 |
+ showDebug(1, "BITMAP: m_header.qwBlocksCount = %llu\n", m_header.qwBlocksCount); |
1281 |
for (i=0; i < m_header.qwBlocksCount; i++) |
1282 |
{ |
1283 |
if (m_bitmap.isBitSet(i)) |
1284 |
diff --unified --recursive partimage-0.6.7_beta1.org/src/client/fs/fs_ext2.cpp partimage-0.6.7_beta1/src/client/fs/fs_ext2.cpp |
1285 |
--- partimage-0.6.7_beta1.org/src/client/fs/fs_ext2.cpp 2007-09-17 02:55:59.000000000 +0800 |
1286 |
+++ partimage-0.6.7_beta1/src/client/fs/fs_ext2.cpp 2007-10-08 18:21:03.000000000 +0800 |
1287 |
@@ -158,6 +158,7 @@ |
1288 |
m_info.dwTotalBlocksCount = Le32ToCpu(sb.s_blocks_count); |
1289 |
showDebug(1, "total blocks=%lu\n", m_info.dwTotalBlocksCount); |
1290 |
m_info.dwBlocksPerGroup = Le32ToCpu(sb.s_blocks_per_group); |
1291 |
+ showDebug(1, "BlocksPerGroup=%lu\n", m_info.dwBlocksPerGroup); |
1292 |
|
1293 |
m_info.dwGroupsCount = (m_info.dwTotalBlocksCount - m_info.dwFirstBlock + m_info.dwBlocksPerGroup - 1) / Le32ToCpu(sb.s_blocks_per_group); |
1294 |
showDebug(1, "groups=%lu\n", m_info.dwGroupsCount); |
1295 |
@@ -211,6 +212,7 @@ |
1296 |
DWORD dwBit, dwByte; |
1297 |
DWORD dwExt2DataBlock; |
1298 |
char *cPtr; |
1299 |
+ int group = 0; |
1300 |
|
1301 |
// debug |
1302 |
DWORD dwUsed; |
1303 |
@@ -228,6 +230,7 @@ |
1304 |
|
1305 |
// init bitmap size |
1306 |
nRes = m_bitmap.init(m_header.qwBitmapSize); |
1307 |
+ showDebug(1, "m_bitmap.init(m_header.qwBitmapSize = %lu)\n", m_header.qwBitmapSize); |
1308 |
if (nRes == -1) |
1309 |
{ |
1310 |
showDebug(1, "CExt2Part::readBitmap(): Error 002\n"); |
1311 |
@@ -236,6 +239,7 @@ |
1312 |
|
1313 |
// load group descriptors |
1314 |
desc = new CExt2GroupDesc[m_info.dwGroupsCount+m_info.dwDescPerBlock]; |
1315 |
+ showDebug(1, "dwGroupsCount = %lu, m_info.dwDescPerBlock = %lu\n",m_info.dwGroupsCount, m_info.dwDescPerBlock); |
1316 |
if (!desc) |
1317 |
{ |
1318 |
showDebug(1, "CExt2Part::readBitmap(): Error 003\n"); |
1319 |
@@ -243,6 +247,7 @@ |
1320 |
} |
1321 |
|
1322 |
// for each descriptor BLOCK (not group descriptor!) |
1323 |
+ showDebug(1, "readData m_info.dwBlockSize = %lu\n", m_info.dwBlockSize); |
1324 |
for (cPtr=(char*)desc, i=0; i < m_info.dwDescBlocks; i++,cPtr+=m_info.dwBlockSize) |
1325 |
{ |
1326 |
nRes = readData(cPtr, ((QWORD)m_info.dwBlockSize) * ((QWORD)(m_info.dwFirstBlock+1+i)), m_info.dwBlockSize); |
1327 |
@@ -255,7 +260,7 @@ |
1328 |
|
1329 |
dwUsed=0; |
1330 |
dwFree=0; |
1331 |
- |
1332 |
+ showDebug(1, "m_info.dwBlocksPerGroup = %lu\n", m_info.dwBlocksPerGroup); |
1333 |
for (i = 0; i < m_info.dwGroupsCount; i++) |
1334 |
{ |
1335 |
if (m_info.dwFirstBlock+((i+1)*m_info.dwBlocksPerGroup) > m_info.dwTotalBlocksCount) |
1336 |
@@ -267,8 +272,8 @@ |
1337 |
{ |
1338 |
// -- read the bitmap block |
1339 |
errno = 0; |
1340 |
- nRes = readData(cTempBitmap+(i*m_info.dwBlockSize), ((QWORD)m_info.dwBlockSize) * |
1341 |
- ((QWORD)Le32ToCpu(desc[i].bg_block_bitmap)), m_info.dwBlockSize); |
1342 |
+ nRes = readData(cTempBitmap+(i*(m_info.dwBlocksPerGroup/8)), ((QWORD)m_info.dwBlockSize) * |
1343 |
+ ((QWORD)Le32ToCpu(desc[i].bg_block_bitmap)), (m_info.dwBlocksPerGroup/8)); |
1344 |
if (nRes == -1) |
1345 |
{ |
1346 |
showDebug(1, "CExt2Part::readBitmap(): Error 005\n"); |
1347 |
@@ -278,7 +283,7 @@ |
1348 |
} |
1349 |
else |
1350 |
{ |
1351 |
- memset(cTempBitmap+(i*m_info.dwBlockSize), 0, m_info.dwBlockSize); |
1352 |
+ memset(cTempBitmap+(i*(m_info.dwBlocksPerGroup/8)), 0, (m_info.dwBlocksPerGroup/8)); |
1353 |
} |
1354 |
} |
1355 |
|
1356 |
@@ -302,22 +307,25 @@ |
1357 |
{ |
1358 |
dwBit = dwExt2DataBlock % 8; |
1359 |
dwByte = (dwExt2DataBlock - dwBit) / 8; |
1360 |
+ group = (dwExt2DataBlock/m_info.dwBlocksPerGroup); |
1361 |
|
1362 |
if ((cTempBitmap[dwByte] & (1 << dwBit)) != 0) |
1363 |
{ |
1364 |
for (j=0; j < m_info.dwLogicalBlocksPerExt2Block; j++, i++) |
1365 |
m_bitmap.setBit(i, true); |
1366 |
+ showDebug(3, "m_bitmap.setBit(%1u, true), g = %i\n", (i/4), group); |
1367 |
dwUsed++; |
1368 |
} |
1369 |
else |
1370 |
{ |
1371 |
for (j=0; j < m_info.dwLogicalBlocksPerExt2Block; j++, i++) |
1372 |
m_bitmap.setBit(i, false); |
1373 |
+ showDebug(3, "m_bitmap.setBit(%1u, false), g = %i\n", (i/4), group); |
1374 |
dwFree++; |
1375 |
} |
1376 |
} |
1377 |
|
1378 |
- //debugWin("used=%lu\nfree=%lu\ntotal=%lu",dwUsed,dwFree,dwUsed+dwFree); |
1379 |
+ showDebug(1,"used=%lu\nfree=%lu\ntotal=%lu\n",dwUsed,dwFree,dwUsed+dwFree); |
1380 |
calculateSpaceFromBitmap(); |
1381 |
|
1382 |
//success_readBitmap: |
1383 |
|
1384 |
|
1385 |
|
1386 |
1.1 sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch |
1387 |
|
1388 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch?rev=1.1&view=markup |
1389 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch?rev=1.1&content-type=text/plain |
1390 |
|
1391 |
Index: partimage-0.6.6-disable_header_check.patch |
1392 |
=================================================================== |
1393 |
diff -uNr partimage-0.6.6.orig/src/client/main.cpp partimage-0.6.6/src/client/main.cpp |
1394 |
--- partimage-0.6.6.orig/src/client/main.cpp 2008-01-15 00:39:28.000000000 +0100 |
1395 |
+++ partimage-0.6.6/src/client/main.cpp 2008-01-15 01:30:57.000000000 +0100 |
1396 |
@@ -1015,6 +1015,11 @@ |
1397 |
// ======================================================= |
1398 |
int checkStructSizes() |
1399 |
{ |
1400 |
+ // Disable header check for AMD64, because it fails |
1401 |
+#if defined(__x86_64__) |
1402 |
+ return 0; |
1403 |
+#endif |
1404 |
+ |
1405 |
// ---- check types sizes |
1406 |
|
1407 |
if (sizeof(DWORD) != 4) |
1408 |
|
1409 |
|
1410 |
|
1411 |
-- |
1412 |
gentoo-commits@l.g.o mailing list |