Wykres commitów

308 Commity (escl-fix-duplex-mode-hp-m578)

Autor SHA1 Wiadomość Data
Povilas Kanapickas 0c2fa6bea6 Merge branch 'fix_crash' into 'master'
Fix crash in scanimage when must_buffer is true

Closes #408

See merge request sane-project/backends!563
2020-12-26 22:19:45 +00:00
James Ring b4be10c5a2 Fix crash in scanimage when must_buffer is true
Fixes https://gitlab.com/sane-project/backends/-/issues/408.
2020-12-26 14:04:26 -08:00
James Ring ea50fb683c allow saned to listen on specified port, or an ephemeral port 2020-12-26 09:10:55 -08:00
James Ring aa228faa13 fix small memory leak in scanimage option processing 2020-12-07 14:55:32 -08:00
Ralph Little bc64c8f549 scanimage: check also for negative word_list length which is nonsensical. 2020-10-18 09:51:35 -07:00
Ralph Little 968add6706 scanimage: added checks for null constraints.
We have seen this from buggy backends that present NULL for constraint
string_lists. This is probably illegal behaviour from backends but we
don't want to crash.
2020-10-06 20:16:13 -07:00
Olaf Meeuwissen cf7227b598 Pass Avahi related preprocessor flags where needed 2020-03-14 15:48:19 +09:00
Olaf Meeuwissen 53875a5238 Fix WITH_AVAHI preprocessor conditionals
The macro is now always defined to either 0 or 1.
2020-03-14 15:46:03 +09:00
Ralph Little 180ecf7b41 scanimage: revert previous range change.
It is not settled that this change is favourable and is probably out of scope for this issue.
I will leave it for the moment.
2020-03-05 09:18:20 -08:00
Ralph Little 4948130f7c scanimage: various small corrections and little changes to enhance clarity. 2020-03-01 23:31:23 -08:00
Ralph Little 385543519b scanimage,hp5400: added option checking for hp5400 and rationalised scanimage help
h5400 now checks validity of -l, -t, -x and -y and auto selects a supported resolution.
scanimage now shows the full range for -x and -y despite other selections.
2020-03-01 22:53:48 -08:00
Olaf Meeuwissen 7f97712491 scanimage: Combine conditions to reduce nesting 2019-12-29 17:37:17 +09:00
Olaf Meeuwissen 4fbb5d2f1b scanimage: Use destination size to limit strncpy() 2019-12-28 19:05:01 +09:00
Olaf Meeuwissen df114df05f scanimage: Replace string length computations by temporary strings
This creates temporary strings that correspond to the colon-delimited
username and password that are read from file in `auth_callback()`.
The null-terminated strings are used directly to determine lengths.
2019-12-28 19:04:52 +09:00
Olaf Meeuwissen 6682223b26 scanimage: Improve readability of auth_callback implementation
Rather than repeatedly calling `strchr`, use descriptive variables to
hold the result.
2019-12-28 19:03:11 +09:00
Olaf Meeuwissen 5e6a111ffa scanimage: Un-word-wrap auth_callback to improve readability
This is one of those cases where word-wrapping to less than 80 or so
characters isn't helpful in understanding the code.
2019-12-28 18:03:00 +09:00
Louis Lagendijk 0bbb7ef3ba tstbackend: make it compile again 2019-12-03 22:05:13 +01:00
Povilas Kanapickas 9472dce5f7 scanimage: Fix 32-bit overflow when calculating total bytes to transfer 2019-11-10 13:27:53 +02:00
Olaf Meeuwissen 5cba3bd465 saned: Fix misleading log messages caused by fall through 2019-08-11 10:37:10 +09:00
Olaf Meeuwissen e42e3bc849 scanimage: Fix misleading fall through annotation
The `scanimage_exit()` call exits the program.
2019-08-11 10:23:29 +09:00
Povilas Kanapickas e40596c2a5 Fix -Wimplicit-fallthrough warnings by adding standard annotations 2019-06-30 11:58:32 +03:00
Olaf Meeuwissen 7af0d47e29 Keep warning out of redirected image data. Fixes testsuite 2019-06-30 12:45:03 +09:00
Povilas Kanapickas 1c3e1aa184 autotools: Remove files generated by autotools from version control 2019-06-01 14:38:36 +03:00
Olaf Meeuwissen be9736020f autofoo: Sync generated files
The AX_CXX_COMPILE_STDCXX* macros that were embedded in aclocal.m4
have been replaced with the versions found in the autoconf-archive
package from Debian 9.
2019-05-21 22:14:46 +09:00
Olaf Meeuwissen 2bb5ed655a Merge branch 'genesys-enable-cxx' into 'master'
Use C++ for the genesys backend

See merge request sane-project/backends!61
2019-05-20 09:10:53 +00:00
Povilas Kanapickas 728de89d71 scanimage: Guess --format from --output-file if possible 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 86e917b04b scanimage: Prevent --output-file and --batch to be used together 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 7f4944f0a7 scanimage: Warn when output format is not set 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 877cc29d88 scanimage: Raise an error if --format option is an unknown format 2019-05-11 11:45:27 +03:00
Povilas Kanapickas 9e3b5d6381 Update generated files 2019-05-11 00:03:26 +03:00
Povilas Kanapickas 5dbd51d1ec scanimage: Allow specification of the output path via option 2019-04-28 23:27:59 +03:00
Povilas Kanapickas 2653cbaec7 Run autoreconf and automake 2019-03-20 23:09:07 +02:00
Olaf Meeuwissen a78969384b autotools: Sync derived files
This was done by running

  libtoolize --copy
  autoreconf --force --install

on Debian GNU/Linux 9.3.
2018-03-17 10:35:57 +09:00
Olaf Meeuwissen f9a76395da saned: Fix typo in help message 2017-09-29 21:48:14 +09:00
Luiz Angelo Daros de Luca 5288dd5f61 saned: reorganize flags, remove run_mode SANED_RUN_DEBUG
Flags like -a, -d and -s have many overlap effects. This patch restricts
the effect of flags to a simple action.

New -u (user) flag replaces -a optional argument for running saned as a different user.
The code that retrieve the user info and drop privileges migrated to runas_user().
As a side effect, PID file can be created even if getting user info fails.

New -l (listen) flag sets run_mode to standalone.
New -D (daemonize) flag daemonizes saned after bind.
New -o (once) make saned exit after the first client disconnects.
Flag -s (syslog) is gone. Previous behavior can be reproduced with '-a -d level -o -f'.
New -e (stderr) flag for redirecting output to stderr, instead of syslog.

Flag -d (debug) now only sets the debug level and argument is required. Previous behavior
can be reproduced with '-a -d level -o -f -e'.

The run_mode SANED_RUN_DEBUG and SANED_RUN_ALONE shared most of its code
path. With the new flags dealing with their difference, SANED_RUN_DEBUG is gone.

Flag '-a' still works as before but it can be replaced by '-l -D -u user'.

Current uses of -d (debug) or -s (syslog) will break.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2017-09-29 20:43:36 +09:00
Farid Benamrouche 1f68d8d8c4 saned: Cancel scan if data connection appears to have gone away
The data connection timeout default to 4000ms but is configurable
in saned.conf.

See Alioth 315765
2017-09-07 22:37:31 +09:00
Luiz Angelo Daros de Luca fc57a5a6a5 saned: fix --debug help message (output is stderr)
Man page was correct.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2017-07-29 17:54:01 +09:00
Olaf Meeuwissen fc4b250a09 .editorconfig: use utf-8 charset throughout 2017-05-29 21:14:30 +09:00
Olaf Meeuwissen f0f187f995 .editorconfig: trim trailing blank lines 2017-05-29 21:14:30 +09:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
Olaf Meeuwissen 479ccaeddd autotools: Sync derived files
This was done by running

  autoreconf --force --install

on Debian GNU/Linux 8.8 and reverting the removal of SANE specific
tweaks to ltmain.sh.
2017-05-14 19:48:41 +09:00
Olaf Meeuwissen 9230e0c251 saned: Link against Avahi library 2017-05-13 13:12:06 +09:00
Aaron Muir Hamilton 801558f959 Write density (resolution) JFIF header information with JPEG files. 2017-05-04 18:35:05 +09:00
Olaf Meeuwissen b219bc2c73 Merge branch 'icc-profiles' 2017-05-04 18:26:55 +09:00
Olaf Meeuwissen 92e59791d2 Fix [-Werror=implicit-function-declaration] compiler error
The fileno() is only available if its feature test macro passes.  The
various symbols are defined appropriately in ../include/sane/config.h
during configuration of the build.
2017-04-30 20:05:12 +09:00
Olaf Meeuwissen adebd37b5c Fix [-Wpointer-arith] compiler warnings 2017-04-30 20:00:28 +09:00
Aaron Muir Hamilton c3903cc476 Avoid attaching grayscale ICC profiles to rgb images, or vice-versa.
If the ICC profile added does not match the colour format of the
  image, libpng will abort. This can leave the scanner motors in an
  incorrect state and possibly cause permanent damage.
2017-04-30 18:54:39 +09:00
Aaron Muir Hamilton a907b61bd5 Add ICC profile embedding for PNG output. 2017-04-30 18:54:28 +09:00
Aaron Muir Hamilton 2c653a926a Separate ICC profile loading into a separate file.
This cuts out some duplicate code, and enables us to reuse this
  logic for PNG, JPEG, and any other future output format.
  sanei_load_icc_profile also allows us to know that an ICC profile
  file is not long enough before we start to write it to the output;
  this should prevent poorly-written software from overflowing into
  image data when they read the bad profile based on its length.
2017-04-30 18:54:18 +09:00
Aaron Muir Hamilton a0321d2a92 Include physical resolution (pHYs section) in PNG output. 2017-04-27 21:39:29 +09:00