Wykres commitów

339 Commity (master)

Autor SHA1 Wiadomość Data
Ralph Little 0006ce6326 scanimage: added missing newline character in help text. 2025-03-17 08:54:32 -07:00
Andrew Bower 6b7c4477f0 saned: use pidfd to avoid unnecessary frequent wake-ups
Avoid waking up every 500ms in standalone mode to reap any terminated
child processes if pidfds are available. This benefits Linux users with
kernel version 5.3 and glibc 2.36 or later.

Introduces a linked list of fds combining listening sockets and pidfds
and creates a poll set from this list as required.

Child process tracking is now generalised so that the Avahi service is
handled in the same way as client connection processes.
2024-10-23 07:19:32 +01:00
Andrew Bower bab5e988c1 saned: reap last child process
The loop to close and remove the child process descriptors erroneously
expected a live next pointer before handling a node in the list,
resulting in the last node never being processed.
2024-10-23 07:09:09 +01:00
Andrew Bower a5fec95a40 saned: increment child count in add_child()
Previously this count was not being incremented when it should have
been.
2024-10-23 07:09:09 +01:00
Andrew Bower 65442082a8 saned: catch SIGINT,SIGTERM in foreground listener
These signals were only being caught when daemonised but should also be
handled with the non-daemonised standalone server otherwise child
processes like the Avahi service can remain after the main process
is terminated.
2024-10-23 07:09:09 +01:00
Andrew Bower 4dcab5befb saned: add missing DBG() line terminations 2024-10-23 07:09:06 +01:00
Guillaume Girol 849e48c58b saned: add option to allow relaying network scanners
My intended use case is the following:
I want to compile saned backends with different libraries (for example
glibc) than a specific application (as if it were a chroot of another
distro version). This application cannot dlopen sane
backends because of the library mismatch.
The specific application will be
built with a stripped down libsane that only has the net backend,
and therefore very few dependencies. The net backend points to saned.
saned has a full config and set of backends, and is responsible for
exporting all scanners to the application. This option allows to
reexport network scanners this way. I only have to make sure saned does
not contact itself.
2024-02-25 12:00:00 +00:00
Tom Meyer-Mallorie 7df77203ad Correctly set O_NONBLOCK flag and disallow further reception using shutdown on saned data fd once a connection is open. 2023-10-07 22:51:00 +01:00
Ordissimo 5978899b54 Fix qpdfview error : Invalid XRef entry 0 2023-09-20 08:58:49 +02:00
Ralph Little 536e486ff7 Merge branch 'saned-doc' into 'master'
doc/saned: Improve service configuration details and security warnings

See merge request sane-project/backends!717
2023-02-21 04:00:50 +00:00
Ralph Little e584a8c503 scanimage: fix for merge failure.
Two changes were made recently for the batch processing component
in scanimage. It's not too bad, just a couple of unused local vars.
Conflict was between some refactoring that I did and a change to
the processing for --batch-prompt.
2023-02-20 16:07:17 -08:00
Ralph Little 10b3345a1c Merge branch '16-low-default-buffer-size-results-in-poor-scanner-performance' into 'master'
Resolve "Low default buffer size results in poor scanner performance"

Closes #16

See merge request sane-project/backends!773
2023-02-20 23:51:26 +00:00
Ralph Little 30eb01674a saned: new header stdint.h required for SIZE_MAX. 2023-02-20 15:39:57 -08:00
Ralph Little b5058ff5ed saned: increase default buffer size for backend comms to 1MB
Also added an option to change it.
2023-02-20 15:25:21 -08:00
Ralph Little 660547e33c Merge branch 'master' into 'B-promptReturn'
# Conflicts:
#   frontend/scanimage.c
2023-02-13 21:15:18 +00:00
Ralph Little 373dceaa36 scanimage: more generic fix for selecting a common basename function.
We have been specially including libgen.h to get a version in other
platforms such as macOS and FreeBSD. However, it is dangerous to
make assumptions about which version of basename that we will get.
So this change reverts to asking for the version that modifies the
argument and creates a copy of the arg that we *can* modify.
2023-02-13 12:32:35 -08:00
Matthew Gilmore 3222d342eb Less stack diddling 2023-02-10 04:13:13 +00:00
Matthew Gilmore 8072c2e895 batch-prompt - handle EOF and \n more accurately 2023-02-09 20:06:30 -08:00
Ralph Little b9fbe0b82e scanimage: handle backends that provide options with null attributes
HPAIO backend in some instances provides options that have NULL name.
It might be that it is using SETTABLE flag to disable options rather
than removing them from the options list. Or it might just be a
backend bug.
2023-02-04 16:16:54 -08:00
Ralph Little 370547fc60 scanimage, jpegtopdf: fixes for FreeBSD header definitions. 2023-01-06 23:36:43 -08:00
Ralph Little f15a40c1bb scanimage: default buffer size increased to 1MB
Because -B argument was optional and specified 1MB if left out I have
made the argument mandatory now and updated the man page to match.
2022-12-04 10:00:47 -08:00
Ralph Little fc77717507 scanimage: some prep clean up work.
- reduce scope of some variables
- move full_optstring to global so that scanimage_exit can clean it up
- initialize global variables. Global statics are not initialized.
- some other more minor things
2022-12-04 09:29:02 -08:00
David Ward 12560890a6 Fix header file used for poll()
POSIX specifies the header to include is <poll.h>, not <sys/poll.h>.
This results in a compiler warning with musl libc (on Alpine Linux).
2022-04-21 23:37:33 -04:00
David Ward db009d158e doc/saned: Move service configuration details out of man page
The saned(8) man page should be used to describe the behavior of saned
itself. The information about configuring inetd, xinetd, or systemd to
launch saned - while it is helpful - belongs in a separate location.
Keep in mind that distribution packages usually configure the service
automatically, and they may ship with their own specific instructions.
(For example, update-inetd can be used in Debian and its derivatives.)

This change moves this information from the man page into a new file,
making it more concise as well. Working examples are moved to separate
files that can be copied directly from the source tree to the system.
2022-04-14 19:14:50 -04:00
David Ward f3162bafa8 Replace variable self-assignments to avoid Clang warnings
These were intended to suppress GCC warnings about unused variables.
However, this leads to different warnings from Clang instead.

Use another approach that suppresses warnings from both compilers.
2022-03-08 19:00:00 -05:00
Ralph Little 047fa8498f Resolve "Issues making on osx" 2022-02-22 17:37:48 +00:00
Ralph Little a0ca5a4fc4 Resolve "[hp5590] Read only values aren't accessible via CLI options (unrecognized option)" 2022-02-21 22:13:28 +00:00
Ordissimo d25f5db739 Add format pdf. 2021-09-22 15:14:15 +00:00
Andrew Sayers a6ffa6c8f8 scanimage: mention when an option is advanced 2021-03-30 11:51:21 +01:00
Olaf Meeuwissen e79adde8b2
Use URL to refer users to copies of the GPL and LGPL
With the exception of use in three quotes as well as our inlcuded copy
of the GPL, all use of the Free Software Foundation's postal address
has been removed.

Re #320.
2021-02-12 17:41:38 +09:00
Olaf Meeuwissen a83126fc23
Work around missing C++ symbols for static linking scenarios 2021-02-07 21:06:38 +09:00
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