]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
fabrics: Don't include trailing newline in nvmf_hostnqn_generate()
authorTomas Bzatek <tbzatek@redhat.com>
Wed, 1 Dec 2021 16:38:12 +0000 (17:38 +0100)
committerTomas Bzatek <tbzatek@redhat.com>
Wed, 1 Dec 2021 17:20:04 +0000 (18:20 +0100)
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
src/nvme/fabrics.h

index 9207296ba95735c67c8e58becf41b2744f0235e7..9f0b005987aa392ea89a4f71b98b8cfe6c2cf2ec 100644 (file)
@@ -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;
index 4a7481a83f0141f7b48bce18a65662b019bd05c9..73932ff382731e6b90d7488c0d732e89d7012e3c 100644 (file)
@@ -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();