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.
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.
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.
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>
This should fix [-Wstrict-aliasing] compiler warnings on those systems
where the IN6_IS_ADDR_LOOPBACK and IN6_IS_ADDR_V4MAPPED macros exist.
POSIX.1-2001 states that they shall be defined in netinit/in.h so most
systems will probably have them.
using backend debugging using SANE_DEBUG_xxx to be used for saned controlled
scanning when using socket activation. When only the socket is received we
use the existing code path.
Network fds are of no use to the Avahi process and can cause the net
backend to hang when saned is run in debug mode.
This only happens if the net backend tries to connect to saned a second
time and manages to establish the connection before saned has completed
its shutdown.
There is some potential for this to also occur when saned is run in
standalone mode but it's far less probable as the window is a lot smaller.
Global replace of u_int??_t with C9x standard based uintxx_t
in order to remove some tricky and overlapping portability logic
from acinclude.m4 and leave it in only m4/stdint.m4.