From e104b997a796a4794819d1825905aafe97bbd16f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 1 Dec 2021 17:38:12 +0100 Subject: [PATCH] fabrics: Don't include trailing newline in nvmf_hostnqn_generate() The generated string is directly used in nvme_lookup_host() and might cause mismatches due to the inclusion of a trailing newline. --- src/nvme/fabrics.c | 2 +- src/nvme/fabrics.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c index 9207296b..9f0b0059 100644 --- a/src/nvme/fabrics.c +++ b/src/nvme/fabrics.c @@ -958,7 +958,7 @@ char *nvmf_hostnqn_generate() if (ret < 0) return NULL; - if (asprintf(&hostnqn, "nqn.2014-08.org.nvmexpress:uuid:%s\n", uuid_str) < 0) + if (asprintf(&hostnqn, "nqn.2014-08.org.nvmexpress:uuid:%s", uuid_str) < 0) return NULL; return hostnqn; diff --git a/src/nvme/fabrics.h b/src/nvme/fabrics.h index 4a7481a8..73932ff3 100644 --- a/src/nvme/fabrics.h +++ b/src/nvme/fabrics.h @@ -179,7 +179,7 @@ int nvmf_get_discovery_log(nvme_ctrl_t c, struct nvmf_discovery_log **logp, /** * nvmf_hostnqn_generate() - Generate a machine specific host nqn - * Returns: An nvm namespace qualifieid name string based on the machine + * Returns: An nvm namespace qualified name string based on the machine * identifier, or NULL if not successful. */ char *nvmf_hostnqn_generate(); -- 2.50.1