| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Just adding more comment, and removing the check
to see if a pointer to a structure is zero.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
realloc is similar to reallocarray, except it doesn't check for integer
overflow when computing num * size.
On 32-bit systems, integer overflow may not happen because the old array
is likely to be smaller than 4G and the new array is smaller than the
old array. On 64-bit systems, integer overflow can never happen because
num is less than 4G and size is always 8.
This fixes build errors when using uClibc.
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Build: Add an iscsiuio 'build_date.sh' script
This is currently unused, but will be used by meson to
build the "build_date.[ch]" files used by iscsiuio.
* Build: have git ignore file '.setup'
I commonly use this file for shell aliases/functions.
* Add framework to support building using meson.
This adds the ability to use meson/ninja to build open-iscsi
and iscsiuio, rather than the current system that uses 'autoconf'
for iscsiuio and uses 'make' for everything else.
The old make/autoconf system is left in place, for now, but
deprecated, including a warning about that when running 'make all'
or 'make user' from the top-level.
* utils/build: enhance iscsi-iname to generate prefix
Added new "-g/--generate-iname-prefix" argument to generate the
InitiatorName= prefix. Also, updated iscsi-iname to use getopts.
Also, use the new option from meson.
* git/meson: remove 'builddir' from ignored files
The build directory can be called anything.
Suggested by: Eli Schwartz
* iscsiuio build: fix new build_date.sh script
Fixed several issues:
- fix option handling for "-S"
- fix epoch date handling from env (noticed by Eli Schwartz)
- remove debug statements
* iscsiuio meson: warn when not creating a symlink for iscsiuio
* meson: install man pages more efficiently
We don't need to specify path or subdirectory
* iscsiuio meson: remove unused source date epoch option
This option was never used, since we pass this info
from the environment.
* meson: no need to set libdir: default is fine
* iscsiuio meson: no need to add c_args: already there
* Don't generate initiatorname when cross-building (#367)
Let it be generated by the iscsi-init service.
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Set ISCSI_CONFIG_ROOT by meson
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Set LOCK_DIR from home_dir to lock_dir
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Install iface.example to db_root/ifaces
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Co-authored-by: TIAN Yuanhao <78596099+tianyuanhao@users.noreply.github.com>
Co-authored-by: TIAN Yuanhao <tianyuanhao3@163.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* build: move utils/sysdeps to top-level
The routines here are used by iscsiuio, so
move them to the top level.
* libopeniscsiusr: fix kernel-doc bugs
There were errors in four places, effecting the generated
manual pages.
* libopeniscsiusr: clean up kernel-doc usage
Simplify generation of library interface documentation using
the kernel-doc script:
* make the kernel-doc perl script executble (the only visible change)
* remove mention of sed (not used)
* stop compressing man pages -- let distros do that
* improve kernel-doc so that doc-preclean.pl and split-man.pl
are no longer needed
* add list-man-pages.sh to simplify things (copied from libnvme)
* build: keep current version number in one place
Move the current version number (now 2.1.7) into
the top-level Makefile, and out of usr/version.h and
libopeniscsiusr/version.h, completely eliminating the
need for the latter.
Note that this ties the libopeniscsiusr library idea of
"version" to the usr/ (iscsid, etc) idea of version, even
though they used to be defined separately. But they always
had the same value, so nothing lost.
* build: insteall man pages uncompressed
We were delivering some man pages compressed and other not, and
it turns out distros know how to install man pages using the
compression they prefer, so stop doing it for them.
|
|
|
|
|
|
| |
Just use PATH to find sed. Not all distributions have moved to a /usr-merged
layout yet.
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
|
|
|
|
|
|
|
|
|
|
| |
This cleans up a little more than "make clean",
in particular removing files generated from templates,
and automake-generated files in iscsiuio.
Also, a ".PHONY:" target was added where needed
so that each Makefile has a complete list of
phony targets.
|
| |
|
|\
| |
| | |
Build system tweaks from downstream
|
| |
| |
| |
| |
| |
| |
| | |
Looks like a typo from libnvme. Previously, the installed
.pc file had a blank Version field.
Signed-off-by: Sam James <sam@gentoo.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- On my system, sed appears to be at /bin/sed. So, let's allow overriding
the location.
- Allow different pkg-config paths too (useful for cross).
Signed-off-by: Sam James <sam@gentoo.org>
|
| |
| |
| |
| |
| |
| |
| | |
- Don't hardcode GCC, instead respect the detected CC (or from the environment)
- Use $(RM) as the location may vary and we've already done the work to detect it
Signed-off-by: Sam James <sam@gentoo.org>
|
| |
| |
| |
| |
| | |
Do not need redundant slashes in pathnames. Also, install header
files with the proper mode.
|
| |
| |
| |
| |
| | |
Commit 623a81123c494 ("Use pkg-config in Makefiles for newer
libraries.") added a debugging echo statement. Remove it.
|
|/
|
|
|
|
|
|
|
| |
We go to all the trouble to generate man pages for all
the libopeniscsiusr routines, but we do not install them,
so add installing them as part of the "install" target,
ut break up that target into 3 sub-targets (install_libs,
install_docs, and install_pkg_config) so that callers can
choose subsets if they wish.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds two new top-level build options: one
for the "home" directory for open-iscsi called "HOMEDIR",
and one for the "database" directory, called "DBROOT". One can
now override the defaults of "/etc/iscsi" for either or
both of these directories on the make command line.
The README and man pages are updated with details about
these new options.
Some Makefile cleanup/repair was done as well. Installation
of the initiatorname.iscsi file, was moved out of the top-level
Makefile into the etc subdirectory, and installation of man
ages moved from the top-level Makefile to the doc subdirectory.
Also, this fixes some issues from commit fd14dd8316b1 ("Clean
p Makefile build system."), which incorrectly changed the DESTDIR
ariable in the Makefiles. This current commit also fixes the
top-level variable names for moving DBROOT and HOMEDIR.
|
|
|
|
|
|
|
| |
Cleaning up the Makefiles, in preperation for adding the
ability to move files out of /etc/iscsi more easily. Also,
clean up the README file by updating it with help updated
help messages, alignment, and those pesky spaces at the ends of 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.
|