From d450d2fe347fd982b177f919b92dac80f6d422f6 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Wed, 4 Nov 2020 22:15:53 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/iscsi-initiator-utils.git#ddde1bdb477bb20923cebd5296438f46b05698d1 --- .gitignore | 1 + ...-support-for-CHAP-algorithms-rebased.patch | 658 ------------------ 0001-service-file-tweaks.patch | 146 ---- 0001-unit-file-tweaks.patch | 78 ++- ...-idmb_rec_write-check-for-tpgt-first.patch | 10 +- ...te-seperate-old-and-new-style-writes.patch | 14 +- ...write-pick-tpgt-from-existing-record.patch | 12 +- 0005-update-initscripts-and-docs.patch | 49 +- 0006-use-var-for-config.patch | 18 +- 0007-use-red-hat-for-name.patch | 8 +- 0008-libiscsi.patch | 14 +- 0009-Add-macros-to-release-GIL-lock.patch | 4 +- 0010-libiscsi-introduce-sessions-API.patch | 6 +- ...discovery-request-timeout-regression.patch | 4 +- ...ibiscsi-format-security-build-errors.patch | 4 +- ...csi-fix-build-to-use-libopeniscsiusr.patch | 4 +- ...-build-against-latest-upstream-again.patch | 4 +- ...ove-the-offload-boot-supported-ifdef.patch | 12 +- ...csiadm-return-error-when-login-fails.patch | 4 +- 0017-dont-install-scripts.patch | 4 +- ...use-var-lib-iscsi-in-libopeniscsiusr.patch | 6 +- 0019-Coverity-scan-fixes.patch | 14 +- ...m-build-breakage-of-iscsiuio-LDFLAGS.patch | 6 +- ...service-files-for-boot-session-handl.patch | 130 ---- ...ion-string-to-match-RPM-package-vers.patch | 10 +- ...ce-zero-length-array-with-flexible-a.patch | 2 +- ...ch => 0023-stop-using-Werror-for-now.patch | 8 +- iscsi-initiator-utils.spec | 8 +- sources | 2 +- 29 files changed, 168 insertions(+), 1072 deletions(-) delete mode 100644 0001-configuration-support-for-CHAP-algorithms-rebased.patch delete mode 100644 0001-service-file-tweaks.patch delete mode 100644 0021-improve-systemd-service-files-for-boot-session-handl.patch rename 0001-stop-using-Werror-for-now.patch => 0023-stop-using-Werror-for-now.patch (90%) diff --git a/.gitignore b/.gitignore index 31fa575..24cbf25 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /open-iscsi-ac87641.tar.gz /open-iscsi-802688d.tar.gz /open-iscsi-13e7f58.tar.gz +/open-iscsi-a8fcb37.tar.gz diff --git a/0001-configuration-support-for-CHAP-algorithms-rebased.patch b/0001-configuration-support-for-CHAP-algorithms-rebased.patch deleted file mode 100644 index 329a063..0000000 --- a/0001-configuration-support-for-CHAP-algorithms-rebased.patch +++ /dev/null @@ -1,658 +0,0 @@ -From d3daa7a2bc3f5bca874d3efd072b34a657c4d492 Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Sun, 24 Nov 2019 13:51:09 -0800 -Subject: [PATCH] configuration support for CHAP algorithms - -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. ---- - etc/iscsid.conf | 7 ++ - libopeniscsiusr/default.c | 3 + - libopeniscsiusr/idbm.c | 95 +++++++++++++++++++++++++ - libopeniscsiusr/idbm.h | 9 +++ - libopeniscsiusr/idbm_fields.h | 1 + - usr/auth.c | 64 ++++++++++++----- - usr/auth.h | 3 + - usr/config.h | 1 + - usr/idbm.c | 126 ++++++++++++++++++++++++++++++---- - usr/idbm.h | 2 + - usr/idbm_fields.h | 1 + - usr/initiator.h | 1 + - usr/initiator_common.c | 2 + - usr/login.c | 11 +++ - 14 files changed, 294 insertions(+), 32 deletions(-) - -diff --git a/etc/iscsid.conf b/etc/iscsid.conf -index 70985afd..58f60404 100644 ---- a/etc/iscsid.conf -+++ b/etc/iscsid.conf -@@ -57,6 +57,13 @@ node.leading_login = No - # to CHAP. The default is None. - #node.session.auth.authmethod = CHAP - -+# To configure which CHAP algorithms to enable set -+# node.session.auth.chap_algs to a comma seperated list. -+# The algorithms should be listen with most prefered first. -+# Valid values are MD5, SHA1, SHA256, and SHA3-256. -+# The default is MD5. -+#node.session.auth.chap_algs = SHA3-256,SHA256,SHA1,MD5 -+ - # To set a CHAP username and password for initiator - # authentication by the target(s), uncomment the following lines: - #node.session.auth.username = username -diff --git a/libopeniscsiusr/default.c b/libopeniscsiusr/default.c -index d01d8928..d3b3da35 100644 ---- a/libopeniscsiusr/default.c -+++ b/libopeniscsiusr/default.c -@@ -78,6 +78,9 @@ void _default_node(struct iscsi_node *node) - node->session.initial_login_retry_max = DEF_INITIAL_LOGIN_RETRIES_MAX; - node->session.reopen_max = DEF_SESSION_REOPEN_MAX; - node->session.auth.authmethod = 0; -+ /* TYPE_INT_LIST fields should be initialized to ~0 to indicate unset values */ -+ memset(node->session.auth.chap_algs, ~0, sizeof(node->session.auth.chap_algs)); -+ node->session.auth.chap_algs[0] = ISCSI_AUTH_CHAP_ALG_MD5; - node->session.auth.password_length = 0; - node->session.auth.password_in_length = 0; - node->session.err_tmo.abort_timeout = DEF_ABORT_TIMEO; -diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c -index d020e6ce..05cb7f9f 100644 ---- a/libopeniscsiusr/idbm.c -+++ b/libopeniscsiusr/idbm.c -@@ -73,6 +73,7 @@ - #define TYPE_INT32 6 - #define TYPE_INT64 7 - #define TYPE_BOOL 8 -+#define TYPE_INT_LIST 9 - #define MAX_KEYS 256 /* number of keys total(including CNX_MAX) */ - #define NAME_MAXVAL 128 /* the maximum length of key name */ - #define VALUE_MAXVAL 256 /* the maximum length of 223 bytes in the RFC. */ -@@ -248,6 +249,39 @@ do { \ - _n++; \ - } while(0) - -+#define ARRAY_LEN(x) ( sizeof(x) / sizeof((x)[0]) ) -+ -+/* Options list type, rather than matching a single value this populates an -+ * array with a list of values in user specified order. -+ * Requires a table matching config strings to values. -+ **/ -+#define _rec_int_list(_key, _recs, _org, _name, _show, _tbl, _n, _mod) \ -+do {\ -+ _recs[_n].type = TYPE_INT_LIST; \ -+ _strncpy(_recs[_n].name, _key, NAME_MAXVAL); \ -+ for (unsigned int _i = 0; _i < ARRAY_LEN(_org->_name); _i++) { \ -+ if (_org->_name[_i] != ~0UL) { \ -+ for (unsigned int _j = 0; _j < ARRAY_LEN(_tbl); _j++) { \ -+ if (_tbl[_j].value == _org->_name[_i]) { \ -+ strcat(_recs[_n].value, _tbl[_j].name); \ -+ strcat(_recs[_n].value, ","); \ -+ break; \ -+ } \ -+ } \ -+ } \ -+ } \ -+ /* delete traling ',' */ \ -+ if (strrchr(_recs[_n].value, ',')) \ -+ *strrchr(_recs[_n].value, ',') = '\0'; \ -+ _recs[_n].data = &_org->_name; \ -+ _recs[_n].data_len = sizeof(_org->_name); \ -+ _recs[_n].visible = _show; \ -+ _recs[_n].opts[0] = (void *)&_tbl; \ -+ _recs[_n].numopts = ARRAY_LEN(_tbl); \ -+ _recs[_n].can_modify = _mod; \ -+ _n++; \ -+} while(0) -+ - enum modify_mode { - _CANNOT_MODIFY, - _CAN_MODIFY, -@@ -558,6 +592,11 @@ void _idbm_node_print(struct iscsi_node *node, FILE *f, bool show_secret) - _idbm_recs_free(recs); - } - -+struct int_list_tbl { -+ const char *name; -+ unsigned int value; -+}; -+ - static int _idbm_rec_update_param(struct iscsi_context *ctx, - struct idbm_rec *recs, char *name, - char *value, int line_number) -@@ -565,8 +604,14 @@ static int _idbm_rec_update_param(struct iscsi_context *ctx, - int rc = LIBISCSI_OK; - int i = 0; - int j = 0; -+ int k = 0; - int passwd_done = 0; - char passwd_len[8]; -+ struct int_list_tbl *tbl = NULL; -+ char *tmp_value; -+ int *tmp_data; -+ bool *found; -+ char *token; - - assert(ctx != NULL); - assert(recs != NULL); -@@ -643,6 +688,47 @@ static int _idbm_rec_update_param(struct iscsi_context *ctx, - else - goto unknown_value; - goto updated; -+ case TYPE_INT_LIST: -+ if (!recs[i].data) -+ continue; -+ tbl = (void *)recs[i].opts[0]; -+ /* strsep is destructive, make a copy to work with */ -+ tmp_value = strdup(value); -+ k = 0; -+ tmp_data = malloc(recs[i].data_len); -+ memset(tmp_data, ~0, recs[i].data_len); -+ found = calloc(recs[i].numopts, sizeof(bool)); -+next_token: while ((token = strsep(&tmp_value, ", \n"))) { -+ if (!strlen(token)) -+ continue; -+ if ((k * (int)sizeof(int)) >= (recs[i].data_len)) { -+ _warn(ctx, "Too many values set for '%s'" -+ ", continuing without processing them all", -+ recs[i].name); -+ break; -+ } -+ for (j = 0; j < recs[i].numopts; j++) { -+ if (!strcmp(token, tbl[j].name)) { -+ if ((found[j])) { -+ _warn(ctx, "Ignoring repeated value '%s'" -+ " for '%s'", token, recs[i].name); -+ goto next_token; -+ } -+ ((unsigned *)tmp_data)[k++] = tbl[j].value; -+ found[j] = true; -+ goto next_token; -+ } -+ } -+ _warn(ctx, "Ignoring unknown value '%s'" -+ " for '%s'", token, recs[i].name); -+ } -+ memcpy(recs[i].data, tmp_data, recs[i].data_len); -+ free(tmp_value); -+ free(tmp_data); -+ tmp_value = NULL; -+ tmp_data = NULL; -+ token = NULL; -+ goto updated; - default: - unknown_value: - _error(ctx, "Got unknown data type %d " -@@ -882,6 +968,13 @@ void _idbm_free(struct idbm *db) - free(db); - } - -+static struct int_list_tbl chap_algs[] = { -+ { "MD5", ISCSI_AUTH_CHAP_ALG_MD5 }, -+ { "SHA1", ISCSI_AUTH_CHAP_ALG_SHA1 }, -+ { "SHA256", ISCSI_AUTH_CHAP_ALG_SHA256 }, -+ { "SHA3-256", ISCSI_AUTH_CHAP_ALG_SHA3_256 }, -+}; -+ - static void _idbm_node_rec_link(struct iscsi_node *node, struct idbm_rec *recs) - { - int num = 0; -@@ -944,6 +1037,8 @@ static void _idbm_node_rec_link(struct iscsi_node *node, struct idbm_rec *recs) - _rec_uint32(SESSION_PASSWORD_IN_LEN, recs, node, - session.auth.password_in_length, IDBM_HIDE, num, - _CAN_MODIFY); -+ _rec_int_list(SESSION_CHAP_ALGS, recs, node, session.auth.chap_algs, -+ IDBM_SHOW, chap_algs, num, _CAN_MODIFY); - _rec_int64(SESSION_REPLACEMENT_TMO, recs, node, - session.tmo.replacement_timeout, IDBM_SHOW, num, - _CAN_MODIFY); -diff --git a/libopeniscsiusr/idbm.h b/libopeniscsiusr/idbm.h -index 3fd0864a..cc90388b 100644 ---- a/libopeniscsiusr/idbm.h -+++ b/libopeniscsiusr/idbm.h -@@ -48,6 +48,14 @@ enum iscsi_auth_method { - ISCSI_AUTH_METHOD_CHAP, - }; - -+enum iscsi_chap_algs { -+ ISCSI_AUTH_CHAP_ALG_MD5 = 5, -+ ISCSI_AUTH_CHAP_ALG_SHA1 = 6, -+ ISCSI_AUTH_CHAP_ALG_SHA256 = 7, -+ ISCSI_AUTH_CHAP_ALG_SHA3_256 = 8, -+ AUTH_CHAP_ALG_MAX_COUNT = 5, -+}; -+ - enum iscsi_startup_type { - ISCSI_STARTUP_MANUAL, - ISCSI_STARTUP_AUTOMATIC, -@@ -92,6 +100,7 @@ struct iscsi_auth_config { - char username_in[AUTH_STR_MAX_LEN]; - unsigned char password_in[AUTH_STR_MAX_LEN]; - uint32_t password_in_length; -+ unsigned int chap_algs[AUTH_CHAP_ALG_MAX_COUNT]; - }; - - /* all TCP options go in this structure. -diff --git a/libopeniscsiusr/idbm_fields.h b/libopeniscsiusr/idbm_fields.h -index 29a2090c..8bf17b02 100644 ---- a/libopeniscsiusr/idbm_fields.h -+++ b/libopeniscsiusr/idbm_fields.h -@@ -120,6 +120,7 @@ - #define SESSION_USERNAME_IN "node.session.auth.username_in" - #define SESSION_PASSWORD_IN "node.session.auth.password_in" - #define SESSION_PASSWORD_IN_LEN "node.session.auth.password_in_length" -+#define SESSION_CHAP_ALGS "node.session.auth.chap_algs" - #define SESSION_REPLACEMENT_TMO "node.session.timeo.replacement_timeout" - #define SESSION_ABORT_TMO "node.session.err_timeo.abort_timeout" - #define SESSION_LU_RESET_TMO "node.session.err_timeo.lu_reset_timeout" -diff --git a/usr/auth.c b/usr/auth.c -index 5c819c28..a222c531 100644 ---- a/usr/auth.c -+++ b/usr/auth.c -@@ -1806,7 +1806,7 @@ acl_chk_chap_alg_list(unsigned int option_count, const int *option_list) - return 0; - } - --static int -+int - acl_set_chap_alg_list(struct iscsi_acl *client, unsigned int option_count, - const int *option_list) - { -@@ -1819,22 +1819,54 @@ acl_set_chap_alg_list(struct iscsi_acl *client, unsigned int option_count, - } - - int --acl_init_chap_digests(int *value_list) { -+acl_init_chap_digests(int *value_list, unsigned *chap_algs, int conf_count) { - EVP_MD_CTX *context = EVP_MD_CTX_new(); - int i = 0; - -- if (EVP_DigestInit_ex(context, EVP_sha3_256(), NULL)) { -- value_list[i++] = AUTH_CHAP_ALG_SHA3_256; -- } -- if (EVP_DigestInit_ex(context, EVP_sha256(), NULL)) { -- value_list[i++] = AUTH_CHAP_ALG_SHA256; -- } -- if (EVP_DigestInit_ex(context, EVP_sha1(), NULL)) { -- value_list[i++] = AUTH_CHAP_ALG_SHA1; -- } -- if (EVP_DigestInit_ex(context, EVP_md5(), NULL)) { -- value_list[i++] = AUTH_CHAP_ALG_MD5; -+ for (int j = 0; j < conf_count; j++) { -+ switch (chap_algs[j]) { -+ case AUTH_CHAP_ALG_MD5: -+ if (EVP_DigestInit_ex(context, EVP_md5(), NULL)) { -+ value_list[i++] = AUTH_CHAP_ALG_MD5; -+ } else { -+ log_warning("Ignoring CHAP algorthm request for " -+ "MD5 due to crypto lib configuration"); -+ } -+ break; -+ case AUTH_CHAP_ALG_SHA1: -+ if (EVP_DigestInit_ex(context, EVP_sha1(), NULL)) { -+ value_list[i++] = AUTH_CHAP_ALG_SHA1; -+ } else { -+ log_warning("Ignoring CHAP algorthm request for " -+ "SHA1 due to crypto lib configuration"); -+ } -+ break; -+ case AUTH_CHAP_ALG_SHA256: -+ if (EVP_DigestInit_ex(context, EVP_sha256(), NULL)) { -+ value_list[i++] = AUTH_CHAP_ALG_SHA256; -+ } else { -+ log_warning("Ignoring CHAP algorthm request for " -+ "SHA256 due to crypto lib configuration"); -+ } -+ break; -+ case AUTH_CHAP_ALG_SHA3_256: -+ if (EVP_DigestInit_ex(context, EVP_sha3_256(), NULL)) { -+ value_list[i++] = AUTH_CHAP_ALG_SHA3_256; -+ } else { -+ log_warning("Ignoring CHAP algorthm request for " -+ "SHA3-256 due to crypto lib configuration"); -+ } -+ break; -+ case ~0: -+ /* unset value in array, just ignore */ -+ break; -+ default: -+ log_warning("Ignoring unknown CHAP algorithm request " -+ "'%d'", chap_algs[j]); -+ break; -+ } - } -+ - return i; - } - -@@ -1926,12 +1958,6 @@ acl_init(int node_type, int buf_desc_count, struct auth_buffer_desc *buff_desc) - return AUTH_STATUS_ERROR; - } - -- if (acl_set_chap_alg_list(client, acl_init_chap_digests(value_list), -- value_list) != AUTH_STATUS_NO_ERROR) { -- client->phase = AUTH_PHASE_ERROR; -- return AUTH_STATUS_ERROR; -- } -- - return AUTH_STATUS_NO_ERROR; - } - -diff --git a/usr/auth.h b/usr/auth.h -index f6dbbe4b..16cdb242 100644 ---- a/usr/auth.h -+++ b/usr/auth.h -@@ -271,6 +271,9 @@ extern int acl_send_transit_bit(struct iscsi_acl *client, int *value); - extern int acl_set_user_name(struct iscsi_acl *client, const char *username); - extern int acl_set_passwd(struct iscsi_acl *client, - const unsigned char *pw_data, unsigned int pw_len); -+extern int acl_set_chap_alg_list(struct iscsi_acl *client, unsigned int option_count, -+ const int *option_list); -+extern int acl_init_chap_digests(int *value_list, unsigned int *chap_algs, int count); - extern int acl_set_auth_rmt(struct iscsi_acl *client, int auth_rmt); - extern int acl_set_ip_sec(struct iscsi_acl *client, int ip_sec); - extern int acl_get_dbg_status(struct iscsi_acl *client, int *value); -diff --git a/usr/config.h b/usr/config.h -index 250879db..79059ec3 100644 ---- a/usr/config.h -+++ b/usr/config.h -@@ -58,6 +58,7 @@ struct iscsi_auth_config { - char username_in[AUTH_STR_MAX_LEN]; - unsigned char password_in[AUTH_STR_MAX_LEN]; - unsigned int password_in_length; -+ unsigned int chap_algs[AUTH_CHAP_ALG_MAX_COUNT]; - }; - - /* all per-connection timeouts go in this structure. -diff --git a/usr/idbm.c b/usr/idbm.c -index be4d4e36..e08301c6 100644 ---- a/usr/idbm.c -+++ b/usr/idbm.c -@@ -50,6 +50,8 @@ - - static struct idbm *db; - -+#define ARRAY_LEN(x) ( sizeof(x) / sizeof((x)[0]) ) -+ - #define __recinfo_str(_key, _info, _rec, _name, _show, _n, _mod) do { \ - _info[_n].type = TYPE_STR; \ - strlcpy(_info[_n].name, _key, NAME_MAXVAL); \ -@@ -164,6 +166,42 @@ static struct idbm *db; - _n++; \ - } while(0) - -+#define __recinfo_int_list(_key,_info,_rec,_name,_show,_tbl,_n,_mod) do { \ -+ _info[_n].type = TYPE_INT_LIST; \ -+ strlcpy(_info[_n].name, _key, NAME_MAXVAL); \ -+ for(int _i = 0; _i < ARRAY_LEN(_rec->_name); _i++) { \ -+ if (_rec->_name[_i] != ~0) { \ -+ for (int _j = 0; _j < ARRAY_LEN(_tbl); _j++) { \ -+ if (_tbl[_j].value == _rec->_name[_i]) { \ -+ strcat(_info[_n].value, _tbl[_j].name); \ -+ strcat(_info[_n].value, ","); \ -+ break; \ -+ } \ -+ } \ -+ } \ -+ } \ -+ /* delete trailing ',' */ \ -+ if (strrchr(_info[_n].value, ',')) \ -+ *strrchr(_info[_n].value, ',') = '\0'; \ -+ _info[_n].data = &_rec->_name; \ -+ _info[_n].data_len = sizeof(_rec->_name); \ -+ _info[_n].visible = _show; \ -+ _info[_n].opts[0] = (void *)&_tbl; \ -+ _info[_n].numopts = ARRAY_LEN(_tbl); \ -+ _info[_n].can_modify = _mod; \ -+ _n++; \ -+} while (0) -+ -+static struct int_list_tbl { -+ const char *name; -+ int value; -+} chap_algs [] = { -+ { "MD5", AUTH_CHAP_ALG_MD5 }, -+ { "SHA1", AUTH_CHAP_ALG_SHA1 }, -+ { "SHA256", AUTH_CHAP_ALG_SHA256 }, -+ { "SHA3-256", AUTH_CHAP_ALG_SHA3_256 }, -+}; -+ - static int idbm_remove_disc_to_node_link(node_rec_t *rec, char *portal); - - static void -@@ -196,6 +234,10 @@ idbm_recinfo_discovery(discovery_rec_t *r, recinfo_t *ri) - __recinfo_int(DISC_ST_PASSWORD_IN_LEN, ri, r, - u.sendtargets.auth.password_in_length, IDBM_HIDE, - num, 1); -+ /* reusing SESSION_CHAP_ALGS */ -+ __recinfo_int_list(SESSION_CHAP_ALGS, ri, r, -+ u.sendtargets.auth.chap_algs, -+ IDBM_SHOW, chap_algs, num, 1); - __recinfo_int(DISC_ST_LOGIN_TMO, ri, r, - u.sendtargets.conn_timeo.login_timeout, - IDBM_SHOW, num, 1); -@@ -428,6 +470,8 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri) - session.auth.password_in, IDBM_MASKED, num, 1); - __recinfo_int(SESSION_PASSWORD_IN_LEN, ri, r, - session.auth.password_in_length, IDBM_HIDE, num, 1); -+ __recinfo_int_list(SESSION_CHAP_ALGS, ri, r, -+ session.auth.chap_algs, IDBM_SHOW, chap_algs, num, 1); - __recinfo_int(SESSION_REPLACEMENT_TMO, ri, r, - session.timeo.replacement_timeout, - IDBM_SHOW, num, 1); -@@ -933,6 +977,9 @@ idbm_discovery_setup_defaults(discovery_rec_t *rec, discovery_type_e type) - rec->u.sendtargets.auth.authmethod = 0; - rec->u.sendtargets.auth.password_length = 0; - rec->u.sendtargets.auth.password_in_length = 0; -+ /* TYPE_INT_LIST fields should be initialized to ~0 to indicate unset values */ -+ memset(rec->u.sendtargets.auth.chap_algs, ~0, sizeof(rec->u.sendtargets.auth.chap_algs)); -+ rec->u.sendtargets.auth.chap_algs[0] = AUTH_CHAP_ALG_MD5; - rec->u.sendtargets.conn_timeo.login_timeout=15; - rec->u.sendtargets.conn_timeo.auth_timeout = 45; - rec->u.sendtargets.conn_timeo.active_timeout=30; -@@ -966,59 +1013,109 @@ int idbm_rec_update_param(recinfo_t *info, char *name, char *value, - int i; - int passwd_done = 0; - char passwd_len[8]; -+ char *tmp_value, *token; -+ bool *found; -+ int *tmp_data; - - setup_passwd_len: - for (i=0; i '%s'", name, - info[i].value, value); - /* parse recinfo by type */ -- if (info[i].type == TYPE_INT) { -+ switch (info[i].type) { -+ case TYPE_INT: - if (!info[i].data) - continue; - - *(int*)info[i].data = - strtoul(value, NULL, 10); - goto updated; -- } else if (info[i].type == TYPE_UINT8) { -+ case TYPE_UINT8: - if (!info[i].data) - continue; - - *(uint8_t *)info[i].data = - strtoul(value, NULL, 10); - goto updated; -- } else if (info[i].type == TYPE_UINT16) { -+ case TYPE_UINT16: - if (!info[i].data) - continue; - - *(uint16_t *)info[i].data = - strtoul(value, NULL, 10); - goto updated; -- } else if (info[i].type == TYPE_UINT32) { -+ case TYPE_UINT32: - if (!info[i].data) - continue; - - *(uint32_t *)info[i].data = - strtoul(value, NULL, 10); - goto updated; -- } else if (info[i].type == TYPE_STR) { -+ case TYPE_STR: - if (!info[i].data) - continue; - - strlcpy((char*)info[i].data, - value, info[i].data_len); - goto updated; -- } -- for (j=0; j= (info[i].data_len)) { -+ log_warning("Too many values set for '%s'" -+ ", continuing without processing them all", -+ info[i].name); -+ break; -+ } -+ for (j = 0; j < info[i].numopts; j++) { -+ if (!strcmp(token, tbl[j].name)) { -+ if ((found[j])) { -+ log_warning("Ignoring repeated " -+ "value '%s' " -+ "for '%s'", token, -+ info[i].name); -+ goto next_token; -+ } -+ ((int*)tmp_data)[k++] = tbl[j].value; -+ found[j] = true; -+ goto next_token; -+ } -+ } -+ log_warning("Ignoring unknown value '%s'" -+ " for '%s'", token, info[i].name); - } -+ memcpy(info[i].data, tmp_data, info[i].data_len); -+ free(tmp_value); -+ free(tmp_data); -+ tmp_value = NULL; -+ tmp_data = NULL; -+ token = NULL; -+ goto updated; - } - if (line_number) { - log_warning("config file line %d contains " -@@ -3021,6 +3118,9 @@ void idbm_node_setup_defaults(node_rec_t *rec) - rec->session.initial_login_retry_max = DEF_INITIAL_LOGIN_RETRIES_MAX; - rec->session.reopen_max = DEF_SESSION_REOPEN_MAX; - rec->session.auth.authmethod = 0; -+ /* TYPE_INT_LIST fields should be initialized to ~0 to indicate unset values */ -+ memset(rec->session.auth.chap_algs, ~0, sizeof(rec->session.auth.chap_algs)); -+ rec->session.auth.chap_algs[0] = AUTH_CHAP_ALG_MD5; - rec->session.auth.password_length = 0; - rec->session.auth.password_in_length = 0; - rec->session.err_timeo.abort_timeout = DEF_ABORT_TIMEO; -diff --git a/usr/idbm.h b/usr/idbm.h -index 18c50255..46cd82ac 100644 ---- a/usr/idbm.h -+++ b/usr/idbm.h -@@ -45,6 +45,8 @@ - #define TYPE_UINT8 3 - #define TYPE_UINT16 4 - #define TYPE_UINT32 5 -+#define TYPE_INT_LIST 6 -+ - #define MAX_KEYS 256 /* number of keys total(including CNX_MAX) */ - #define NAME_MAXVAL 128 /* the maximum length of key name */ - #define VALUE_MAXVAL 256 /* the maximum length of 223 bytes in the RFC. */ -diff --git a/usr/idbm_fields.h b/usr/idbm_fields.h -index 142c7ae6..4a967fc0 100644 ---- a/usr/idbm_fields.h -+++ b/usr/idbm_fields.h -@@ -30,6 +30,7 @@ - #define SESSION_USERNAME_IN "node.session.auth.username_in" - #define SESSION_PASSWORD_IN "node.session.auth.password_in" - #define SESSION_PASSWORD_IN_LEN "node.session.auth.password_in_length" -+#define SESSION_CHAP_ALGS "node.session.auth.chap_algs" - #define SESSION_REPLACEMENT_TMO "node.session.timeo.replacement_timeout" - #define SESSION_ABORT_TMO "node.session.err_timeo.abort_timeout" - #define SESSION_LU_RESET_TMO "node.session.err_timeo.lu_reset_timeout" -diff --git a/usr/initiator.h b/usr/initiator.h -index eccafb90..6a49ea6e 100644 ---- a/usr/initiator.h -+++ b/usr/initiator.h -@@ -243,6 +243,7 @@ typedef struct iscsi_session { - char username_in[AUTH_STR_MAX_LEN]; - uint8_t password_in[AUTH_STR_MAX_LEN]; - int password_in_length; -+ unsigned int chap_algs[AUTH_CHAP_ALG_MAX_COUNT]; - iscsi_conn_t conn[ISCSI_CONN_MAX]; - uint64_t param_mask; - -diff --git a/usr/initiator_common.c b/usr/initiator_common.c -index 790f13de..81da8fdb 100644 ---- a/usr/initiator_common.c -+++ b/usr/initiator_common.c -@@ -94,6 +94,8 @@ int iscsi_setup_authentication(struct iscsi_session *session, - memcpy(session->password_in, auth_cfg->password_in, - session->password_in_length); - -+ memcpy(session->chap_algs, auth_cfg->chap_algs, sizeof(auth_cfg->chap_algs)); -+ - if (session->password_length || session->password_in_length) { - /* setup the auth buffers */ - session->auth_buffers[0].address = &session->auth_client_block; -diff --git a/usr/login.c b/usr/login.c -index d7dad211..1251e61c 100644 ---- a/usr/login.c -+++ b/usr/login.c -@@ -1262,6 +1262,17 @@ check_for_authentication(iscsi_session_t *session, - goto end; - } - -+ int value_list[AUTH_CHAP_ALG_MAX_COUNT]; -+ -+ if (acl_set_chap_alg_list(auth_client, -+ acl_init_chap_digests(value_list, -+ session->chap_algs, -+ AUTH_CHAP_ALG_MAX_COUNT), -+ value_list) != AUTH_STATUS_NO_ERROR) { -+ log_error("Couldn't set CHAP algorithm list"); -+ goto end; -+ } -+ - if (acl_set_ip_sec(auth_client, 1) != AUTH_STATUS_NO_ERROR) { - log_error("Couldn't set IPSec"); - goto end; diff --git a/0001-service-file-tweaks.patch b/0001-service-file-tweaks.patch deleted file mode 100644 index c83faf3..0000000 --- a/0001-service-file-tweaks.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 2d84ee02e9ac69928261b38b5876bebb2349bd65 Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 4 Jun 2019 13:23:32 -0700 -Subject: [PATCH] service file tweaks - ---- - etc/systemd/iscsi-mark-root-nodes | 30 ++++++++++++++++++++++++++++++ - etc/systemd/iscsi-shutdown.service | 14 ++++++++++++++ - etc/systemd/iscsi.service | 23 +++++++++++++---------- - etc/systemd/iscsid.service | 6 ++++-- - etc/systemd/iscsiuio.service | 2 +- - 5 files changed, 62 insertions(+), 13 deletions(-) - create mode 100755 etc/systemd/iscsi-mark-root-nodes - create mode 100644 etc/systemd/iscsi-shutdown.service - -diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes -new file mode 100755 -index 0000000..c693707 ---- /dev/null -+++ b/etc/systemd/iscsi-mark-root-nodes -@@ -0,0 +1,30 @@ -+#!/bin/bash -+ -+ISCSIADM=/usr/sbin/iscsiadm -+start_iscsid=0 -+start_iscsiuio=0 -+ -+while read t num p target flash; do -+ # strip tag number from portal, keep "ip:port" -+ portal=${p%,*} -+ transport=${t%:} -+ -+ $ISCSIADM -m node -p $portal -T $target -o update -n node.startup -v onboot -+ -+ start_iscsid=1 -+ -+ if [ "$transport" = bnx2i ] || [ "$transport" = qedi ]; then -+ start_iscsiuio=1 -+ fi -+done < <( $ISCSIADM -m session ) -+ -+# force iscsid and iscsiuio to start if needed for -+# recovering sessions created in the initrd -+ -+if [ "$start_iscsid" -eq 1 ]; then -+ systemctl --no-block start iscsid.service -+fi -+if [ "$start_iscsiuio" -eq 1 ]; then -+ systemctl --no-block start iscsiuio.service -+fi -+ -diff --git a/etc/systemd/iscsi-shutdown.service b/etc/systemd/iscsi-shutdown.service -new file mode 100644 -index 0000000..69c1c77 ---- /dev/null -+++ b/etc/systemd/iscsi-shutdown.service -@@ -0,0 +1,14 @@ -+[Unit] -+Description=Logout off all iSCSI sessions on shutdown -+Documentation=man:iscsid(8) man:iscsiadm(8) -+DefaultDependencies=no -+Conflicts=shutdown.target -+After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service -+Before=remote-fs-pre.target -+Wants=remote-fs-pre.target -+RefuseManualStop=yes -+ -+[Service] -+Type=oneshot -+RemainAfterExit=true -+ExecStop=-/usr/sbin/iscsiadm -m node --logoutall=all -diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service -index e475888..eadfcec 100644 ---- a/etc/systemd/iscsi.service -+++ b/etc/systemd/iscsi.service -@@ -1,18 +1,21 @@ - [Unit] - Description=Login and scanning of iSCSI devices --Documentation=man:iscsiadm(8) man:iscsid(8) --Before=remote-fs.target --After=network.target network-online.target iscsid.service --Requires=iscsid.service --ConditionPathExists=/etc/iscsi/initiatorname.iscsi -+Documentation=man:iscsid(8) man:iscsiadm(8) -+DefaultDependencies=no -+Conflicts=shutdown.target -+After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service -+Before=remote-fs-pre.target -+Wants=remote-fs-pre.target iscsi-shutdown.service -+ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes -+ConditionDirectoryNotEmpty=|/sys/class/iscsi_session - - [Service] - Type=oneshot --ExecStart=/sbin/iscsiadm -m node --loginall=automatic --ExecStop=/sbin/iscsiadm -m node --logoutall=automatic --ExecStop=/sbin/iscsiadm -m node --logoutall=manual --SuccessExitStatus=21 - RemainAfterExit=true -+ExecStart=-/usr/libexec/iscsi-mark-root-nodes -+ExecStart=-/usr/sbin/iscsiadm -m node --loginall=automatic -+ExecReload=-/usr/sbin/iscsiadm -m node --loginall=automatic -+SuccessExitStatus=21 - - [Install] --WantedBy=remote-fs.target -+WantedBy=sysinit.target -diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service -index 4fef168..8d50cf0 100644 ---- a/etc/systemd/iscsid.service -+++ b/etc/systemd/iscsid.service -@@ -1,14 +1,16 @@ - [Unit] - Description=Open-iSCSI --Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) -+Documentation=man:iscsid(8) man:iscsiadm(8) - DefaultDependencies=no -+Conflicts=shutdown.target - After=network.target iscsiuio.service - Before=remote-fs-pre.target - - [Service] - Type=notify - NotifyAccess=main --ExecStart=/sbin/iscsid -f -+ExecStart=/usr/sbin/iscsid -f -+ExecStop=/usr/sbin/iscsiadm -k 0 2 - KillMode=mixed - Restart=on-failure - -diff --git a/etc/systemd/iscsiuio.service b/etc/systemd/iscsiuio.service -index e4d9fd0..8620cde 100644 ---- a/etc/systemd/iscsiuio.service -+++ b/etc/systemd/iscsiuio.service -@@ -11,7 +11,7 @@ Before=remote-fs-pre.target iscsid.service - [Service] - Type=notify - NotifyAccess=main --ExecStart=/sbin/iscsiuio -f -+ExecStart=/usr/sbin/iscsiuio -f - KillMode=mixed - Restart=on-failure - --- -2.21.0 - diff --git a/0001-unit-file-tweaks.patch b/0001-unit-file-tweaks.patch index 828f17d..89378ea 100644 --- a/0001-unit-file-tweaks.patch +++ b/0001-unit-file-tweaks.patch @@ -1,26 +1,26 @@ -From 52806cfdca12164f0757dcecd05c25c6aa4dda43 Mon Sep 17 00:00:00 2001 +From 0a6af5e7283ed2733753998043adac090ef12dd0 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Tue, 4 Jun 2019 13:23:32 -0700 Subject: [PATCH] unit file tweaks --- - etc/systemd/iscsi-mark-root-nodes | 29 +++++++++++++++++++++++++++++ - etc/systemd/iscsi-onboot.service | 15 +++++++++++++++ - etc/systemd/iscsi-shutdown.service | 14 ++++++++++++++ - etc/systemd/iscsi.service | 10 +++++++--- - etc/systemd/iscsid.service | 4 ++-- - etc/systemd/iscsiuio.service | 2 +- - 6 files changed, 68 insertions(+), 6 deletions(-) + etc/systemd/iscsi-mark-root-nodes | 34 ++++++++++++++++++++++++++++++ + etc/systemd/iscsi-onboot.service | 15 +++++++++++++ + etc/systemd/iscsi-shutdown.service | 15 +++++++++++++ + etc/systemd/iscsi.service | 16 +++++++------- + etc/systemd/iscsid.service | 3 +-- + etc/systemd/iscsiuio.service | 4 +--- + 6 files changed, 74 insertions(+), 13 deletions(-) create mode 100755 etc/systemd/iscsi-mark-root-nodes create mode 100644 etc/systemd/iscsi-onboot.service create mode 100644 etc/systemd/iscsi-shutdown.service diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes new file mode 100755 -index 0000000..e5a09c6 +index 0000000..9d48805 --- /dev/null +++ b/etc/systemd/iscsi-mark-root-nodes -@@ -0,0 +1,29 @@ +@@ -0,0 +1,34 @@ +#!/bin/bash + +ISCSIADM=/usr/sbin/iscsiadm @@ -50,6 +50,11 @@ index 0000000..e5a09c6 + +if [ "$start_iscsid" -eq 1 ]; then + systemctl --no-block start iscsid.service ++fi ++if [ "$start_iscsiuio" -eq 1 ]; then ++ systemctl --no-block start iscsiuio.service ++fi ++ diff --git a/etc/systemd/iscsi-onboot.service b/etc/systemd/iscsi-onboot.service new file mode 100644 index 0000000..42ced68 @@ -73,10 +78,10 @@ index 0000000..42ced68 +WantedBy=sysinit.target diff --git a/etc/systemd/iscsi-shutdown.service b/etc/systemd/iscsi-shutdown.service new file mode 100644 -index 0000000..6848a72 +index 0000000..caee933 --- /dev/null +++ b/etc/systemd/iscsi-shutdown.service -@@ -0,0 +1,14 @@ +@@ -0,0 +1,15 @@ +[Unit] +Description=Logout off all iSCSI sessions on shutdown +Documentation=man:iscsid(8) man:iscsiadm(8) @@ -91,21 +96,22 @@ index 0000000..6848a72 +Type=oneshot +RemainAfterExit=true +ExecStart=-/usr/bin/true ++ExecStop=-/usr/sbin/iscsiadm -m node --logoutall=all diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service -index 2f2bf81..51810c9 100644 +index 2f2bf81..175cb2c 100644 --- a/etc/systemd/iscsi.service +++ b/etc/systemd/iscsi.service -@@ -1,16 +1,20 @@ +@@ -1,18 +1,18 @@ [Unit] Description=Login and scanning of iSCSI devices Documentation=man:iscsiadm(8) man:iscsid(8) +-Before=remote-fs.target +-After=network.target network-online.target +-After=iscsid.service iscsi-init.service +-Requires=iscsid.socket iscsi-init.service +DefaultDependencies=no -+Conflicts=shutdown.target - Before=remote-fs.target -+After=systemd-remount-fs.service iscsiuio.service - After=network.target network-online.target - After=iscsid.service iscsi-init.service - Requires=iscsid.socket iscsi-init.service ++Before=remote-fs-pre.target ++After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service +Wants=remote-fs-pre.target iscsi-shutdown.service +ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes @@ -114,24 +120,24 @@ index 2f2bf81..51810c9 100644 -ExecStart=/sbin/iscsiadm -m node --loginall=automatic -ExecStop=/sbin/iscsiadm -m node --logoutall=automatic -ExecStop=/sbin/iscsiadm -m node --logoutall=manual +-SuccessExitStatus=21 15 + RemainAfterExit=true +ExecStart=-/usr/sbin/iscsiadm -m node --loginall=automatic +ExecReload=-/usr/sbin/iscsiadm -m node --loginall=automatic - SuccessExitStatus=21 15 - RemainAfterExit=true ++SuccessExitStatus=21 + [Install] + WantedBy=remote-fs.target diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service -index 648ceea..79e63cd 100644 +index 648ceea..28402fb 100644 --- a/etc/systemd/iscsid.service +++ b/etc/systemd/iscsid.service -@@ -1,6 +1,6 @@ - [Unit] - Description=Open-iSCSI --Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) -+Documentation=man:iscsid(8) man:iscsiuio(8) +@@ -4,12 +4,11 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) DefaultDependencies=no After=network.target iscsiuio.service Before=remote-fs-pre.target -@@ -9,7 +9,7 @@ Wants=remote-fs-pre.target +-Wants=remote-fs-pre.target + [Service] Type=notify NotifyAccess=main @@ -141,10 +147,20 @@ index 648ceea..79e63cd 100644 Restart=on-failure diff --git a/etc/systemd/iscsiuio.service b/etc/systemd/iscsiuio.service -index 923e019..f92b0e7 100644 +index 923e019..fc0be93 100644 --- a/etc/systemd/iscsiuio.service +++ b/etc/systemd/iscsiuio.service -@@ -12,7 +12,7 @@ Wants=remote-fs-pre.target +@@ -2,17 +2,15 @@ + Description=iSCSI UserSpace I/O driver + Documentation=man:iscsiuio(8) + DefaultDependencies=no +-Conflicts=shutdown.target + Requires=iscsid.service + BindTo=iscsid.service + After=network.target + Before=remote-fs-pre.target iscsid.service +-Wants=remote-fs-pre.target + [Service] Type=notify NotifyAccess=main diff --git a/0002-idmb_rec_write-check-for-tpgt-first.patch b/0002-idmb_rec_write-check-for-tpgt-first.patch index 5b9d247..ba9da6d 100644 --- a/0002-idmb_rec_write-check-for-tpgt-first.patch +++ b/0002-idmb_rec_write-check-for-tpgt-first.patch @@ -1,4 +1,4 @@ -From 97071360caa6868c21a161047ed471790c405efb Mon Sep 17 00:00:00 2001 +From 45878c9461298c9da68a626d990dc4ef99e01baa Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Tue, 13 Aug 2013 10:59:44 -0700 Subject: [PATCH] idmb_rec_write, check for tpgt first @@ -11,10 +11,10 @@ for splitting it up. 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/usr/idbm.c b/usr/idbm.c -index be4d4e3..a7da540 100644 +index 42c2699..e6ede85 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -2078,6 +2078,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) +@@ -2178,6 +2178,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) goto free_portal; } @@ -25,7 +25,7 @@ index be4d4e3..a7da540 100644 rc = stat(portal, &statb); if (rc) { rc = 0; -@@ -2086,22 +2090,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) +@@ -2186,22 +2190,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) * set the tgpt. In new versions you must pass all the info in * from the start */ @@ -50,5 +50,5 @@ index be4d4e3..a7da540 100644 * Old style portal as a file, but with tpgt. Let's update it. */ -- -2.21.0 +2.26.2 diff --git a/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch b/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch index 25cddd3..e311733 100644 --- a/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch +++ b/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch @@ -1,4 +1,4 @@ -From 4c6e7c0fcc6da66cf81c0714bf907762194eedf2 Mon Sep 17 00:00:00 2001 +From cfd9fc81e11c462b682ead4e05721772b20f7546 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Tue, 13 Aug 2013 11:34:31 -0700 Subject: [PATCH] idbm_rec_write, seperate old and new style writes @@ -9,10 +9,10 @@ Duplicates a small bit of code, but easier to understand and extened. 1 file changed, 86 insertions(+), 43 deletions(-) diff --git a/usr/idbm.c b/usr/idbm.c -index a7da540..2f5e309 100644 +index e6ede85..bc51388 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -2030,12 +2030,7 @@ mkdir_portal: +@@ -2130,12 +2130,7 @@ mkdir_portal: return f; } @@ -26,7 +26,7 @@ index a7da540..2f5e309 100644 { struct stat statb; FILE *f; -@@ -2048,39 +2043,8 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) +@@ -2148,39 +2143,8 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) return ISCSI_ERR_NOMEM; } @@ -66,7 +66,7 @@ index a7da540..2f5e309 100644 rc = stat(portal, &statb); if (rc) { -@@ -2101,11 +2065,11 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) +@@ -2201,11 +2165,11 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) log_error("Could not convert %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; @@ -80,7 +80,7 @@ index a7da540..2f5e309 100644 } mkdir_portal: -@@ -2116,24 +2080,103 @@ mkdir_portal: +@@ -2216,24 +2180,103 @@ mkdir_portal: log_error("Could not make dir %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; @@ -189,5 +189,5 @@ index a7da540..2f5e309 100644 idbm_unlock(); free_portal: -- -2.21.0 +2.26.2 diff --git a/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch b/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch index 41436fb..4a31b2a 100644 --- a/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch +++ b/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch @@ -1,7 +1,7 @@ -From 351ee477f713730d1c53cf26b6fb87706d268a5f Mon Sep 17 00:00:00 2001 +From 2b1c0c5f1f2dbc516a9b51950a82eac091dbce2c Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Tue, 13 Aug 2013 12:39:07 -0700 -Subject: [PATCH 1/1] idbw_rec_write, pick tpgt from existing record +Subject: [PATCH] idbw_rec_write, pick tpgt from existing record On a static add (-m node -o new) without a user specified tpgt, looks for existing new style records with tpgt before creating an old style @@ -12,7 +12,7 @@ updated new style record instead. 1 file changed, 40 insertions(+) diff --git a/usr/idbm.c b/usr/idbm.c -index b6193e7..2208c4a 100644 +index bc51388..f1e5c88 100644 --- a/usr/idbm.c +++ b/usr/idbm.c @@ -28,6 +28,7 @@ @@ -23,7 +23,7 @@ index b6193e7..2208c4a 100644 #include #include #include -@@ -202,6 +203,8 @@ static struct int_list_tbl { +@@ -203,6 +204,8 @@ static struct int_list_tbl { { "SHA3-256", AUTH_CHAP_ALG_SHA3_256 }, }; @@ -32,7 +32,7 @@ index b6193e7..2208c4a 100644 static void idbm_recinfo_discovery(discovery_rec_t *r, recinfo_t *ri) { -@@ -2206,12 +2209,49 @@ static int idbm_rec_write_old(node_rec_t *rec) +@@ -2207,12 +2210,49 @@ static int idbm_rec_write_old(node_rec_t *rec) FILE *f; char *portal; int rc = 0; @@ -83,5 +83,5 @@ index b6193e7..2208c4a 100644 rec->name, rec->conn[0].address, rec->conn[0].port); -- -2.21.1 +2.26.2 diff --git a/0005-update-initscripts-and-docs.patch b/0005-update-initscripts-and-docs.patch index e749a89..7d487a5 100644 --- a/0005-update-initscripts-and-docs.patch +++ b/0005-update-initscripts-and-docs.patch @@ -1,16 +1,16 @@ -From 6602f08bfcc2b2e75d1a58671cb160c96cf2d99b Mon Sep 17 00:00:00 2001 +From 97b1242450df25648d203acf7cc297cd46d10e8c Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 19 Nov 2012 16:37:13 -0800 Subject: [PATCH] update initscripts and docs --- - README | 10 ++++------ - etc/iscsid.conf | 21 ++++++++++----------- + README | 12 +++++------- + etc/iscsid.conf | 23 +++++++++++------------ usr/idbm.c | 4 ++++ - 3 files changed, 18 insertions(+), 17 deletions(-) + 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/README b/README -index 2499d9a..c05814a 100644 +index 508c9d7..b62a14e 100644 --- a/README +++ b/README @@ -77,11 +77,6 @@ the cache sync command will fail. @@ -25,16 +25,21 @@ index 2499d9a..c05814a 100644 The userspace components iscsid, iscsiadm and iscsistart require the open-isns library, which can be found here: https://github.com/gonzoleeman/open-isns/releases -@@ -1151,7 +1146,7 @@ Red Hat or Fedora: +@@ -1163,11 +1158,11 @@ Red Hat or Fedora: ----------------- To start open-iscsi in Red Hat/Fedora you can do: -- service open-iscsi start -+ service iscsi start +- systemctl start open-iscsi ++ systemctl start iscsi To get open-iscsi to automatically start at run time you may have to run: -@@ -1353,6 +1348,9 @@ iscsid will only perform rediscovery when it gets a SCN from the server. +- systemctl enable open-iscsi ++ systemctl enable iscsi + + And, to automatically mount a file system during startup + you must have the partition entry in /etc/fstab marked with the "_netdev" +@@ -1370,6 +1365,9 @@ iscsid will only perform rediscovery when it gets a SCN from the server. # linux-isns (SLES's iSNS server) where it sometimes does not send SCN # events in the proper format, so they may not get handled. @@ -45,18 +50,20 @@ index 2499d9a..c05814a 100644 -------- diff --git a/etc/iscsid.conf b/etc/iscsid.conf -index f21ed3d..56c56a9 100644 +index f21ed3d..420145b 100644 --- a/etc/iscsid.conf +++ b/etc/iscsid.conf -@@ -19,7 +19,7 @@ +@@ -19,8 +19,8 @@ # the time then leave this attribute commented out. # # Default for Fedora and RHEL. (uncomment to activate). -# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket +-# +iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket - # ++# # Default if you are not using systemd (uncomment to activate) # iscsid.startup = /usr/bin/service start iscsid + @@ -41,8 +41,8 @@ # To request that the iscsi initd scripts startup a session set to "automatic". # node.startup = automatic @@ -68,7 +75,7 @@ index f21ed3d..56c56a9 100644 # For "automatic" startup nodes, setting this to "Yes" will try logins on each # available iface until one succeeds, and then stop. The default "No" will try -@@ -271,25 +271,22 @@ node.conn[0].iscsi.MaxXmitDataSegmentLength = 0 +@@ -271,28 +271,27 @@ node.conn[0].iscsi.MaxXmitDataSegmentLength = 0 discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768 # To allow the targets to control the setting of the digest checking, @@ -77,6 +84,7 @@ index f21ed3d..56c56a9 100644 +# the following lines (Data digests are not supported.): #node.conn[0].iscsi.HeaderDigest = CRC32C,None -#node.conn[0].iscsi.DataDigest = CRC32C,None ++ # # To allow the targets to control the setting of the digest checking, # with the initiator requesting a preference of disabling the checking, @@ -93,18 +101,21 @@ index f21ed3d..56c56a9 100644 # # To disable digest checking for the header and/or data part of -# iSCSI PDUs, uncomment one or both of the following lines: --#node.conn[0].iscsi.HeaderDigest = None --#node.conn[0].iscsi.DataDigest = None +# iSCSI PDUs, uncomment the following line: -+node.conn[0].iscsi.HeaderDigest = None + #node.conn[0].iscsi.HeaderDigest = None +-#node.conn[0].iscsi.DataDigest = None # # The default is to never use DataDigests or HeaderDigests. # ++node.conn[0].iscsi.HeaderDigest = None + + # For multipath configurations, you may want more than one session to be + # created on each iface record. If node.session.nr_sessions is greater diff --git a/usr/idbm.c b/usr/idbm.c -index a2332cc..aed08f2 100644 +index f1e5c88..0f0f17a 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -521,9 +521,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri) +@@ -566,9 +566,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri) IDBM_SHOW, "None", "CRC32C", "CRC32C,None", "None,CRC32C", num, 1); sprintf(key, CONN_DATA_DIGEST, i); @@ -119,5 +130,5 @@ index a2332cc..aed08f2 100644 __recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW, "No", "Yes", num, 1); -- -2.21.0 +2.26.2 diff --git a/0006-use-var-for-config.patch b/0006-use-var-for-config.patch index db63b54..1836b16 100644 --- a/0006-use-var-for-config.patch +++ b/0006-use-var-for-config.patch @@ -1,4 +1,4 @@ -From 9cae86dd15bf78ee9d221f722f723062eb6ad3d8 Mon Sep 17 00:00:00 2001 +From b2af45f06a9b4d78c5dbb9421ac94f62d5e6f884 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 19 Nov 2012 16:38:45 -0800 Subject: [PATCH] use var for config @@ -147,10 +147,10 @@ index c05814a..326c3b0 100644 Note that for iSNS the poll_interval does not have to be set. If not set, iscsid will only perform rediscovery when it gets a SCN from the server. diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8 -index bf23dd2..9cfce16 100644 +index 22263eb..f47afac 100644 --- a/doc/iscsiadm.8 +++ b/doc/iscsiadm.8 -@@ -228,7 +228,7 @@ This option is only valid for ping submode. +@@ -229,7 +229,7 @@ This option is only valid for ping submode. .TP \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR The interface argument specifies the iSCSI interface to use for the operation. @@ -159,7 +159,7 @@ index bf23dd2..9cfce16 100644 iSCSI (qla4xxx) the iface config must have the hardware address (iface.hwaddress = port's MAC address) and the driver/transport_name (iface.transport_name). The iface's name is -@@ -301,7 +301,7 @@ If no other options are specified: for \fIdiscovery\fR, \fIdiscoverydb\fR and +@@ -309,7 +309,7 @@ If no other options are specified: for \fIdiscovery\fR, \fIdiscoverydb\fR and \fInode\fR, all of their respective records are displayed; for \fIsession\fR, all active sessions and connections are displayed; for \fIfw\fR, all boot firmware values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; @@ -168,7 +168,7 @@ index bf23dd2..9cfce16 100644 .TP \fB\-n\fR, \fB\-\-name=\fIname\fR In node mode, specify a field \fIname\fR in a record. In flashnode submode -@@ -640,10 +640,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup. +@@ -648,10 +648,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup. The file containing the iSCSI InitiatorName and InitiatorAlias read by \fBiscsid\fR and \fBiscsiadm\fR on startup. .TP @@ -195,10 +195,10 @@ index 6f9218f..0da0551 100644 .SH "SEE ALSO" diff --git a/usr/idbm.c b/usr/idbm.c -index aed08f2..15802c3 100644 +index 0f0f17a..27cad0a 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -2968,9 +2968,9 @@ free_info: +@@ -3068,9 +3068,9 @@ free_info: int idbm_init(idbm_get_config_file_fn *fn) { /* make sure root db dir is there */ @@ -212,7 +212,7 @@ index aed08f2..15802c3 100644 return errno; } diff --git a/usr/idbm.h b/usr/idbm.h -index 18c5025..6bdfd60 100644 +index 46cd82a..ce098b7 100644 --- a/usr/idbm.h +++ b/usr/idbm.h @@ -30,12 +30,13 @@ @@ -251,5 +251,5 @@ index 6c06f7f..c8b9de9 100644 struct iface_rec; struct list_head; -- -2.21.0 +2.26.2 diff --git a/0007-use-red-hat-for-name.patch b/0007-use-red-hat-for-name.patch index 2719565..53ac29c 100644 --- a/0007-use-red-hat-for-name.patch +++ b/0007-use-red-hat-for-name.patch @@ -1,4 +1,4 @@ -From 1ddee25396962a6bd966b98311881ed6d4cba87c Mon Sep 17 00:00:00 2001 +From 8312003a6a9e41d8d20eb8225ec8c4b2860351ec Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 19 Nov 2012 16:40:04 -0800 Subject: [PATCH] use red hat for name @@ -22,10 +22,10 @@ index 6a413f6..dd77ed9 100644 .SH AUTHORS Open-iSCSI project diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c -index da850dc..29aa4ad 100644 +index 0f587e1..0e15650 100644 --- a/utils/iscsi-iname.c +++ b/utils/iscsi-iname.c -@@ -80,7 +80,7 @@ main(int argc, char *argv[]) +@@ -89,7 +89,7 @@ main(int argc, char *argv[]) exit(0); } } else { @@ -35,5 +35,5 @@ index da850dc..29aa4ad 100644 /* try to feed some entropy from the pool to MD5 in order to get -- -2.21.0 +2.26.2 diff --git a/0008-libiscsi.patch b/0008-libiscsi.patch index 9b0aed0..39d1a84 100644 --- a/0008-libiscsi.patch +++ b/0008-libiscsi.patch @@ -1,7 +1,7 @@ -From 029ded4ed0de80a15836caed8747fab17958179a Mon Sep 17 00:00:00 2001 +From 8b4da8007ef59bbc833fed882ddae57bbcd51f1c Mon Sep 17 00:00:00 2001 From: rpm-build Date: Mon, 26 Jan 2015 12:57:11 -0800 -Subject: [PATCH 1/1] libiscsi +Subject: [PATCH] libiscsi --- Makefile | 2 + @@ -3927,7 +3927,7 @@ index 21bb154..885243a 100644 ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod) diff --git a/usr/discovery.c b/usr/discovery.c -index 9ce122e..4ef5448 100644 +index 7dec696..2cf1838 100644 --- a/usr/discovery.c +++ b/usr/discovery.c @@ -36,6 +36,7 @@ @@ -3968,10 +3968,10 @@ index 9ce122e..4ef5448 100644 int discovery_fw(void *data, __attribute__((unused))struct iface_rec *iface, diff --git a/usr/idbm.c b/usr/idbm.c -index a5c653c..d5e16cb 100644 +index 27cad0a..2498a03 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -1824,9 +1824,9 @@ int idbm_print_all_discovery(int info_level) +@@ -1825,9 +1825,9 @@ int idbm_print_all_discovery(int info_level) * fn should return -1 if it skipped the rec, an ISCSI_ERR error code if * the operation failed or 0 if fn was run successfully. */ @@ -3999,7 +3999,7 @@ index ce098b7..d1a7f63 100644 char *targetname, bool ruw_lock); extern int idbm_for_each_node(int *found, void *data, diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h -index 47857dd..fb8e965 100644 +index 47857dd..596543b 100644 --- a/usr/iscsi_ipc.h +++ b/usr/iscsi_ipc.h @@ -162,4 +162,6 @@ struct iscsi_ipc { @@ -4010,5 +4010,5 @@ index 47857dd..fb8e965 100644 + #endif /* ISCSI_IPC_H */ -- -2.21.1 +2.26.2 diff --git a/0009-Add-macros-to-release-GIL-lock.patch b/0009-Add-macros-to-release-GIL-lock.patch index 6804133..e03b7ef 100644 --- a/0009-Add-macros-to-release-GIL-lock.patch +++ b/0009-Add-macros-to-release-GIL-lock.patch @@ -1,4 +1,4 @@ -From 3df19ccba0af40da8cdb15c41e1bcd08ce25fbd9 Mon Sep 17 00:00:00 2001 +From 676f48d6e70f8406b36a004669d923825db51e2f Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Mon, 11 May 2015 13:16:26 +0200 Subject: [PATCH] Add macros to release GIL lock @@ -52,5 +52,5 @@ index 8800853..40b5955 100644 libiscsi_get_error_string(context)); return NULL; -- -2.21.0 +2.26.2 diff --git a/0010-libiscsi-introduce-sessions-API.patch b/0010-libiscsi-introduce-sessions-API.patch index b6c3728..57ab58f 100644 --- a/0010-libiscsi-introduce-sessions-API.patch +++ b/0010-libiscsi-introduce-sessions-API.patch @@ -1,4 +1,4 @@ -From bca0b3a085b7a169aa40d81ed7997c73fde8b4d3 Mon Sep 17 00:00:00 2001 +From 2c28c620727e522f022689312d76f107eb8ef18f Mon Sep 17 00:00:00 2001 From: Peter Hatina Date: Mon, 5 Oct 2015 16:50:36 -0700 Subject: [PATCH] libiscsi introduce sessions API @@ -242,7 +242,7 @@ index 756590e..a9891f4 100644 * * Set the given nodes iSCSI parameter named by \e parameter to value \e value. diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c -index 418f51b..6febba2 100644 +index 435c576..e549afe 100644 --- a/usr/iscsi_sysfs.c +++ b/usr/iscsi_sysfs.c @@ -3,6 +3,7 @@ @@ -286,5 +286,5 @@ index 1d0377f..909db34 100644 int *nr_found, iscsi_sysfs_iface_op_fn *fn); -- -2.21.0 +2.26.2 diff --git a/0011-libiscsi-fix-discovery-request-timeout-regression.patch b/0011-libiscsi-fix-discovery-request-timeout-regression.patch index 8771f6a..cddc17c 100644 --- a/0011-libiscsi-fix-discovery-request-timeout-regression.patch +++ b/0011-libiscsi-fix-discovery-request-timeout-regression.patch @@ -1,4 +1,4 @@ -From 2e660a78632545e98f7c9e2ffb8518512c0db5ff Mon Sep 17 00:00:00 2001 +From c53c576c09c5a3a1654b7a1f08fcc222a102499d Mon Sep 17 00:00:00 2001 From: rpm-build Date: Tue, 28 Feb 2017 09:00:41 -0800 Subject: [PATCH] libiscsi: fix discovery request timeout regression @@ -28,5 +28,5 @@ index 755c18c..bb17dfc 100644 rc = idbm_bind_ifaces_to_nodes(discovery_fw, &drec, &ifaces, &rec_list); if (rc) { -- -2.21.0 +2.26.2 diff --git a/0012-libiscsi-format-security-build-errors.patch b/0012-libiscsi-format-security-build-errors.patch index 19244b3..421bc3b 100644 --- a/0012-libiscsi-format-security-build-errors.patch +++ b/0012-libiscsi-format-security-build-errors.patch @@ -1,4 +1,4 @@ -From 3040b7530eda1ab5625d76783dc7b8cf595a0ef0 Mon Sep 17 00:00:00 2001 +From cf4db608004f7c1f137ed556e3ba6b6f4d65da96 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Tue, 28 Feb 2017 10:06:42 -0800 Subject: [PATCH] libiscsi format-security build errors @@ -31,5 +31,5 @@ index bb17dfc..7003388 100644 } -- -2.21.0 +2.26.2 diff --git a/0013-libiscsi-fix-build-to-use-libopeniscsiusr.patch b/0013-libiscsi-fix-build-to-use-libopeniscsiusr.patch index 65688a7..9b3c34b 100644 --- a/0013-libiscsi-fix-build-to-use-libopeniscsiusr.patch +++ b/0013-libiscsi-fix-build-to-use-libopeniscsiusr.patch @@ -1,4 +1,4 @@ -From 123fc55dd8ad98c9afd39bf0824b3d31d5e93214 Mon Sep 17 00:00:00 2001 +From a86a677762cf5fd45a43029a4fd3dd83d1a87a98 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Thu, 24 May 2018 15:17:05 -0700 Subject: [PATCH] libiscsi fix build to use libopeniscsiusr @@ -32,5 +32,5 @@ index 53f9746..f2cf248 100644 # Flags for the tests -- -2.21.0 +2.26.2 diff --git a/0014-libiscsi-fix-build-against-latest-upstream-again.patch b/0014-libiscsi-fix-build-against-latest-upstream-again.patch index ef2c891..f9f8d07 100644 --- a/0014-libiscsi-fix-build-against-latest-upstream-again.patch +++ b/0014-libiscsi-fix-build-against-latest-upstream-again.patch @@ -1,4 +1,4 @@ -From 039700890e11dff3323241349d3858f258c09cc0 Mon Sep 17 00:00:00 2001 +From 55af753f593243bcd1ab4c7e82620bdee432915b Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Thu, 7 Nov 2019 09:16:17 -0800 Subject: [PATCH] libiscsi: fix build against latest upstream, again @@ -62,5 +62,5 @@ index 7003388..c598aee 100644 strcpy(context->error_str, "No such node"); rc = ENODEV; -- -2.21.0 +2.26.2 diff --git a/0015-remove-the-offload-boot-supported-ifdef.patch b/0015-remove-the-offload-boot-supported-ifdef.patch index d63dbd9..2466935 100644 --- a/0015-remove-the-offload-boot-supported-ifdef.patch +++ b/0015-remove-the-offload-boot-supported-ifdef.patch @@ -1,4 +1,4 @@ -From d0689253c9e2eb78fc5296adb109aba4d35a13fd Mon Sep 17 00:00:00 2001 +From d410fe4b6eb2347f2160b8aaab24a639de99c23c Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 19 Nov 2012 17:09:24 -0800 Subject: [PATCH] remove the offload boot supported ifdef @@ -8,10 +8,10 @@ Subject: [PATCH] remove the offload boot supported ifdef 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/usr/iface.c b/usr/iface.c -index 645b0b8..9cd07fd 100644 +index 11f3d2a..65c1615 100644 --- a/usr/iface.c +++ b/usr/iface.c -@@ -993,6 +993,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface, +@@ -998,6 +998,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface, { struct iscsi_transport *t = NULL; uint32_t hostno; @@ -19,7 +19,7 @@ index 645b0b8..9cd07fd 100644 if (strlen(context->initiatorname)) strlcpy(iface->iname, context->initiatorname, -@@ -1006,10 +1007,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface, +@@ -1011,10 +1012,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface, return 0; } } else if (strlen(context->iface)) { @@ -30,7 +30,7 @@ index 645b0b8..9cd07fd 100644 memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN); /* make sure offload driver is loaded */ -@@ -1035,9 +1033,6 @@ int iface_setup_from_boot_context(struct iface_rec *iface, +@@ -1040,9 +1038,6 @@ int iface_setup_from_boot_context(struct iface_rec *iface, } strlcpy(iface->netdev, context->iface, sizeof(iface->netdev)); @@ -41,5 +41,5 @@ index 645b0b8..9cd07fd 100644 return 0; -- -2.21.0 +2.26.2 diff --git a/0016-Revert-iscsiadm-return-error-when-login-fails.patch b/0016-Revert-iscsiadm-return-error-when-login-fails.patch index 0420b01..7cae8ab 100644 --- a/0016-Revert-iscsiadm-return-error-when-login-fails.patch +++ b/0016-Revert-iscsiadm-return-error-when-login-fails.patch @@ -1,4 +1,4 @@ -From ccb9d70a0dad7c42f926f1680ae708a5ae3d3696 Mon Sep 17 00:00:00 2001 +From 49dc2a687175f9671a159df38971a15287dae18c Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 24 Feb 2014 09:33:33 -0800 Subject: [PATCH] Revert "iscsiadm: return error when login fails" @@ -30,5 +30,5 @@ index 0500f15..1e1f2bc 100644 } -- -2.21.0 +2.26.2 diff --git a/0017-dont-install-scripts.patch b/0017-dont-install-scripts.patch index 14c3683..a7c1c38 100644 --- a/0017-dont-install-scripts.patch +++ b/0017-dont-install-scripts.patch @@ -1,4 +1,4 @@ -From f524e332835b2b59d3f3ff8a67814ef2d58a2857 Mon Sep 17 00:00:00 2001 +From e35261316aaa598c4146a5396745cb76571e94fe Mon Sep 17 00:00:00 2001 From: rpm-build Date: Fri, 25 May 2018 09:39:07 -0700 Subject: [PATCH] dont install scripts @@ -21,5 +21,5 @@ index 4ab091f..7e6b734 100644 $(INSTALL) -m 755 $^ $(DESTDIR)$(sbindir) -- -2.21.0 +2.26.2 diff --git a/0018-use-var-lib-iscsi-in-libopeniscsiusr.patch b/0018-use-var-lib-iscsi-in-libopeniscsiusr.patch index 08d5ed2..3a780d9 100644 --- a/0018-use-var-lib-iscsi-in-libopeniscsiusr.patch +++ b/0018-use-var-lib-iscsi-in-libopeniscsiusr.patch @@ -1,4 +1,4 @@ -From e2b8215b80cc037ecbcb9eef50e432c31d5e56eb Mon Sep 17 00:00:00 2001 +From e186e959ddc2a47e7cfe1f5a8ea4d3fa8248a478 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Wed, 30 May 2018 16:08:30 -0700 Subject: [PATCH] use /var/lib/iscsi in libopeniscsiusr @@ -12,7 +12,7 @@ Subject: [PATCH] use /var/lib/iscsi in libopeniscsiusr 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libopeniscsiusr/idbm.h b/libopeniscsiusr/idbm.h -index 3fd0864..c84d332 100644 +index cc90388..5a4d2fa 100644 --- a/libopeniscsiusr/idbm.h +++ b/libopeniscsiusr/idbm.h @@ -31,7 +31,8 @@ @@ -105,5 +105,5 @@ index 39e07b3..9eba7fa 100644 /* Might be public in the future */ __DLL_LOCAL void iscsi_node_free(struct iscsi_node *node); -- -2.21.0 +2.26.2 diff --git a/0019-Coverity-scan-fixes.patch b/0019-Coverity-scan-fixes.patch index 24f006f..2a852f7 100644 --- a/0019-Coverity-scan-fixes.patch +++ b/0019-Coverity-scan-fixes.patch @@ -1,7 +1,7 @@ -From ad8c3353b8e482575ff2208182290cf35b624dde Mon Sep 17 00:00:00 2001 +From 0c300716226027d75afa2b9e5f052fa4868204ae Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Wed, 5 Jun 2019 09:08:39 -0700 -Subject: [PATCH 1/1] Coverity scan fixes +Subject: [PATCH] Coverity scan fixes --- iscsiuio/src/unix/libs/qedi.c | 2 +- @@ -61,10 +61,10 @@ index 7bc2381..7d4c338 100644 fd = open(LOCK_FILE, O_RDWR | O_CREAT, 0666); diff --git a/usr/idbm.c b/usr/idbm.c -index d5e16cb..a210c88 100644 +index 2498a03..a4bc745 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -1438,12 +1438,10 @@ int idbm_lock(void) +@@ -1439,12 +1439,10 @@ int idbm_lock(void) return 0; } @@ -82,10 +82,10 @@ index d5e16cb..a210c88 100644 fd = open(LOCK_FILE, O_RDWR | O_CREAT, 0666); diff --git a/usr/iscsid.c b/usr/iscsid.c -index 99d27ab..dbb0900 100644 +index e501498..dd94a16 100644 --- a/usr/iscsid.c +++ b/usr/iscsid.c -@@ -490,8 +490,8 @@ int main(int argc, char *argv[]) +@@ -495,8 +495,8 @@ int main(int argc, char *argv[]) log_close(log_pid); exit(ISCSI_ERR); } @@ -96,5 +96,5 @@ index 99d27ab..dbb0900 100644 if ((control_fd = ipc->ctldev_open()) < 0) { log_close(log_pid); -- -2.21.1 +2.26.2 diff --git a/0020-fix-upstream-build-breakage-of-iscsiuio-LDFLAGS.patch b/0020-fix-upstream-build-breakage-of-iscsiuio-LDFLAGS.patch index b7d5c02..d764fb3 100644 --- a/0020-fix-upstream-build-breakage-of-iscsiuio-LDFLAGS.patch +++ b/0020-fix-upstream-build-breakage-of-iscsiuio-LDFLAGS.patch @@ -1,4 +1,4 @@ -From 4142125fa296d21a307fb2370b2d4d7e8487f22c Mon Sep 17 00:00:00 2001 +From c852ca6300bc3fcf765744506222ff6da4296127 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Wed, 16 Oct 2019 23:17:20 -0700 Subject: [PATCH] fix upstream build breakage of iscsiuio LDFLAGS @@ -8,7 +8,7 @@ Subject: [PATCH] fix upstream build breakage of iscsiuio LDFLAGS 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac -index b41df0e..a856cc5 100644 +index 8099f09..733214d 100644 --- a/iscsiuio/configure.ac +++ b/iscsiuio/configure.ac @@ -67,10 +67,10 @@ AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) @@ -25,5 +25,5 @@ index b41df0e..a856cc5 100644 AC_CONFIG_COMMANDS([default],[[ if [ -n "$SOURCE_DATE_EPOCH" ] ; then -- -2.21.0 +2.26.2 diff --git a/0021-improve-systemd-service-files-for-boot-session-handl.patch b/0021-improve-systemd-service-files-for-boot-session-handl.patch deleted file mode 100644 index ba53b55..0000000 --- a/0021-improve-systemd-service-files-for-boot-session-handl.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 77150edd697669467ff9f8775b93bd9d7a34cadf Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Mon, 28 Oct 2019 10:20:56 -0700 -Subject: [PATCH] improve systemd service files for boot session handling - ---- - etc/systemd/iscsi-mark-root-nodes | 6 +++++- - etc/systemd/iscsi-onboot.service | 15 +++++++++++++++ - etc/systemd/iscsi-shutdown.service | 1 + - etc/systemd/iscsi.service | 11 ++++------- - etc/systemd/iscsid.service | 4 +--- - etc/systemd/iscsiuio.service | 1 - - 6 files changed, 26 insertions(+), 12 deletions(-) - create mode 100644 etc/systemd/iscsi-onboot.service - -diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes -index c693707..9d48805 100755 ---- a/etc/systemd/iscsi-mark-root-nodes -+++ b/etc/systemd/iscsi-mark-root-nodes -@@ -9,7 +9,11 @@ while read t num p target flash; do - portal=${p%,*} - transport=${t%:} - -- $ISCSIADM -m node -p $portal -T $target -o update -n node.startup -v onboot -+ # use session number to find the iface name in use -+ num=${num#[}; num=${num%]} -+ iface=$(iscsiadm -m session -r $num | grep iface.iscsi_ifacename | cut -d= -f2) -+ -+ $ISCSIADM -m node -p $portal -T $target -I $iface -o update -n node.startup -v onboot - - start_iscsid=1 - -diff --git a/etc/systemd/iscsi-onboot.service b/etc/systemd/iscsi-onboot.service -new file mode 100644 -index 0000000..42ced68 ---- /dev/null -+++ b/etc/systemd/iscsi-onboot.service -@@ -0,0 +1,15 @@ -+[Unit] -+Description=Special handling of early boot iSCSI sessions -+Documentation=man:iscsiadm(8) man:iscsid(8) -+DefaultDependencies=no -+RefuseManualStart=true -+Before=iscsi.service -+After=systemd-remount-fs.service -+ConditionDirectoryNotEmpty=/sys/class/iscsi_session -+ -+[Service] -+Type=oneshot -+ExecStart=-/usr/libexec/iscsi-mark-root-nodes -+ -+[Install] -+WantedBy=sysinit.target -diff --git a/etc/systemd/iscsi-shutdown.service b/etc/systemd/iscsi-shutdown.service -index 69c1c77..caee933 100644 ---- a/etc/systemd/iscsi-shutdown.service -+++ b/etc/systemd/iscsi-shutdown.service -@@ -11,4 +11,5 @@ RefuseManualStop=yes - [Service] - Type=oneshot - RemainAfterExit=true -+ExecStart=-/usr/bin/true - ExecStop=-/usr/sbin/iscsiadm -m node --logoutall=all -diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service -index eadfcec..175cb2c 100644 ---- a/etc/systemd/iscsi.service -+++ b/etc/systemd/iscsi.service -@@ -1,21 +1,18 @@ - [Unit] - Description=Login and scanning of iSCSI devices --Documentation=man:iscsid(8) man:iscsiadm(8) -+Documentation=man:iscsiadm(8) man:iscsid(8) - DefaultDependencies=no --Conflicts=shutdown.target --After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service - Before=remote-fs-pre.target -+After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service - Wants=remote-fs-pre.target iscsi-shutdown.service --ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes --ConditionDirectoryNotEmpty=|/sys/class/iscsi_session -+ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes - - [Service] - Type=oneshot - RemainAfterExit=true --ExecStart=-/usr/libexec/iscsi-mark-root-nodes - ExecStart=-/usr/sbin/iscsiadm -m node --loginall=automatic - ExecReload=-/usr/sbin/iscsiadm -m node --loginall=automatic - SuccessExitStatus=21 - - [Install] --WantedBy=sysinit.target -+WantedBy=remote-fs.target -diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service -index 8d50cf0..28402fb 100644 ---- a/etc/systemd/iscsid.service -+++ b/etc/systemd/iscsid.service -@@ -1,8 +1,7 @@ - [Unit] - Description=Open-iSCSI --Documentation=man:iscsid(8) man:iscsiadm(8) -+Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) - DefaultDependencies=no --Conflicts=shutdown.target - After=network.target iscsiuio.service - Before=remote-fs-pre.target - -@@ -10,7 +9,6 @@ Before=remote-fs-pre.target - Type=notify - NotifyAccess=main - ExecStart=/usr/sbin/iscsid -f --ExecStop=/usr/sbin/iscsiadm -k 0 2 - KillMode=mixed - Restart=on-failure - -diff --git a/etc/systemd/iscsiuio.service b/etc/systemd/iscsiuio.service -index 8620cde..fc0be93 100644 ---- a/etc/systemd/iscsiuio.service -+++ b/etc/systemd/iscsiuio.service -@@ -2,7 +2,6 @@ - Description=iSCSI UserSpace I/O driver - Documentation=man:iscsiuio(8) - DefaultDependencies=no --Conflicts=shutdown.target - Requires=iscsid.service - BindTo=iscsid.service - After=network.target --- -2.21.0 - diff --git a/0021-use-Red-Hat-version-string-to-match-RPM-package-vers.patch b/0021-use-Red-Hat-version-string-to-match-RPM-package-vers.patch index 5821bcb..7ac6553 100644 --- a/0021-use-Red-Hat-version-string-to-match-RPM-package-vers.patch +++ b/0021-use-Red-Hat-version-string-to-match-RPM-package-vers.patch @@ -1,14 +1,14 @@ -From 58d24c239b9b6f762231ff3eedbc685971ce0a98 Mon Sep 17 00:00:00 2001 +From d7b7bd54b7d99ee865f629fac5f0b622d46e2c95 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 21 Jan 2013 15:43:36 -0800 -Subject: [PATCH 1/1] use Red Hat version string to match RPM package version +Subject: [PATCH] use Red Hat version string to match RPM package version --- usr/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/version.h b/usr/version.h -index 4fa9179..c5c9e76 100644 +index 115a11c..1214f3b 100644 --- a/usr/version.h +++ b/usr/version.h @@ -6,7 +6,7 @@ @@ -16,10 +16,10 @@ index 4fa9179..c5c9e76 100644 * some other maintainer could merge a patch without going through us */ -#define ISCSI_VERSION_STR "2.1.2" -+#define ISCSI_VERSION_STR "6.2.1.1-0" ++#define ISCSI_VERSION_STR "6.2.1.2" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif -- -2.21.1 +2.26.2 diff --git a/0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch b/0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch index 1c899de..2318503 100644 --- a/0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch +++ b/0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch @@ -1,4 +1,4 @@ -From a37c8753f277c156bcd4b3e7596931e3de2e67d7 Mon Sep 17 00:00:00 2001 +From 84a8601fe7b9b5337af95835aaa5aae1bfd88d95 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Tue, 11 Aug 2020 21:00:29 +0200 Subject: [PATCH] iscsi_if.h replace zero-length array with flexible-array diff --git a/0001-stop-using-Werror-for-now.patch b/0023-stop-using-Werror-for-now.patch similarity index 90% rename from 0001-stop-using-Werror-for-now.patch rename to 0023-stop-using-Werror-for-now.patch index 9d8d040..624081c 100644 --- a/0001-stop-using-Werror-for-now.patch +++ b/0023-stop-using-Werror-for-now.patch @@ -1,7 +1,7 @@ -From d4758b0d347e4adccf4d39e6bd29ba68c53a92b8 Mon Sep 17 00:00:00 2001 +From af428f588f8023784c6f4b0a25d13b70fb7216ab Mon Sep 17 00:00:00 2001 From: rpm-build Date: Tue, 3 Mar 2020 10:35:40 -0800 -Subject: [PATCH 1/1] stop using Werror for now +Subject: [PATCH] stop using Werror for now need to work through these warning that only appear on s390x Werror seems bad for release, makes packaging a nightmare when new @@ -39,7 +39,7 @@ index 885243a..1a743d1 100644 -I$(TOPDIR)/libopeniscsiusr -DISNS_ENABLE CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod) diff --git a/usr/initiator.c b/usr/initiator.c -index a07f9aa..a06760c 100644 +index 684647c..a5a9d08 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -580,7 +580,7 @@ __session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop, @@ -52,5 +52,5 @@ index a07f9aa..a06760c 100644 log_debug(1, "re-opening session %d (reopen_cnt %d)", session->id, session->reopen_cnt); -- -2.21.1 +2.26.2 diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 580cf39..3055496 100644 --- a/iscsi-initiator-utils.spec +++ b/iscsi-initiator-utils.spec @@ -1,6 +1,6 @@ %global open_iscsi_version 2.1 %global open_iscsi_build 2 -%global commit0 13e7f58a1658636202994e3298237edefb985919 +%global commit0 a8fcb3737cabcf79a3a3663f43930a158d606782 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) # Disable python2 build by default @@ -9,7 +9,7 @@ Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.%{open_iscsi_version}.%{open_iscsi_build} -Release: 1.git%{shortcommit0}%{?dist} +Release: 2.git%{shortcommit0}%{?dist} License: GPLv2+ URL: http://www.open-iscsi.org Source0: https://github.com/open-iscsi/open-iscsi/archive/%{commit0}.tar.gz#/open-iscsi-%{shortcommit0}.tar.gz @@ -38,7 +38,7 @@ Patch0019: 0019-Coverity-scan-fixes.patch Patch0020: 0020-fix-upstream-build-breakage-of-iscsiuio-LDFLAGS.patch Patch0021: 0021-use-Red-Hat-version-string-to-match-RPM-package-vers.patch Patch0022: 0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch -Patch0023: 0001-stop-using-Werror-for-now.patch +Patch0023: 0023-stop-using-Werror-for-now.patch BuildRequires: flex bison doxygen kmod-devel systemd-units BuildRequires: autoconf automake libtool libmount-devel openssl-devel @@ -180,6 +180,7 @@ touch $RPM_BUILD_ROOT%{_rundir}/lock/iscsi/lock %{__install} -d $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsi-init.service $RPM_BUILD_ROOT%{_unitdir} +%{__install} -pm 644 etc/systemd/iscsi-onboot.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsi-shutdown.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir} @@ -270,6 +271,7 @@ fi %dir %{_sharedstatedir}/iscsi/send_targets %ghost %{_rundir}/lock/iscsi %{_unitdir}/iscsi.service +%{_unitdir}/iscsi-onboot.service %{_unitdir}/iscsi-init.service %{_unitdir}/iscsi-shutdown.service %{_unitdir}/iscsid.service diff --git a/sources b/sources index 6023c6a..8a5531f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (open-iscsi-13e7f58.tar.gz) = baaf1b69c6e2da24684458bd3042dae07dcaa415b0b4c44d2b5b9076f17871f7c430e6f515a18ea439ee02da7d76af25fee82a9e88196eea59cce88979b5bc9b +SHA512 (open-iscsi-a8fcb37.tar.gz) = 56f41e3fcc9f5b14adc5288c420361e1be57c1a235035f343760208d2c0c5d31f6c53478d0438e16475d2afcb5148ca7c334e97b37f715961815edd4846ef439