Commit Graph

1112 Commits

Author SHA1 Message Date
Ronnie Sahlberg
0fbe47c1bd Merge pull request #85 from vn516726/master
Corrected the log
2014-01-23 19:56:23 -08:00
vn516726
262ac3b5c6 Corrected the log 2014-01-24 11:39:25 +08:00
Ronnie Sahlberg
354f00fd4f Discovery: Create a list of portals for each discovered target.
Some targets return multiple TargetAddress for individual targets.
Create a linked list of addresses for each target instead of
failing the discovery process when this happens.
2014-01-15 19:37:40 -08:00
Ronnie Sahlberg
25078d0d91 Old TESTS: Abort 0180 thin provisioning test early if the LUN does not have LBPME enabled 2014-01-06 18:36:48 -08:00
Ronnie Sahlberg
993be6c439 Free the correct inq task to avoid leaking memory during startup. 2014-01-06 18:26:03 -08:00
Ronnie Sahlberg
0a7d1407f0 Fix a segfault in the old T0184 WS10 test 2014-01-06 18:23:04 -08:00
Ronnie Sahlberg
448f470d4a Set SOCURRENT/REVISION/AGE manually from Makefile.am 2013-12-24 13:14:48 -08:00
Ronnie Sahlberg
b58b61cb37 Add some missing files to 'make dist' 2013-12-16 18:42:48 -08:00
Ronnie Sahlberg
52e1a8c14f Remove the generated manpages on make clean 2013-12-16 18:31:45 -08:00
Michael Tokarev
120b308741 Spelling fixes: Dont => Don't
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-12-16 18:19:24 -08:00
Ronnie Sahlberg
c606dd50f9 Merge pull request #84 from bonzini/master
fix CHAP authentication
2013-12-16 18:16:34 -08:00
Paolo Bonzini
34b93c4cfd fix CHAP authentication
Empty discovery and login packets are legal, and have the same behavior
as packets with a single NUL in them.  Introduced by commit 94d73fc
(Merge pull request #83 from bonzini/coverity, 2013-11-05).

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-12-12 17:06:06 +01:00
Ronnie Sahlberg
78e49f1427 Coding style update 2013-11-05 17:59:55 -08:00
Ronnie Sahlberg
e59c336450 Use <ptr> == NULL instead of !<ptr> 2013-11-05 17:53:10 -08:00
Ronnie Sahlberg
94d73fc937 Merge pull request #83 from bonzini/coverity
Fix issues reported by Coverity
Merged, thanks!
2013-11-05 06:51:06 -08:00
Paolo Bonzini
87ee645621 check for a target being there before processing TargetAddress
Otherwise we access a NULL pointer.  RFC3270 appendix D confirms
that TargetName must always come before TargetAddress.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 15:38:38 +01:00
Paolo Bonzini
bfde497565 rework login and discovery code to avoid strlen beyond end of data
Checking for the presence of the NUL character should be done
without accessing beyond the PDU datain.  Use memchr instead
of strlen, and compute the length only if a NUL character is
actually there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:32:34 +01:00
Paolo Bonzini
bb0e59055a handle bad iscsi->fd in iscsi_service
Just do nothing if the file descriptor is invalid.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:31:16 +01:00
Paolo Bonzini
fce94c81a3 do not test arrays against NULL
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Paolo Bonzini
dbaa0b4ea6 exit after malloc failure when allocating sense data blob
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Paolo Bonzini
1acce4a948 log failures (typically malloc) of iscsi_create_context during reconnect
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Paolo Bonzini
c3e8d0c945 reconnect: do not initialize iscsi to old_iscsi, use old_iscsi if appropriate
Makes it clearer that logging has to be done on the existing context,
since the "iscsi" pointer will not survive iscsi_reconnect.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Ronnie Sahlberg
f08e68e52a Merge pull request #77 from sitsofe/read6
TESTS: Fix READ6 test
2013-11-03 16:39:21 -08:00
Ronnie Sahlberg
43f0926566 Merge pull request #82 from plieven/master
introduce LIBISCSI_API_VERSION
2013-11-03 16:35:38 -08:00
Bart Van Assche
29f3d33944 test-tool/0184_writesame10_0blocks.c: Include WSNZ bit in test
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:40:33 -07:00
Bart Van Assche
08ed1c2aea Add two additional READ16-beyond-eol tests
This helps testing SCSI target implementations that represent the
byte offset from the start of the device as a signed or unsigned
64-bit integer.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:39:05 -07:00
Bart Van Assche
ba8a8d0a4e test tool: Fix a memory leak in test_reserve6_lun_reset.c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:37:55 -07:00
Bart Van Assche
b6b49e4a66 test tool: Fix memory leaks in test setup and teardown functions
Free read_write_buf and task after each test. Free iscsi2 after
each PGR test when using CUnit version 2. Note: CUnit version 1
doesn't support test setup and teardown functions.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:36:50 -07:00
Bart Van Assche
a1f32527d5 test tool: Fix a memory leak in test-tool/test_reserve6_logout.c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:35:22 -07:00
Bart Van Assche
d6ecafa6f5 test tool: Fix a memory leak in test_preventallow_logout.c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:35:01 -07:00
Bart Van Assche
9c7092e85c test tool: Fix a memory leak in testunitready_clear_ua()
Avoid leaking 'task' if task->status != SCSI_STATUS_GOOD.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:34:36 -07:00
Bart Van Assche
9f89f220f5 test tool, WRITESAME(16) UNMAP test: Avoid leaking 'buf' if a precondition fails
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:34:04 -07:00
Bart Van Assche
64e800a437 test tool, RESERVE(6) tests: Avoid leaking 'iscsi2'
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:33:35 -07:00
Bart Van Assche
3fdc3f2327 lib: Fix a memory leak in scsi_cdb_persistent_reserve_out()
If scsi_cdb_persistent_reserve_out() succeeds a call to
scsi_free_scsi_task() won't free any memory allocated with scsi_malloc()
in this function because the memset() call in this function overwrites
the task->mem pointer. Move the memset() call up such that it doesn't
clear task->mem. This makes it possible for the caller of this function
to free the memory allocated by this function by calling
scsi_free_scsi_task(). Merge the error handling code such that the code
for freeing memory only occurs once.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:33:07 -07:00
Bart Van Assche
afa076b537 lib: Make scsi_free_scsi_task() accept a NULL task pointer
Several cleanup paths can be simplified if it is allowed to pass a
NULL pointer to scsi_free_scsi_task(). Hence modify this function
such that it returns immediately if passed a NULL task pointer.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:32:21 -07:00
Peter Lieven
91380889d4 introduce LIBISCSI_API_VERSION
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-10-22 12:18:14 +02:00
Ronnie Sahlberg
f6a52d11c0 New version 1.10
- Add manpages for iscsi-ls/iscsi-inq and iscsi-swp
 - Many new tests and updates to the testsuite.
 - Fix memory leak in iscsi_reconnect
 - Fixes to the persistent reservation tests
 - AROS support
 - Fix/restore windows support
 - Switch to libgcrypt for the MD5 support.
 - Fix buffer overflow in the persistent reserver unmarshalling code.
 - And many more minor fixes.
2013-10-20 16:54:35 -07:00
Ronnie Sahlberg
ccacae482f Merge branch 'master' of github.com:sahlberg/libiscsi 2013-10-14 06:16:31 -07:00
Ronnie Sahlberg
1f4ebc7771 Merge pull request #81 from trasz/master
Fix segv.
2013-10-14 06:16:12 -07:00
Edward Tomasz Napierala
dd1ca33094 Freebsd build fixes. 2013-10-13 15:35:00 +02:00
Edward Tomasz Napierala
1daddebdb2 Merge remote-tracking branch 'upstream/master' 2013-10-13 15:28:52 +02:00
Edward Tomasz Napierala
5f46119899 Fix segv. 2013-10-12 23:51:16 +02:00
Ronnie Sahlberg
fe72f69dfd We dont need _snprintf_s since we have a compatibility function for windows 2013-10-05 21:05:42 -07:00
Ronnie Sahlberg
dfdf2091d4 typo 2013-10-05 17:25:06 -07:00
Ronnie Sahlberg
305d6e1644 Get rid of a lot of WIN32 ifdefs by providing a compatibility function instead 2013-10-05 17:23:46 -07:00
Ronnie Sahlberg
eec84c2805 Add PowerOnOccured as a sense code we allow and ignore during connect 2013-10-05 17:06:21 -07:00
Ronnie Sahlberg
bca9e3d022 We don't have __attribute__ on visual studio 2013-10-05 15:39:09 -07:00
Ronnie Sahlberg
d7b7c7727a Fix win32 so it works again 2013-10-05 15:34:56 -07:00
Ronnie Sahlberg
27b82512d5 Remove 'inline'. Some compilers do not support it. 2013-10-05 13:50:55 -07:00
Ronnie Sahlberg
1828481ba2 Portability fixes. Declare variables at the start of a scope only. 2013-10-05 13:48:00 -07:00