1 |
commit: 619a6b6164660089f7dee5fcb6ea484f7bcff72b |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 17 23:20:15 2020 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 17 23:20:22 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=619a6b61 |
7 |
|
8 |
media-gfx/sane-backends: security cleanup |
9 |
|
10 |
Bug: https://bugs.gentoo.org/729312 |
11 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
media-gfx/sane-backends/Manifest | 1 - |
15 |
.../sane-backends-1.0.27-canon-lide-100.patch | 17 - |
16 |
.../files/sane-backends-1.0.27-network.patch | 42 --- |
17 |
.../sane-backends-1.0.27-revert-samsung.patch | 406 --------------------- |
18 |
...ne-backends-1.0.27-uninitialized-variable.patch | 25 -- |
19 |
.../sane-backends/sane-backends-1.0.27-r3.ebuild | 344 ----------------- |
20 |
6 files changed, 835 deletions(-) |
21 |
|
22 |
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest |
23 |
index 1e5f15e24b2..4a1266cd003 100644 |
24 |
--- a/media-gfx/sane-backends/Manifest |
25 |
+++ b/media-gfx/sane-backends/Manifest |
26 |
@@ -1,2 +1 @@ |
27 |
DIST backends-1.0.30.tar.gz 5721262 BLAKE2B 139d3ca908d54b94d14ef4145d44a89b939807c15870be03c3c028cf95351bf9a4abd3ea115b84396366bb054f37ade883f429467dceb0663c2855b92e0a4fa5 SHA512 19127c8109c1587d60d8cba713f73b1a24242df44fa49c3e59320f48022783f05d26d3242a3f87478e583a807d88b446ef7a51afb33b674be29656496c435d7b |
28 |
-DIST sane-backends-1.0.27.tar.gz 6430188 BLAKE2B 90f910311e31a436eaa0ca0fedd998aac3331f89a346f31613776ebc860a10cc37055fd15db8de8d743498914ea0c16e4153dbaa101380eb6e36857d730c3456 SHA512 c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975ce1d37dc3ccea050c488dbdf983c2ca17dcd702644060ba796ae2591f9c5 |
29 |
|
30 |
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch |
31 |
deleted file mode 100644 |
32 |
index 504f9e666e6..00000000000 |
33 |
--- a/media-gfx/sane-backends/files/sane-backends-1.0.27-canon-lide-100.patch |
34 |
+++ /dev/null |
35 |
@@ -1,17 +0,0 @@ |
36 |
-diff -up sane-backends-1.0.27/backend/genesys.c.canon-lide-100 sane-backends-1.0.27/backend/genesys.c |
37 |
---- sane-backends-1.0.27/backend/genesys.c.canon-lide-100 2018-02-01 10:37:26.160044539 +0100 |
38 |
-+++ sane-backends-1.0.27/backend/genesys.c 2018-02-01 10:45:44.616653277 +0100 |
39 |
-@@ -2070,11 +2070,9 @@ genesys_white_shading_calibration (Genes |
40 |
- dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_TRUE); |
41 |
- dev->model->cmd_set->set_motor_power (dev->calib_reg, motor); |
42 |
- |
43 |
-- /* if needed, go back before doin next scan, by using rewind, registers and |
44 |
-- * slopes table are kept intact from previous scan */ |
45 |
-- if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->rewind) |
46 |
-+ if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK) |
47 |
- { |
48 |
-- status = dev->model->cmd_set->rewind (dev); |
49 |
-+ status = dev->model->cmd_set->slow_back_home (dev, SANE_TRUE); |
50 |
- } |
51 |
- |
52 |
- status = |
53 |
|
54 |
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch |
55 |
deleted file mode 100644 |
56 |
index 2605ea83578..00000000000 |
57 |
--- a/media-gfx/sane-backends/files/sane-backends-1.0.27-network.patch |
58 |
+++ /dev/null |
59 |
@@ -1,42 +0,0 @@ |
60 |
-diff --git a/sanei/sanei_tcp.c b/sanei/sanei_tcp.c |
61 |
-index a57d7c7..d0a1e92 100644 |
62 |
---- a/sanei/sanei_tcp.c |
63 |
-+++ b/sanei/sanei_tcp.c |
64 |
-@@ -45,6 +45,7 @@ |
65 |
- #include <unistd.h> |
66 |
- #include <stdlib.h> |
67 |
- #include <string.h> |
68 |
-+#include <time.h> |
69 |
- |
70 |
- #ifdef HAVE_WINSOCK2_H |
71 |
- #include <winsock2.h> |
72 |
-@@ -123,14 +124,27 @@ sanei_tcp_write(int fd, const u_char * buf, int count) |
73 |
- ssize_t |
74 |
- sanei_tcp_read(int fd, u_char * buf, int count) |
75 |
- { |
76 |
-- ssize_t bytes_recv = 0, rc = 1; |
77 |
-+ ssize_t bytes_recv = 0, rc = 1; |
78 |
-+ int retry = 5; |
79 |
- |
80 |
- while (bytes_recv < count && rc > 0) |
81 |
- { |
82 |
- rc = recv(fd, buf+bytes_recv, count-bytes_recv, 0); |
83 |
-+ DBG(1, "%s: bytes received %d\n", __FUNCTION__, rc); |
84 |
- if (rc > 0) |
85 |
- bytes_recv += rc; |
86 |
-- |
87 |
-+ else { |
88 |
-+ if ( errno == EAGAIN && retry-- ) { |
89 |
-+ DBG(1, "%s: waiting %d\n", __FUNCTION__, retry); |
90 |
-+ /* wait for max 1s */ |
91 |
-+ struct timespec req; |
92 |
-+ struct timespec rem; |
93 |
-+ req.tv_sec = 0; |
94 |
-+ req.tv_nsec= 100000000; |
95 |
-+ nanosleep(&req, &rem); |
96 |
-+ rc = 1; |
97 |
-+ } |
98 |
-+ } |
99 |
- } |
100 |
- return bytes_recv; |
101 |
- } |
102 |
|
103 |
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-revert-samsung.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-revert-samsung.patch |
104 |
deleted file mode 100644 |
105 |
index af3e141a010..00000000000 |
106 |
--- a/media-gfx/sane-backends/files/sane-backends-1.0.27-revert-samsung.patch |
107 |
+++ /dev/null |
108 |
@@ -1,406 +0,0 @@ |
109 |
-From 9b13d4c18b2424eaed02b72a928e9607921ec265 Mon Sep 17 00:00:00 2001 |
110 |
-From: Bernard Cafarelli <bernard.cafarelli@×××××.com> |
111 |
-Date: Tue, 17 Apr 2018 22:43:15 +0200 |
112 |
-Subject: [PATCH] Revert "Color scanning for Samsung models, which support JPEG |
113 |
- Lossy compression." |
114 |
- |
115 |
-This reverts commit 926bfade544de4a4fd5f1a8082b85a97e2443770, leaving |
116 |
-the new IDs in. |
117 |
-As tracked in #315876, this breaks scanning with multiple Samsung scanners |
118 |
- |
119 |
-Conflicts: |
120 |
- backend/xerox_mfp.c |
121 |
- backend/xerox_mfp.h |
122 |
- doc/descriptions/xerox_mfp.desc |
123 |
---- |
124 |
- backend/Makefile.am | 2 +- |
125 |
- backend/Makefile.in | 7 +- |
126 |
- backend/xerox_mfp.c | 193 +------------------------------- |
127 |
- backend/xerox_mfp.h | 5 - |
128 |
- doc/descriptions/xerox_mfp.desc | 10 +- |
129 |
- 5 files changed, 14 insertions(+), 203 deletions(-) |
130 |
- |
131 |
-diff --git a/backend/Makefile.am b/backend/Makefile.am |
132 |
-index 18695a4a..3225b133 100644 |
133 |
---- a/backend/Makefile.am |
134 |
-+++ b/backend/Makefile.am |
135 |
-@@ -1086,7 +1086,7 @@ libxerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp |
136 |
- nodist_libsane_xerox_mfp_la_SOURCES = xerox_mfp-s.c |
137 |
- libsane_xerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp |
138 |
- libsane_xerox_mfp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) |
139 |
--libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(JPEG_LIBS) ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS) |
140 |
-+libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS) |
141 |
- EXTRA_DIST += xerox_mfp.conf.in |
142 |
- |
143 |
- libdll_preload_la_SOURCES = dll.c |
144 |
-diff --git a/backend/Makefile.in b/backend/Makefile.in |
145 |
-index d1dca4a2..2643bb77 100644 |
146 |
---- a/backend/Makefile.in |
147 |
-+++ b/backend/Makefile.in |
148 |
-@@ -1430,10 +1430,9 @@ libsane_v4l_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ |
149 |
- libsane_xerox_mfp_la_DEPENDENCIES = $(COMMON_LIBS) libxerox_mfp.la \ |
150 |
- ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo \ |
151 |
- ../sanei/sanei_config.lo sane_strstatus.lo \ |
152 |
-- $(am__DEPENDENCIES_1) ../sanei/sanei_usb.lo \ |
153 |
-- ../sanei/sanei_tcp.lo $(am__DEPENDENCIES_1) \ |
154 |
-+ ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo \ |
155 |
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ |
156 |
-- $(am__DEPENDENCIES_1) |
157 |
-+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) |
158 |
- nodist_libsane_xerox_mfp_la_OBJECTS = \ |
159 |
- libsane_xerox_mfp_la-xerox_mfp-s.lo |
160 |
- libsane_xerox_mfp_la_OBJECTS = $(nodist_libsane_xerox_mfp_la_OBJECTS) |
161 |
-@@ -2754,7 +2753,7 @@ libxerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp |
162 |
- nodist_libsane_xerox_mfp_la_SOURCES = xerox_mfp-s.c |
163 |
- libsane_xerox_mfp_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=xerox_mfp |
164 |
- libsane_xerox_mfp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) |
165 |
--libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo @SANEI_SANEI_JPEG_LO@ $(JPEG_LIBS) ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS) |
166 |
-+libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS) |
167 |
- libdll_preload_la_SOURCES = dll.c |
168 |
- libdll_preload_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll -DENABLE_PRELOAD |
169 |
- libdll_la_SOURCES = dll.c |
170 |
-diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c |
171 |
-index 8b8c8956..d37a6237 100644 |
172 |
---- a/backend/xerox_mfp.c |
173 |
-+++ b/backend/xerox_mfp.c |
174 |
-@@ -33,9 +33,6 @@ |
175 |
- #include "../include/sane/sanei_usb.h" |
176 |
- #include "../include/sane/sanei_config.h" |
177 |
- #include "../include/sane/sanei_backend.h" |
178 |
--#ifdef HAVE_LIBJPEG |
179 |
--#include <jpeglib.h> |
180 |
--#endif |
181 |
- #include "xerox_mfp.h" |
182 |
- |
183 |
- #define BACKEND_BUILD 13 |
184 |
-@@ -93,128 +90,6 @@ static char *str_cmd(int cmd) |
185 |
- } |
186 |
- |
187 |
- #define MAX_DUMP 70 |
188 |
--const char *encTmpFileName = "/tmp/stmp_enc.tmp"; |
189 |
-- |
190 |
--static int decompress(struct device __sane_unused__ *dev, |
191 |
-- const char __sane_unused__ *infilename) |
192 |
--{ |
193 |
--#ifdef HAVE_LIBJPEG |
194 |
-- int rc; |
195 |
-- int row_stride, width, height, pixel_size; |
196 |
-- struct jpeg_decompress_struct cinfo; |
197 |
-- struct jpeg_error_mgr jerr; |
198 |
-- unsigned long bmp_size = 0; |
199 |
-- FILE *pInfile = NULL; |
200 |
-- JSAMPARRAY buffer; |
201 |
-- |
202 |
-- if ((pInfile = fopen(infilename, "rb")) == NULL) { |
203 |
-- fprintf(stderr, "can't open %s\n", infilename); |
204 |
-- return -1; |
205 |
-- } |
206 |
-- |
207 |
-- cinfo.err = jpeg_std_error(&jerr); |
208 |
-- |
209 |
-- jpeg_create_decompress(&cinfo); |
210 |
-- |
211 |
-- jpeg_stdio_src(&cinfo, pInfile); |
212 |
-- |
213 |
-- rc = jpeg_read_header(&cinfo, TRUE); |
214 |
-- if (rc != 1) { |
215 |
-- jpeg_destroy_decompress(&cinfo); |
216 |
-- fclose(pInfile); |
217 |
-- return -1; |
218 |
-- } |
219 |
-- |
220 |
-- jpeg_start_decompress(&cinfo); |
221 |
-- |
222 |
-- width = cinfo.output_width; |
223 |
-- height = cinfo.output_height; |
224 |
-- pixel_size = cinfo.output_components; |
225 |
-- bmp_size = width * height * pixel_size; |
226 |
-- dev->decDataSize = bmp_size; |
227 |
-- |
228 |
-- row_stride = width * pixel_size; |
229 |
-- |
230 |
-- buffer = (*cinfo.mem->alloc_sarray) |
231 |
-- ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); |
232 |
-- |
233 |
-- while (cinfo.output_scanline < cinfo.output_height) { |
234 |
-- buffer[0] = dev->decData + \ |
235 |
-- (cinfo.output_scanline) * row_stride; |
236 |
-- jpeg_read_scanlines(&cinfo, buffer, 1); |
237 |
-- } |
238 |
-- jpeg_finish_decompress(&cinfo); |
239 |
-- jpeg_destroy_decompress(&cinfo); |
240 |
-- fclose(pInfile); |
241 |
-- return 0; |
242 |
--#else |
243 |
-- return -1; |
244 |
--#endif |
245 |
--} |
246 |
-- |
247 |
--static int copy_decompress_data(struct device *dev, unsigned char *pDest, int maxlen, int *destLen) |
248 |
--{ |
249 |
-- int data_size = 0; |
250 |
-- size_t result = 0, retVal = 0; |
251 |
-- |
252 |
-- |
253 |
-- if (0 == dev->decDataSize) { |
254 |
-- *destLen = 0; |
255 |
-- return retVal; |
256 |
-- } |
257 |
-- data_size = dev->decDataSize - dev->currentDecDataIndex; |
258 |
-- if (data_size > maxlen) { |
259 |
-- data_size = maxlen; |
260 |
-- } |
261 |
-- memcpy(pDest, dev->decData+dev->currentDecDataIndex, data_size); |
262 |
-- result = data_size; |
263 |
-- *destLen = result; |
264 |
-- dev->currentDecDataIndex += result; |
265 |
-- retVal = result; |
266 |
-- |
267 |
-- if (dev->decDataSize == dev->currentDecDataIndex) { |
268 |
-- dev->currentDecDataIndex = 0; |
269 |
-- dev->decDataSize = 0; |
270 |
-- } |
271 |
-- |
272 |
-- return retVal; |
273 |
--} |
274 |
-- |
275 |
--static int decompress_tempfile(struct device *dev) |
276 |
--{ |
277 |
-- decompress(dev, encTmpFileName); |
278 |
-- remove(encTmpFileName); |
279 |
-- return 0; |
280 |
--} |
281 |
-- |
282 |
--static int dump_to_tmp_file(struct device *dev) |
283 |
--{ |
284 |
-- unsigned char *pSrc = dev->data; |
285 |
-- int srcLen = dev->datalen; |
286 |
-- FILE *pInfile; |
287 |
-- if ((pInfile = fopen(encTmpFileName, "a")) == NULL) { |
288 |
-- fprintf(stderr, "can't open %s\n", encTmpFileName); |
289 |
-- return 0; |
290 |
-- } |
291 |
-- |
292 |
-- fwrite(pSrc, 1, srcLen, pInfile); |
293 |
-- fclose(pInfile); |
294 |
-- return srcLen; |
295 |
--} |
296 |
-- |
297 |
--static int isSupportedDevice(struct device __sane_unused__ *dev) |
298 |
--{ |
299 |
--#ifdef HAVE_LIBJPEG |
300 |
-- /* Checking device which supports JPEG Lossy compression for color scanning*/ |
301 |
-- if (dev->compressionTypes & (1 << 6)) |
302 |
-- return 1; |
303 |
-- else |
304 |
-- return 0; |
305 |
--#else |
306 |
-- return 0; |
307 |
--#endif |
308 |
--} |
309 |
-- |
310 |
- static void dbg_dump(struct device *dev) |
311 |
- { |
312 |
- int i; |
313 |
-@@ -639,11 +514,9 @@ static void set_parameters(struct device *dev) |
314 |
- dev->para.pixels_per_line = dev->win_width / px_to_len; |
315 |
- dev->para.bytes_per_line = dev->para.pixels_per_line; |
316 |
- |
317 |
-- if (!isSupportedDevice(dev)) { |
318 |
- #if BETTER_BASEDPI |
319 |
-- px_to_len = 1213.9 / dev->val[OPT_RESOLUTION].w; |
320 |
-+ px_to_len = 1213.9 / dev->val[OPT_RESOLUTION].w; |
321 |
- #endif |
322 |
-- } |
323 |
- dev->para.lines = dev->win_len / px_to_len; |
324 |
- if (dev->composition == MODE_LINEART || |
325 |
- dev->composition == MODE_HALFTONE) { |
326 |
-@@ -765,13 +638,6 @@ static int dev_set_window(struct device *dev) |
327 |
- cmd[0x11] = (SANE_Byte)floor(dev->win_off_y); |
328 |
- cmd[0x12] = (SANE_Byte)((dev->win_off_y - floor(dev->win_off_y)) * 100); |
329 |
- cmd[0x13] = dev->composition; |
330 |
-- /* Set to JPEG Lossy Compression, if mode is color (only for supported model)... |
331 |
-- * else go with Uncompressed (For backard compatibility with old models )*/ |
332 |
-- if (dev->composition == MODE_RGB24) { |
333 |
-- if (isSupportedDevice(dev)) { |
334 |
-- cmd[0x14] = 0x6; |
335 |
-- } |
336 |
-- } |
337 |
- cmd[0x16] = dev->threshold; |
338 |
- cmd[0x17] = dev->doc_source; |
339 |
- |
340 |
-@@ -843,7 +709,6 @@ dev_inquiry(struct device *dev) |
341 |
- dev->res[0x3e] << 8 | |
342 |
- dev->res[0x3f]; |
343 |
- dev->line_order = dev->res[0x31]; |
344 |
-- dev->compressionTypes = dev->res[0x32]; |
345 |
- dev->doc_loaded = (dev->res[0x35] == 0x02) && |
346 |
- (dev->res[0x26] & 0x03); |
347 |
- |
348 |
-@@ -942,10 +807,6 @@ dev_free(struct device *dev) |
349 |
- free(UNCONST(dev->sane.type)); |
350 |
- if (dev->data) |
351 |
- free(dev->data); |
352 |
-- if (dev->decData) { |
353 |
-- free(dev->decData); |
354 |
-- dev->decData = NULL; |
355 |
-- } |
356 |
- memset(dev, 0, sizeof(*dev)); |
357 |
- free(dev); |
358 |
- } |
359 |
-@@ -1283,19 +1144,6 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) |
360 |
- /* if there is no data to read or output from buffer */ |
361 |
- if (!dev->blocklen && dev->datalen <= PADDING_SIZE) { |
362 |
- |
363 |
-- /* copying uncompressed data */ |
364 |
-- if (dev->composition == MODE_RGB24 && |
365 |
-- isSupportedDevice(dev) && |
366 |
-- dev->decDataSize > 0) { |
367 |
-- int diff = dev->total_img_size - dev->total_out_size; |
368 |
-- int bufLen = (diff < maxlen) ? diff : maxlen; |
369 |
-- if (0 < diff && |
370 |
-- 0 < copy_decompress_data(dev, buf, bufLen, lenp)) { |
371 |
-- dev->total_out_size += *lenp; |
372 |
-- return SANE_STATUS_GOOD; |
373 |
-- } |
374 |
-- } |
375 |
-- |
376 |
- /* and we don't need to acquire next block */ |
377 |
- if (dev->final_block) { |
378 |
- int slack = dev->total_img_size - dev->total_out_size; |
379 |
-@@ -1311,10 +1159,7 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) |
380 |
- /* this will never happen */ |
381 |
- DBG(1, "image overflow %d bytes\n", dev->total_img_size - dev->total_out_size); |
382 |
- } |
383 |
-- if (isSupportedDevice(dev) && |
384 |
-- dev->composition == MODE_RGB24) { |
385 |
-- remove(encTmpFileName); |
386 |
-- } |
387 |
-+ |
388 |
- /* that's all */ |
389 |
- dev_stop(dev); |
390 |
- return SANE_STATUS_EOF; |
391 |
-@@ -1365,18 +1210,9 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) |
392 |
- |
393 |
- if (buf && lenp) { /* read mode */ |
394 |
- /* copy will do minimal of valid data */ |
395 |
-- if (dev->para.format == SANE_FRAME_RGB && dev->line_order) { |
396 |
-- if (isSupportedDevice(dev)) { |
397 |
-- clrlen = dump_to_tmp_file(dev); |
398 |
-- /* decompress after reading entire block data*/ |
399 |
-- if (0 == dev->blocklen) { |
400 |
-- decompress_tempfile(dev); |
401 |
-- } |
402 |
-- copy_decompress_data(dev, buf, maxlen, &olen); |
403 |
-- } else { |
404 |
-- clrlen = copy_mix_bands_trim(dev, buf, maxlen, &olen); |
405 |
-- } |
406 |
-- } else |
407 |
-+ if (dev->para.format == SANE_FRAME_RGB && dev->line_order) |
408 |
-+ clrlen = copy_mix_bands_trim(dev, buf, maxlen, &olen); |
409 |
-+ else |
410 |
- clrlen = copy_plain_trim(dev, buf, maxlen, &olen); |
411 |
- |
412 |
- dev->datalen -= clrlen; |
413 |
-@@ -1455,9 +1291,6 @@ sane_start(SANE_Handle h) |
414 |
- if (!dev->data && !(dev->data = malloc(DATASIZE))) |
415 |
- return ret_cancel(dev, SANE_STATUS_NO_MEM); |
416 |
- |
417 |
-- if (!dev->decData && !(dev->decData = malloc(POST_DATASIZE))) |
418 |
-- return ret_cancel(dev, SANE_STATUS_NO_MEM); |
419 |
-- |
420 |
- if (!dev_acquire(dev)) |
421 |
- return dev->state; |
422 |
- |
423 |
-@@ -1479,22 +1312,6 @@ sane_start(SANE_Handle h) |
424 |
- |
425 |
- dev->total_img_size = dev->para.bytes_per_line * dev->para.lines; |
426 |
- |
427 |
-- if (isSupportedDevice(dev) && |
428 |
-- dev->composition == MODE_RGB24) { |
429 |
-- int fd; |
430 |
-- remove(encTmpFileName); |
431 |
-- |
432 |
-- /* Precreate temporary file in exclusive mode. */ |
433 |
-- fd = open(encTmpFileName, O_CREAT|O_EXCL, 0600); |
434 |
-- if (fd == -1) { |
435 |
-- DBG(3, "%s: %p, can't create temporary file %s: %s\n", __func__, |
436 |
-- (void *)dev, encTmpFileName, strerror(errno)); |
437 |
-- return ret_cancel(dev, SANE_STATUS_ACCESS_DENIED); |
438 |
-- } |
439 |
-- close(fd); |
440 |
-- } |
441 |
-- dev->currentDecDataIndex = 0; |
442 |
-- |
443 |
- return SANE_STATUS_GOOD; |
444 |
- } |
445 |
- |
446 |
-diff --git a/backend/xerox_mfp.h b/backend/xerox_mfp.h |
447 |
-index 3d93f06d..ea89dda2 100644 |
448 |
---- a/backend/xerox_mfp.h |
449 |
-+++ b/backend/xerox_mfp.h |
450 |
-@@ -74,10 +74,6 @@ struct device { |
451 |
- #define DATATAIL(dev) ((dev->dataoff + dev->datalen) & DATAMASK) |
452 |
- #define DATAROOM(dev) dataroom(dev) |
453 |
- |
454 |
--#define POST_DATASIZE 0xFFFFFF |
455 |
-- SANE_Byte *decData; |
456 |
-- int decDataSize; |
457 |
-- int currentDecDataIndex; |
458 |
- /* data from CMD_INQUIRY: */ |
459 |
- int resolutions; /* supported resolution bitmask */ |
460 |
- int compositions; /* supported image compositions bitmask */ |
461 |
-@@ -102,7 +98,6 @@ struct device { |
462 |
- int composition; /* MODE_ */ |
463 |
- int doc_source; /* document source */ |
464 |
- int threshold; /* brightness */ |
465 |
-- int compressionTypes; |
466 |
- |
467 |
- /* CMD_READ data. It is per block only, image could be in many blocks */ |
468 |
- int blocklen; /* image data block len (padding incl.) */ |
469 |
-diff --git a/doc/descriptions/xerox_mfp.desc b/doc/descriptions/xerox_mfp.desc |
470 |
-index d21a6be6..67253b38 100644 |
471 |
---- a/doc/descriptions/xerox_mfp.desc |
472 |
-+++ b/doc/descriptions/xerox_mfp.desc |
473 |
-@@ -320,7 +320,7 @@ |
474 |
- |
475 |
- :model "SCX-3405W" |
476 |
- :interface "Ethernet" |
477 |
--:status :good |
478 |
-+:status :basic |
479 |
- |
480 |
- :model "SCX-3400" |
481 |
- :interface "USB" |
482 |
-@@ -335,17 +335,17 @@ |
483 |
- :model "SCX-4729FD" |
484 |
- :interface "USB" |
485 |
- :usbid "0x04e8" "0x3453" |
486 |
--:status :good |
487 |
-+:status :basic |
488 |
- |
489 |
- :model "CLX-6260" |
490 |
- :interface "USB" |
491 |
- :usbid "0x04e8" "0x3455" |
492 |
--:status :good |
493 |
-+:status :minimal |
494 |
- |
495 |
- :model "CLX-3300 Series" |
496 |
- :interface "USB" |
497 |
- :usbid "0x04e8" "0x3456" |
498 |
--:status :good |
499 |
-+:status :basic |
500 |
- |
501 |
- :model "SCX-470x" |
502 |
- :interface "USB" |
503 |
-@@ -355,7 +355,7 @@ |
504 |
- :model "CLX-4190" |
505 |
- :interface "USB" |
506 |
- :usbid "0x04e8" "0x345a" |
507 |
--:status :good |
508 |
-+:status :minimal |
509 |
- |
510 |
- :model "SCX-4650 4x21S Series" |
511 |
- :interface "USB" |
512 |
--- |
513 |
-2.17.0 |
514 |
- |
515 |
|
516 |
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-uninitialized-variable.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-uninitialized-variable.patch |
517 |
deleted file mode 100644 |
518 |
index 0311975c0ce..00000000000 |
519 |
--- a/media-gfx/sane-backends/files/sane-backends-1.0.27-uninitialized-variable.patch |
520 |
+++ /dev/null |
521 |
@@ -1,25 +0,0 @@ |
522 |
-From dd61ef1cc84299781e382b9258d97102cee192b4 Mon Sep 17 00:00:00 2001 |
523 |
-From: Olaf Meeuwissen <paddy-hack@××××××××××.org> |
524 |
-Date: Thu, 3 Aug 2017 18:50:05 +0900 |
525 |
-Subject: [PATCH] genesys: Fix use of uninitialized variable |
526 |
- |
527 |
-See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869673 |
528 |
---- |
529 |
- backend/genesys.c | 1 + |
530 |
- 1 file changed, 1 insertion(+) |
531 |
- |
532 |
-diff --git a/backend/genesys.c b/backend/genesys.c |
533 |
-index 1c1bbf4..0b644c4 100644 |
534 |
---- a/backend/genesys.c |
535 |
-+++ b/backend/genesys.c |
536 |
-@@ -6237,6 +6237,7 @@ attach (SANE_String_Const devname, Genesys_Device ** devp, SANE_Bool may_wait) |
537 |
- dev->model = genesys_usb_device_list[i].model; |
538 |
- dev->vendorId = genesys_usb_device_list[i].vendor; |
539 |
- dev->productId = genesys_usb_device_list[i].product; |
540 |
-+ dev->usb_mode = 0; /* i.e. unset */ |
541 |
- dev->already_initialized = SANE_FALSE; |
542 |
- |
543 |
- DBG (DBG_info, "attach: found %s flatbed scanner %s at %s\n", |
544 |
--- |
545 |
-2.1.4 |
546 |
- |
547 |
|
548 |
diff --git a/media-gfx/sane-backends/sane-backends-1.0.27-r3.ebuild b/media-gfx/sane-backends/sane-backends-1.0.27-r3.ebuild |
549 |
deleted file mode 100644 |
550 |
index 3470233904f..00000000000 |
551 |
--- a/media-gfx/sane-backends/sane-backends-1.0.27-r3.ebuild |
552 |
+++ /dev/null |
553 |
@@ -1,344 +0,0 @@ |
554 |
-# Copyright 1999-2020 Gentoo Authors |
555 |
-# Distributed under the terms of the GNU General Public License v2 |
556 |
- |
557 |
-EAPI=7 |
558 |
-inherit eutils flag-o-matic multilib-minimal systemd toolchain-funcs udev user |
559 |
- |
560 |
-# gphoto and v4l are handled by their usual USE flags. |
561 |
-# The pint backend was disabled because I could not get it to compile. |
562 |
-IUSE_SANE_BACKENDS=" |
563 |
- abaton |
564 |
- agfafocus |
565 |
- apple |
566 |
- artec |
567 |
- artec_eplus48u |
568 |
- as6e |
569 |
- avision |
570 |
- bh |
571 |
- canon |
572 |
- canon630u |
573 |
- canon_dr |
574 |
- canon_pp |
575 |
- cardscan |
576 |
- coolscan |
577 |
- coolscan2 |
578 |
- coolscan3 |
579 |
- dc210 |
580 |
- dc240 |
581 |
- dc25 |
582 |
- dell1600n_net |
583 |
- dmc |
584 |
- epjitsu |
585 |
- epson |
586 |
- epson2 |
587 |
- fujitsu |
588 |
- genesys |
589 |
- gt68xx |
590 |
- hp |
591 |
- hp3500 |
592 |
- hp3900 |
593 |
- hp4200 |
594 |
- hp5400 |
595 |
- hp5590 |
596 |
- hpljm1005 |
597 |
- hpsj5s |
598 |
- hs2p |
599 |
- ibm |
600 |
- kodak |
601 |
- kodakaio |
602 |
- kvs1025 |
603 |
- kvs20xx |
604 |
- kvs40xx |
605 |
- leo |
606 |
- lexmark |
607 |
- ma1509 |
608 |
- magicolor |
609 |
- matsushita |
610 |
- microtek |
611 |
- microtek2 |
612 |
- mustek |
613 |
- mustek_pp |
614 |
- mustek_usb |
615 |
- mustek_usb2 |
616 |
- nec |
617 |
- net |
618 |
- niash |
619 |
- p5 |
620 |
- pie |
621 |
- pixma |
622 |
- plustek |
623 |
- plustek_pp |
624 |
- pnm |
625 |
- qcam |
626 |
- ricoh |
627 |
- rts8891 |
628 |
- s9036 |
629 |
- sceptre |
630 |
- sharp |
631 |
- sm3600 |
632 |
- sm3840 |
633 |
- snapscan |
634 |
- sp15c |
635 |
- st400 |
636 |
- stv680 |
637 |
- tamarack |
638 |
- teco1 |
639 |
- teco2 |
640 |
- teco3 |
641 |
- test |
642 |
- u12 |
643 |
- umax |
644 |
- umax1220u |
645 |
- umax_pp |
646 |
- xerox_mfp" |
647 |
- |
648 |
-IUSE="gphoto2 ipv6 snmp systemd threads usb v4l xinetd zeroconf" |
649 |
- |
650 |
-for backend in ${IUSE_SANE_BACKENDS}; do |
651 |
- case ${backend} in |
652 |
- # Disable backends that require parallel ports as no one has those anymore. |
653 |
- canon_pp|hpsj5s|mustek_pp|\ |
654 |
- pnm) |
655 |
- IUSE+=" -sane_backends_${backend}" |
656 |
- ;; |
657 |
- mustek_usb2|kvs40xx) |
658 |
- IUSE+=" sane_backends_${backend}" |
659 |
- ;; |
660 |
- *) |
661 |
- IUSE+=" +sane_backends_${backend}" |
662 |
- esac |
663 |
-done |
664 |
- |
665 |
-REQUIRED_USE=" |
666 |
- sane_backends_mustek_usb2? ( threads ) |
667 |
- sane_backends_kvs40xx? ( threads ) |
668 |
-" |
669 |
- |
670 |
-DESCRIPTION="Scanner Access Now Easy - Backends" |
671 |
-HOMEPAGE="http://www.sane-project.org/" |
672 |
-MY_P="${P}" |
673 |
-FRS_ID="4224" |
674 |
-SRC_URI="https://alioth.debian.org/frs/download.php/file/${FRS_ID}/${P}.tar.gz" |
675 |
- |
676 |
-LICENSE="GPL-2 public-domain" |
677 |
-SLOT="0" |
678 |
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux" |
679 |
- |
680 |
-RDEPEND=" |
681 |
- sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] ) |
682 |
- sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] ) |
683 |
- sane_backends_dell1600n_net? ( |
684 |
- >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] |
685 |
- >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}] |
686 |
- ) |
687 |
- sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
688 |
- sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
689 |
- sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
690 |
- usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] ) |
691 |
- gphoto2? ( |
692 |
- >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}] |
693 |
- >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] |
694 |
- ) |
695 |
- v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] ) |
696 |
- xinetd? ( sys-apps/xinetd ) |
697 |
- snmp? ( net-analyzer/net-snmp:0= ) |
698 |
- systemd? ( sys-apps/systemd:0= ) |
699 |
- zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] ) |
700 |
-" |
701 |
- |
702 |
-DEPEND="${RDEPEND} |
703 |
- v4l? ( sys-kernel/linux-headers ) |
704 |
- >=sys-devel/gettext-0.18.1 |
705 |
- virtual/pkgconfig |
706 |
-" |
707 |
- |
708 |
-MULTILIB_CHOST_TOOLS=( |
709 |
- /usr/bin/sane-config |
710 |
-) |
711 |
- |
712 |
-pkg_setup() { |
713 |
- enewgroup scanner |
714 |
- enewuser saned -1 -1 -1 scanner |
715 |
-} |
716 |
- |
717 |
-src_prepare() { |
718 |
- default |
719 |
- |
720 |
- cat >> backend/dll.conf.in <<-EOF |
721 |
- # Add support for the HP-specific backend. Needs net-print/hplip installed. |
722 |
- hpaio |
723 |
- # Add support for the Epson-specific backend. Needs media-gfx/iscan installed. |
724 |
- epkowa |
725 |
- EOF |
726 |
- |
727 |
- eapply "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch |
728 |
- eapply "${FILESDIR}"/${PN}-1.0.27-disable-usb-tests.patch |
729 |
- |
730 |
- # From Arch |
731 |
- eapply "${FILESDIR}"/${PN}-1.0.27-network.patch |
732 |
- |
733 |
- # From Fedora |
734 |
- # Fix https://bugs.gentoo.org/635348 |
735 |
- eapply "${FILESDIR}"/${PN}-1.0.27-canon-lide-100.patch |
736 |
- # Fix https://bugs.gentoo.org/653300 |
737 |
- eapply "${FILESDIR}"/${PN}-1.0.27-revert-samsung.patch |
738 |
- |
739 |
- # From Debian |
740 |
- eapply "${FILESDIR}"/${PN}-1.0.27-uninitialized-variable.patch |
741 |
- |
742 |
- # Fix for "make check". Upstream sometimes forgets to update this. |
743 |
- local ver=$(./configure --version | awk '{print $NF; exit 0}') |
744 |
- sed -i \ |
745 |
- -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \ |
746 |
- testsuite/tools/data/html* || die |
747 |
-} |
748 |
- |
749 |
-src_configure() { |
750 |
- append-flags -fno-strict-aliasing # From Fedora |
751 |
- |
752 |
- # if LINGUAS is set, just use the listed and supported localizations. |
753 |
- if [[ ${LINGUAS+set} == "set" ]]; then |
754 |
- mkdir -p po || die |
755 |
- strip-linguas -u po |
756 |
- printf '%s\n' ${LINGUAS} > po/LINGUAS |
757 |
- fi |
758 |
- |
759 |
- multilib-minimal_src_configure |
760 |
-} |
761 |
- |
762 |
-multilib_src_configure() { |
763 |
- # the blank is intended - an empty string would result in building ALL backends. |
764 |
- local BACKENDS=" " |
765 |
- |
766 |
- use gphoto2 && BACKENDS="gphoto2" |
767 |
- use v4l && BACKENDS="${BACKENDS} v4l" |
768 |
- for backend in ${IUSE_SANE_BACKENDS}; do |
769 |
- if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then |
770 |
- BACKENDS="${BACKENDS} ${backend}" |
771 |
- fi |
772 |
- done |
773 |
- |
774 |
- local myconf=( |
775 |
- $(use_with usb) |
776 |
- $(multilib_native_use_with snmp) |
777 |
- ) |
778 |
- |
779 |
- # you can only enable this backend, not disable it... |
780 |
- if use sane_backends_pnm; then |
781 |
- myconf+=( --enable-pnm-backend ) |
782 |
- fi |
783 |
- if use sane_backends_mustek_pp; then |
784 |
- myconf+=( --enable-parport-directio ) |
785 |
- fi |
786 |
- if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then |
787 |
- myconf+=( sane_cv_use_libieee1284=no ) |
788 |
- fi |
789 |
- |
790 |
- # relative path must be used for tests to work properly |
791 |
- # All distributions pass --disable-locking because /var/lock/sane/ would be a world-writable directory |
792 |
- # --without-api-spec to not automagically depend on tons of stuff |
793 |
- # that break in many ways, bug #636202, #668232, #668350 |
794 |
- # People can refer to the "Programmer's Documentation" at http://www.sane-project.org/docs.html |
795 |
- ECONF_SOURCE=${S} \ |
796 |
- SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \ |
797 |
- BACKENDS="${BACKENDS}" \ |
798 |
- econf \ |
799 |
- --disable-locking \ |
800 |
- --without-api-spec \ |
801 |
- $(use_with gphoto2) \ |
802 |
- $(multilib_native_use_with systemd) \ |
803 |
- $(use_with v4l) \ |
804 |
- $(use_enable ipv6) \ |
805 |
- $(use_enable threads pthread) \ |
806 |
- $(use_enable zeroconf avahi) \ |
807 |
- "${myconf[@]}" |
808 |
-} |
809 |
- |
810 |
-multilib_src_compile() { |
811 |
- emake VARTEXFONTS="${T}/fonts" |
812 |
- |
813 |
- if tc-is-cross-compiler; then |
814 |
- pushd "${BUILD_DIR}"/tools >/dev/null || die |
815 |
- |
816 |
- # The build system sucks and doesn't handle this properly. |
817 |
- # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366 |
818 |
- tc-export_build_env BUILD_CC |
819 |
- ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \ |
820 |
- -I. -I../include -I"${S}"/include \ |
821 |
- "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \ |
822 |
- "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die |
823 |
- local dirs=( hal hotplug hotplug-ng udev ) |
824 |
- local targets=( |
825 |
- hal/libsane.fdi |
826 |
- hotplug/libsane.usermap |
827 |
- hotplug-ng/libsane.db |
828 |
- udev/libsane.rules |
829 |
- ) |
830 |
- mkdir -p "${dirs[@]}" || die |
831 |
- emake "${targets[@]}" |
832 |
- |
833 |
- popd >/dev/null |
834 |
- fi |
835 |
- |
836 |
- if use usb; then |
837 |
- sed -i -e '/^$/d' \ |
838 |
- tools/hotplug/libsane.usermap || die |
839 |
- fi |
840 |
-} |
841 |
- |
842 |
-multilib_src_install() { |
843 |
- emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \ |
844 |
- docdir="${EPREFIX}"/usr/share/doc/${PF} |
845 |
- |
846 |
- if multilib_is_native_abi; then |
847 |
- if use usb; then |
848 |
- insinto /etc/hotplug/usb |
849 |
- doins tools/hotplug/libsane.usermap |
850 |
- fi |
851 |
- |
852 |
- udev_newrules tools/udev/libsane.rules 41-libsane.rules |
853 |
- insinto "/usr/share/pkgconfig" |
854 |
- doins tools/sane-backends.pc |
855 |
- fi |
856 |
-} |
857 |
- |
858 |
-multilib_src_install_all() { |
859 |
- keepdir /var/lib/lock/sane |
860 |
- fowners root:scanner /var/lib/lock/sane |
861 |
- fperms g+w /var/lib/lock/sane |
862 |
- dodir /etc/env.d |
863 |
- |
864 |
- if use systemd; then |
865 |
- systemd_newunit "${FILESDIR}"/saned_at.service "saned@.service" |
866 |
- systemd_newunit "${FILESDIR}"/saned.socket saned.socket |
867 |
- fi |
868 |
- |
869 |
- if use usb; then |
870 |
- exeinto /etc/hotplug/usb |
871 |
- doexe tools/hotplug/libusbscanner |
872 |
- newdoc tools/hotplug/README README.hotplug |
873 |
- fi |
874 |
- |
875 |
- dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux |
876 |
- find "${D}" -name '*.la' -delete || die |
877 |
- |
878 |
- if use xinetd; then |
879 |
- insinto /etc/xinetd.d |
880 |
- doins "${FILESDIR}"/saned |
881 |
- fi |
882 |
- |
883 |
- newinitd "${FILESDIR}"/saned.initd saned |
884 |
- newconfd "${FILESDIR}"/saned.confd saned |
885 |
-} |
886 |
- |
887 |
-pkg_postinst() { |
888 |
- if use xinetd; then |
889 |
- elog "If you want remote clients to connect, edit" |
890 |
- elog "/etc/sane.d/saned.conf and /etc/hosts.allow" |
891 |
- fi |
892 |
- |
893 |
- if ! use systemd; then |
894 |
- elog "If you are using a USB scanner, add all users who want" |
895 |
- elog "to access your scanner to the \"scanner\" group." |
896 |
- fi |
897 |
-} |