The current warnings do not explain to the administrator what risks may
actually be involved by exposing saned to the network, so that they can
take the appropriate measures.
Currently the administrator is advised to restrict incoming connections
to saned (using tcpwrappers and/or firewall rules). This might not have
been the typical posture when this was written. More importantly, these
actions are not meant to protect against a loss of confidentiality, and
the administrator should not be led to believe this is the case.
Suggest the use of a secure tunnel between each client and saned, which
can be achieved without modifying the software.
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.
malloc returns NULL on error, but this code errors out on the non-NULL pointer
indicating success (which essentially makes this function always fail).
Signed-off-by: Raphael Isemann <teemperor@gmail.com>
Windows does not allow filenames ending in a period ("."), preventing
this git repository from even being checked out on a Windows system.
Drop the trailing period in these two filenames. Both files will still
be skipped during the build, since they are not included in DESC_FILES
or DESC_EXT_FILES in doc/Makefile.am.
Mainly consists of removing code for #ifdef __KERNEL__
In order to keep it really clear what code has been removed, I have
not corrected any formatting issues.
GCC warns that an unsigned value is passed to abs(), which may not be
intended. To resolve this warning, adjust the code so abs() is not used
and the behavior is more explicit.
If the weights file pathname is longer than PATH_MAX, it may be written
past the end of the buffer on the stack; or it may be truncated when it
is written to allocated memory (such that it is not null-terminated).
Adjust the code to fix both issues. Dynamically allocate memory for the
actual length of the pathname so that it is not constrained by PATH_MAX.
labs() has a signed parameter. However the argument to it here was the
difference between two unsigned values, which itself remains unsigned.
GCC warned that using this in labs() might not have the intended result.
By definition though, dwInc >= m_dwIdealGain >= dwDec, so labs() is not
even needed in this expression.
The output from the SCSI inquiry command uses fixed-length space-padded
strings, which are copied into null-terminated strings before use.
This is currently done using strncpy(), with the count parameter set to
the string's fixed length. Because a null terminator is not encountered
in the input, strncpy() does not write one in the output, and GCC warns
about potential string truncation. A null terminator is added manually,
but this is error prone (as shown by the fix for the microtek backend).
Use snprintf() instead, which guarantees a null-terminated result and
resolves the warnings from GCC.
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.
Remove an extraneous log message.
Ensure that a separate log message is only printed when the preceding
if-statement is true (and its string argument has actually been set).
Both issues were identified from GCC warnings about indentation.
abs() has an integer parameter and returns an integer value. Floating-
point values should be passed to fabs() instead.
In particular, this affected calculations for gain and offset, where a
value with floating-point precision is clearly expected.