| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The kernel change
"e746f3451ec7 scsi: iscsi: Fix iface sysfs attr detection"
fixed an apparently very-long-standing issue blocking iface attribute
visibility in sysfs.
With that fixed, and networking configuration for the iface now being
readable from sysfs, iscsiadm is showing errors when be2iscsi (and
probably qla4xxx from looking at the code) expose VLAN attributes but
don't have a VLAN configured. Both drivers then return EINVAL on a read
to vlan_id or vlan_priority.
iSCSI ERROR: Error when reading '/sys/class/iscsi_iface/ipv4-iface-17-0/vlan_id': 22 # sysfs.c:iscsi_sysfs_prop_get_ll():282
iSCSI ERROR: Error when reading '/sys/class/iscsi_iface/ipv4-iface-17-0/vlan_priority': 22 # sysfs.c:iscsi_sysfs_prop_get_ll():282
This change makes the libopeniscsiusr code ignore a read return of
EINVAL when ignore_error is set, treating it the same as a non-existent
sysfs file for optional attributes.
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|
|
|
|
| |
cleaned up the new define using SBINDIR to match
the rest of the code.
|
|
|
|
|
| |
Two small bits in libopeniscsi usr were missed when
making sbindir configurable. One was just cosmetic.
|
|
|
|
|
|
|
|
|
|
| |
A Recent commit, fff82c57f5df ("Use "sbindir" for
path in systemd service files") added the ability
to have our binaries in another location rather
than /sbin (e.g. /usr/sbin), but it was incomplete.
This commit finishes the job.
Fixes: fff82c57f5dfe6d3db795f1195b4d2ebc497d33c
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 76350316de38 ("Handle IPv6 interfaces correctly.") added
a string copy that creates this gcc-11 error message:
> gcc-11 -O2 -g -Wall -Werror -Wextra -fvisibility=hidden -fPIC -I/usr/include/kmod -c -o idbm.o idbm.c
> idbm.c: In function ‘_idbm_node_rec_link’:
> idbm.c:999:17: error: ‘strncpy’ specified bound 65 equals destination size [-Werror=stringop-truncation]
> 999 | strncpy((*node).iface.name, iface_name, ISCSI_MAX_IFACE_LEN);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So copy one less character, maximum.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For IPv6 interface files (in iscsi/ifaces), assume
the interface uses IPv4 unless it has "ipv6" in the
name. Also, when creating interface files, name
them ending with "ipv6.N" or "ipv4.N", where "N" is
the interface number (normally zero). This was
being done in one place, and this commit makes
sure all places that create interface files use
this convention.
Note that iscsiadm cannot determine if the interface
file is IPv6 vs IPv4 from the contents because of
the way it processes those files: it creates a template
of "legal" values, then processes the file. But it
needs to know IPv4 vs IPv6 when creating the template.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
through iscsi_sessions_get()
Suppress the error message from iscsi_session_get when it's being called
through iscsi_sessions_get now that it's not being treated as an error.
There's no reason to be so alarmed the session being read in isn't
specified exactly.
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When looping over all sessions with iscsi_sessions_get, it's possible to
race against sessions being destroyed and have the sysfs attribute files
be removed before they're read. Let's not treat this as an error, and
simply drop the session that failed to read from the list. I think it
makes sense to treat session that disapear while they're being read as
if they were already gone when the sessions directory was first scanned.
Apparently having iscsiadm exit with an error when trying to get a list
of sessions is a problem for OpenStack deployments.
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The error message in iscsi_session_get [libopeniscsiusr/session.c:140]
when a session or connection path isn't found in sysfs was failing to
print the session ID, instead it printed the address of the static
string for the remainder of the message ("does not exists") due to an
extra comma.
Additionally change all occurances of "does not exists" to "does not
exist"
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|\
| |
| | |
Change mkdir permissions to 0770, adjust umask
|
| |
| |
| |
| |
| |
| |
| | |
- Change mkdir() permissions from 0660 to 0770 so that there
are not SELinux dac_override violations.
- Adjust the umask to preserve execute bit permission on directories
created in iscsid and iscsiadm.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Memory allocated by iscsi_context_new() would not be freed if
error occurred during parameters parser stage and goto free_ifaces
is used to jump to resource clean.
Since all resource clean is performed after verified, so change
all goto free_ifaces to goto out where handles resource better.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If _iscsi_sids_get() gets 0 session, *session_count is 0, while
calloc(*session_count, ...) might return a valid pointer although
*session_count is 0.
The memory allocated by calloc() would be freed in
iscsi_session_free() where did not perform free operation
if session_count is zero.
So memory leak would occur if _iscsi_sids_get() gets 0 session,
this patch just goto out on if _iscsi_sids_get() gets 0 session to
avoid calloc() being called.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If _scandir() gets 0 node, *node_count is 0, while
calloc(*node_count, ...) might return a valid pointer although
*node_count is 0.
The memory allocated by calloc() would be freed in
iscsi_nodes_free() where did not perform free operation
if node_count is zero.
So memory leak might occur if _scandir() get 0 node.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This compares value member of int_list_tbl struct which is of unsigned
int type.
struct int_list_tbl {
const char *name;
unsigned int value;
};
Clang compiler reports this comparison when
-Wtautological-constant-out-of-range-compare is enabled
| idbm.c:1042:2: error: result of comparison of constant 18446744073709551615 with expression of type 'unsigned int' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
| _rec_int_list(SESSION_CHAP_ALGS, recs, node, session.auth.chap_algs,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| idbm.c:263:23: note: expanded from macro '_rec_int_list'
| if (_org->_name[_i] != ~0UL) { \
| ~~~~~~~~~~~~~~~ ^ ~~~~
Since max value for int can be less than unsinged long e.g. on LP64 its
better to use UINT_MAX here
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
Running "make check" in the libopeniscsiusr directory found
two memory leaks. The fix was to free the memory.
|
|\
| |
| | |
Fix bug with libopeniscsiusr.pc
|
| |
| |
| |
| |
| | |
The library name is libopeniscsiusr, so the -l linker option should be
`-lopeniscsiusr` instead of `-liscsiusr`.
|
|/
|
|
|
|
|
|
| |
Introduces support for preference lists in configuration files, and uses
that for the 'node.session.auth.chap_algs' setting.
This is also re-used for discovery authentication, rather than have two
different configurations.
|
|
|
|
|
|
|
|
|
|
|
| |
Updated Changelog and two include files.
Note that this bumps the minor version number from
0 to 1, and starts the "patch" version number over
again at 0.
See https://semver.org for information on semantic
versioning.
|
|
|
|
| |
Updated Changelog and two include files.
|
|
|
|
|
| |
Convert /var/run to /run, and convert /var/lock to /run/lock,
as per modern requirements on use of the /var directory.
|
|
|
|
|
|
|
|
| |
This is a regression, in that "iface.example" was
ignored in pre-libopeniscsiusr days. But now, if
you run "iscsiadm -m iface -P1" you see a warning
about iface.example not being a valid interface file.
This commit skips that interface file in this case.
|
|
|
|
|
|
| |
These two recently-added libraries can be in different
locations on different distros, so use pkg-config to
added the appropriate actions in the make files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gcc7 warns of possible string print overflow, on i586,
when printing password length (via a macro), generating
errors like:
[ 59s] ^~~~~~~~~~~~~~~~~~~~
[ 59s] In file included from /usr/include/stdio.h:862:0,
[ 59s] from idbm.h:27,
[ 59s] from context.h:22,
[ 59s] from idbm.c:59:
[ 59s] /usr/include/bits/stdio2.h:64:10: note:
'__builtin___snprintf_chk' output between 2 and 11 bytes into a
destination of size 8
[ 59s] return __builtin___snprintf_chk (__s, __n,
__USE_FORTIFY_LEVEL - 1,
[ 59s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~
[ 59s] __bos (__s), __fmt, __va_arg_pack ());
[ 59s] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 59s] cc1: all warnings being treated as errors
[ 59s] make[1]: *** [<builtin>: idbm.o] Error 1
[ 59s] make[1]: Leaving directory
The fix is to limit the size of the string printed, so that no
overflow is possible.
The print macros in usr/idbm.c were updated, as well, to match
the newer version in libopeniscsiusr/idbm.c, also to help the
i586 build.
|
|
|
|
|
| |
Updated Changelog with "git shortlog 2.0.876..HEAD", and updated
version number in two include files.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The daemon has traditionally tried to recover stale
sessions, at startup, in serial and in a forked process.
A recent commit, b9afe4709900, added the ability to limit
these retries, and it made the default 32. Commit
467946a945cc added back in the ability to retry forever,
if the retry count was set to 0, but left the default
at 32. This commit changes the default to 0, so as
not to disrupt the expected reconnection behavior by
default.
|
|
|
|
|
| |
There is no reason to continue to use fork/exec to probe
for modules, so remove the code that supported this.
|
|
|
|
|
|
|
| |
Add new configuration value session.relogin_max, which
will default to 32. The limits the session-recovery
relogin attempts to about 64 seconds (2 seconds between
attempts) instead of an infinite number of retries.
|
|
|
|
|
|
| |
This error happens when the daemon is attempting to
reconnect a session when starting up, so should not
be considered an internal error.
|
|
|
|
|
|
| |
The message printed when ENOENT was returned for
a number-type sysfs value was missing the attribute
name parameter.
|
|
|
|
|
|
|
|
|
| |
The code for reading all sysfs integer types (of all
sizes) did not work when reading signed integers and
the return value was negative. So when the default was -1
and the value was not present, the code tried to return -1.
But the logic for checking against "max value" was
incorrect, causing INT_MAX to be returned instead of -1.
|
|
|
|
|
|
| |
If "port" is available and "persistent_port" is not, then
correctly use the one that is present for both values.
Likewise for "address" and "persistent_address".
|
|
|
|
|
| |
Do not consider it a fatal error if reading sysfs value
for "port" fails, since we allow failure for "address".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix compilation error on uclibc based systems:
==
In file included from idbm.c:59:0:
context.h:27:25: error: unknown type name ‘va_list’
const char *format, va_list args);
^
<builtin>: recipe for target 'idbm.o' failed
make[1]: *** [idbm.o] Error 1
==
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
|
|\
| |
| | |
Fix installation of libopeniscsiusr symlinks
|
| |
| |
| |
| |
| |
| |
| | |
The install(1) command dereferences symlinks when copying to the target
location, so use an alternate approach to create symlinks from scratch instead.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix compile warnings (will be treated as error):
* `strncpy` for stringop-truncation warning:
Use memcpy instead and manually add trailing '\0'.
Signed-off-by: Gris Ge <fge@redhat.com>
|
| |
| |
| |
| |
| |
| | |
This replaces the use of snprintf to a stack buffer with asprintf when
creating path strings, moving temporary buffers to the heap and avoiding
truncation issues.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The is_ipv6 flag (runtime iface rec representation only, not on disk)
was being set when creating ifaces from sysfs, but not when reading them
in from an iface record file. This caused ipv6 iface records to be
reported as malformed and ignored.
Fix that with a name check for an "ipv6" substring. Old code also looked
at other fields, this is enough to fix iface records created from sysfs
for be2iscsi and qla4xxx. Further fixes might be required for other IPv6
configurations.
|
| |
| |
| |
| |
| | |
errno must be set to 0 before calling strtoll or error checking will
have false positives
|
| |
| |
| |
| |
| |
| |
| | |
Both be2iscsi and qla4xxx export multiple iface ojbects in sysfs per
host to represent the number of network configurations (ipv4/ipv6) that
can be supported. Fix the libopeniscsiusr code to create and manage
multiple offload iface records per host, as the old code did.
|
| |
| |
| |
| |
| |
| |
| | |
The iface.prefix_len field might be present in existing records created
with older versions of the Open-iSCSI tools.
Need to not start throwing errors after an update.
|