iscsi: remove uses of strcpy()
Change-Id: Ia1e8c639655462d0218e7465c046cf604c1443fe Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
02d42f4a69
commit
cd1377c636
@ -105,18 +105,18 @@ static struct rte_timer g_start_up_timer;
|
|||||||
static void
|
static void
|
||||||
spdk_iscsi_config_dump_section(FILE *fp)
|
spdk_iscsi_config_dump_section(FILE *fp)
|
||||||
{
|
{
|
||||||
char authmethod[32] = "None";
|
const char *authmethod = "None";
|
||||||
char authgroup[32] = "None";
|
char authgroup[32] = "None";
|
||||||
|
|
||||||
if (NULL == fp)
|
if (NULL == fp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_spdk_iscsi.req_discovery_auth)
|
if (g_spdk_iscsi.req_discovery_auth)
|
||||||
strcpy(authmethod, "CHAP");
|
authmethod = "CHAP";
|
||||||
else if (g_spdk_iscsi.req_discovery_auth_mutual)
|
else if (g_spdk_iscsi.req_discovery_auth_mutual)
|
||||||
strcpy(authmethod, "CHAP Mutual");
|
authmethod = "CHAP Mutual";
|
||||||
else if (!g_spdk_iscsi.no_discovery_auth)
|
else if (!g_spdk_iscsi.no_discovery_auth)
|
||||||
strcpy(authmethod, "Auto");
|
authmethod = "Auto";
|
||||||
|
|
||||||
if (g_spdk_iscsi.discovery_auth_group)
|
if (g_spdk_iscsi.discovery_auth_group)
|
||||||
sprintf(authgroup, "AuthGroup%d", g_spdk_iscsi.discovery_auth_group);
|
sprintf(authgroup, "AuthGroup%d", g_spdk_iscsi.discovery_auth_group);
|
||||||
@ -278,26 +278,26 @@ spdk_iscsi_config_dump_target_nodes(FILE *fp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
char authmethod[32] = "None";
|
const char *authmethod = "None";
|
||||||
char authgroup[32] = "None";
|
char authgroup[32] = "None";
|
||||||
char usedigest[32] = "Auto";
|
const char *usedigest = "Auto";
|
||||||
|
|
||||||
if (target->auth_chap_disabled)
|
if (target->auth_chap_disabled)
|
||||||
strcpy(authmethod, "None");
|
authmethod = "None";
|
||||||
else if (!target->auth_chap_required)
|
else if (!target->auth_chap_required)
|
||||||
strcpy(authmethod, "Auto");
|
authmethod = "Auto";
|
||||||
else if (target->auth_chap_mutual)
|
else if (target->auth_chap_mutual)
|
||||||
strcpy(authmethod, "CHAP Mutual");
|
authmethod = "CHAP Mutual";
|
||||||
else
|
else
|
||||||
strcpy(authmethod, "CHAP");
|
authmethod = "CHAP";
|
||||||
|
|
||||||
if (target->auth_group > 0)
|
if (target->auth_group > 0)
|
||||||
sprintf(authgroup, "AuthGroup%d", target->auth_group);
|
sprintf(authgroup, "AuthGroup%d", target->auth_group);
|
||||||
|
|
||||||
if (target->header_digest)
|
if (target->header_digest)
|
||||||
strcpy(usedigest, "Header");
|
usedigest = "Header";
|
||||||
else if (target->data_digest)
|
else if (target->data_digest)
|
||||||
strcpy(usedigest, "Data");
|
usedigest = "Data";
|
||||||
|
|
||||||
fprintf(fp, TARGET_NODE_AUTH_TMPL,
|
fprintf(fp, TARGET_NODE_AUTH_TMPL,
|
||||||
authmethod, authgroup, usedigest);
|
authmethod, authgroup, usedigest);
|
||||||
|
Loading…
Reference in New Issue
Block a user