Commit Graph

189 Commits

Author SHA1 Message Date
Bart Van Assche
9153f57314 iscsi-scst/usr/Makefile: Pass -Wno-format-truncation if supported
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7257 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-11-12 05:01:16 +00:00
Bart Van Assche
642744c9fc Fix spelling of "Ardis Technologies"
Reference: http://www.ddpsan.com/support-sales/about-us.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7165 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-05-02 22:32:06 +00:00
Vladislav Bolkhovitin
68fa7e1a0d Copyright updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-22 03:19:52 +00:00
Vladislav Bolkhovitin
82f5ffd255 iscsi-scstd: daemon handle EOF (rc == 0) from nl_fd
Daemon now handles receipt of EOF (rc == 0) from nl_fd.  Probably this never
happens in a real kernel build, but it does during shutdown in a usermode build
and it seems like it is "generically correct" in either case.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7140 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-21 01:04:16 +00:00
Vladislav Bolkhovitin
344387c40e iscsi-scstd: replace signal() with sigaction()
Replace signal() with sigaction() for validity in a multithreaded process

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7139 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-21 01:02:25 +00:00
Vladislav Bolkhovitin
74bee99f59 iscsi-scst: replace strncpy() by strlcpy()
Follow up for r7109: strlcpy() is more appropriate in this place.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7134 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-18 03:57:12 +00:00
Vladislav Bolkhovitin
eaa99a8770 Fix a few minor "extra" compiler warnings (mostly "const" issues)
Add "XXX" comments in a few places about potential problems seen in SCST code,
for future investigation and possible repair.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7123 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-14 01:03:25 +00:00
Vladislav Bolkhovitin
a2e0916fbf Fix a few compiler messages issued when some extra warnings are enabled:
casting const to non-const
    uninitialized structure members
    non-static local function
    missing enumerated switch-value cases

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7122 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-13 23:58:32 +00:00
Vladislav Bolkhovitin
bcb87d57ec iscsi: logging improvements for iscsi_scstd.c
Logging improvements for iscsi_scstd.c print more information about failures.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7113 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-13 23:16:57 +00:00
Vladislav Bolkhovitin
b71fa76b5b iscsi: fix misleading error logging in config.c
This fixes four similar instances of a very misleading and confusing logging
statement, which would print a "Wrong value" that had already been corrected by
the check function.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7112 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-13 23:15:17 +00:00
Vladislav Bolkhovitin
aa6c6a4c2f Change memcpy() to strncpy() because the source name string is not guaranteed
to exist as valid addressable memory beyond the NULL byte.

Signed-off-by: David Butterfield <dab21774@gmail.com>

with small addition to force set last byte NULL



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-13 22:38:38 +00:00
Vladislav Bolkhovitin
d236725cae create_and_open_dev() returns a (-errno), so the "if (iser_fd...)" check should
detect *any* negative return value as a case when fd should be set to -1.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7108 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-13 22:30:25 +00:00
Bart Van Assche
e372a0123e scst: Coding style updates related to whitespace
This patch changes whitespace only and nothing else.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7102 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-03-02 00:09:14 +00:00
Vladislav Bolkhovitin
0c2fd8e564 iscsi-scst: handle a case in target_del() where the target was already freed
target_del() calls handle_iscsi_events() which may recursively call target_del().
The 1st target_del() may resume its execution after the target object was already freed.

Signed-off-by: Erez Zilber <erezzi.list@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6908 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-07-02 01:42:49 +00:00
Bart Van Assche
3990a6ccd4 iscsi-scstd: Insert a blank line after declarations
Additionally, surround complex values with parentheses, declare static
char arrays const and change C++ comments into C comments.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6849 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-27 16:24:59 +00:00
Bart Van Assche
c477b5f99c iscsi-scstd: Fix more checkpatch complaints about whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6848 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-27 16:16:06 +00:00
Bart Van Assche
2681ed8bcb iscsi-scstd: Fix checkpatch complaints about whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6847 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-27 16:10:45 +00:00
Vladislav Bolkhovitin
fa2f54ac9e Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6787 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-22 04:04:43 +00:00
Bart Van Assche
f92a917d45 iscsi-scst: Suppress strict aliasing compiler warnings
Avoid that the compiler reports warnings about strict aliasing when
building iscsi-scst on RHEL 6. This patch does not change any
functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6414 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-10 22:22:57 +00:00
Bart Van Assche
11df045449 iscsiadm: Fix a resource leak in an error path
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6389 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:32:53 +00:00
Bart Van Assche
bb0a7c894a iscsi-scstd: Annotate a fall-through for Coverity
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6388 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:32:27 +00:00
Bart Van Assche
476d0ba898 iscsi-scstd: Constify several function arguments
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6387 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:32:02 +00:00
Bart Van Assche
f05dfcf88f iscsi-scstd: Suppress a compiler warning
Avoid that gcc reports the following compiler warning:
    
message.c:197:44: warning: 'rsp_data_sz' may be used uninitialized in this function [-Wmaybe-uninitialized]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6386 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:31:20 +00:00
Bart Van Assche
8a4e41fb44 iscsi-scstd: Allow the compiler to inline functions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6385 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:30:40 +00:00
Bart Van Assche
a8da0107f8 iscsiadm: Fix a resource leak
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6380 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:28:02 +00:00
Bart Van Assche
ad38432332 iscsiadm: Fix strerror() argument
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6379 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:27:41 +00:00
Bart Van Assche
a14df39942 iscsiadm: Do not allocate more memory than needed
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6378 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:27:18 +00:00
Bart Van Assche
ff2b660264 iscsiadm: Fix a file descriptor leak in an error path
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:26:35 +00:00
Bart Van Assche
f5f85b95fb iscsi-scstd: Fix a resource leak in an error path
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6376 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:26:08 +00:00
Bart Van Assche
a6121b03c8 iscsi-scstd: Fix a potential file descriptor leak
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6375 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:25:42 +00:00
Bart Van Assche
74b4104994 iscsi-scstd: Avoid that Coverity complains about a use-after-free
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6374 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:25:05 +00:00
Bart Van Assche
b3f49a0a17 iscsi-scstd: Annotate fall-throughs for Coverity
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6373 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:24:25 +00:00
Bart Van Assche
102d8d54c9 iscsi-scstd: Move two local variables to suppress a Coverity complaint
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6372 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:24:03 +00:00
Bart Van Assche
41caee3148 iscsi-scstd: Fix a file descriptor leak in an error path
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6371 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:23:38 +00:00
Bart Van Assche
21b60063a9 iscsi-scstd: Fix a dereference-before-null-check
Detected by Coverity.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6370 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:23:14 +00:00
Bart Van Assche
b099782023 iscsi-scstd: Fix a memory leak in the iSNS code
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:22:46 +00:00
Bart Van Assche
dfcb53a9b2 iscsi-scstd: Rearrange driver major number lookup code
Introduce a function for looking up the driver major number.
This patch does not change any functionality but makes the source
code easier to read and also makes it easier for Coverity to
analyze this code.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6368 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:22:14 +00:00
Bart Van Assche
165b0f1d10 iscsi-scstd: Improve create_and_open_dev() robustness
Reset 'devn' if the sscanf() return value is lower than two.
Based on a Coverity report.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:21:28 +00:00
Bart Van Assche
d70b1e39c0 iscsi-scstd: Fix a dereference-before-null-check
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6366 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 00:20:21 +00:00
Bart Van Assche
6aaeca1cd9 Merge iser branch r6234 into trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6235 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-10 15:35:26 +00:00
Vladislav Bolkhovitin
6572bedcb8 iscsid: Logically and negative conditions instead of or-ing these
Logically and negative allowed_portal conditions instead of or-ing these.

This was proposed by Sergej Roytman <spocks.goatee@gmail.com>.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6186 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-24 02:04:58 +00:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Bart Van Assche
d9c1ffa29a iscsi-scst/usr/Makefile: Fix include path
Use the SCST_INC_DIR variable passed by the parent Makefile such that
both the in-tree and out-of-tree builds work.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6130 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-24 14:10:54 +00:00
Vladislav Bolkhovitin
c833137130 iscsi-scst: Suppress a compiler warning
Avoid that the following compiler warning is reported when compiling
iscsi-scst:

chap.c: In function 'chap_rand':
chap.c:348:5: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
     (void)read(fd, &r, sizeof(r));
     ^

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5614 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:02:00 +00:00
Vladislav Bolkhovitin
6dab45204c scst: Leave out FSF mail address
This avoids that the following checkpatch complaint is triggered:

Do not include the paragraph about writing to the Free Software Foundation's
mailing address from the sample GPL notice. The FSF has changed addresses in
the past, and may do so again. Linux already includes a copy of the GPL.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:24:03 +00:00
Vladislav Bolkhovitin
00851a7501 Merge of adding iSER web page and copyright updates from the iSER branch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Vladislav Bolkhovitin
e329cc5abb Make SCST patters matching, for instance, to match initiator names to their group names, case insensitive
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4981 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-28 22:47:21 +00:00
Bart Van Assche
75f9be4b34 iscsi-scst: Spelling fix - change dublicate into duplicate
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4926 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-29 10:43:00 +00:00
Vladislav Bolkhovitin
40e8a76637 Add possibility to specify local compilation flags
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4841 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-04-23 03:21:39 +00:00
Vladislav Bolkhovitin
369863f015 Allow install SCST in any location
Currently the install location of SCST is pretty much hard coded into 
the Makefiles to be /usr/local.

I am custom building a system for ZFS & SCST and I want to install in 
/usr instead of /usr/local.

Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.

This patch fixes it.

From Sietse van Zanen <sietse@wizdom.nu>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-08 21:25:45 +00:00