CHAP
Add unidirectional chap support so we can authenticate to the target. Make the login phase more "intelligent" so we can iterate over login pdus until we have reached full feature phase Add a new helper functions to parse a iscsi url and break it down into elements in a structure Update iscsi-inq to allow CHAP authentication
This commit is contained in:
@@ -202,6 +202,13 @@ int main(int argc, const char *argv[])
|
||||
iscsi_set_session_type(iscsi, ISCSI_SESSION_NORMAL);
|
||||
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
|
||||
|
||||
if (iscsi_url->user != NULL) {
|
||||
if (iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user, iscsi_url->passwd) != 0) {
|
||||
fprintf(stderr, "Failed to set initiator username and password\n");
|
||||
exit(10);
|
||||
}
|
||||
}
|
||||
|
||||
if (iscsi_full_connect_sync(iscsi, iscsi_url->portal, iscsi_url->lun) != 0) {
|
||||
fprintf(stderr, "Failed to log in to target %s\n", iscsi_get_error(iscsi));
|
||||
iscsi_destroy_url(iscsi_url);
|
||||
|
||||
Reference in New Issue
Block a user