aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 0a9c64e9ce8b..63981edf9ab9 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1461,6 +1461,10 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
1461 iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds); 1461 iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds);
1462 iscsi_pool_free(&session->cmdpool, (void**)session->cmds); 1462 iscsi_pool_free(&session->cmdpool, (void**)session->cmds);
1463 1463
1464 kfree(session->password);
1465 kfree(session->password_in);
1466 kfree(session->username);
1467 kfree(session->username_in);
1464 kfree(session->targetname); 1468 kfree(session->targetname);
1465 kfree(session->hwaddress); 1469 kfree(session->hwaddress);
1466 kfree(session->initiatorname); 1470 kfree(session->initiatorname);
@@ -1869,6 +1873,30 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
1869 case ISCSI_PARAM_EXP_STATSN: 1873 case ISCSI_PARAM_EXP_STATSN:
1870 sscanf(buf, "%u", &conn->exp_statsn); 1874 sscanf(buf, "%u", &conn->exp_statsn);
1871 break; 1875 break;
1876 case ISCSI_PARAM_USERNAME:
1877 kfree(session->username);
1878 session->username = kstrdup(buf, GFP_KERNEL);
1879 if (!session->username)
1880 return -ENOMEM;
1881 break;
1882 case ISCSI_PARAM_USERNAME_IN:
1883 kfree(session->username_in);
1884 session->username_in = kstrdup(buf, GFP_KERNEL);
1885 if (!session->username_in)
1886 return -ENOMEM;
1887 break;
1888 case ISCSI_PARAM_PASSWORD:
1889 kfree(session->password);
1890 session->password = kstrdup(buf, GFP_KERNEL);
1891 if (!session->password)
1892 return -ENOMEM;
1893 break;
1894 case ISCSI_PARAM_PASSWORD_IN:
1895 kfree(session->password_in);
1896 session->password_in = kstrdup(buf, GFP_KERNEL);
1897 if (!session->password_in)
1898 return -ENOMEM;
1899 break;
1872 case ISCSI_PARAM_TARGET_NAME: 1900 case ISCSI_PARAM_TARGET_NAME:
1873 /* this should not change between logins */ 1901 /* this should not change between logins */
1874 if (session->targetname) 1902 if (session->targetname)
@@ -1942,6 +1970,18 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
1942 case ISCSI_PARAM_TPGT: 1970 case ISCSI_PARAM_TPGT:
1943 len = sprintf(buf, "%d\n", session->tpgt); 1971 len = sprintf(buf, "%d\n", session->tpgt);
1944 break; 1972 break;
1973 case ISCSI_PARAM_USERNAME:
1974 len = sprintf(buf, "%s\n", session->username);
1975 break;
1976 case ISCSI_PARAM_USERNAME_IN:
1977 len = sprintf(buf, "%s\n", session->username_in);
1978 break;
1979 case ISCSI_PARAM_PASSWORD:
1980 len = sprintf(buf, "%s\n", session->password);
1981 break;
1982 case ISCSI_PARAM_PASSWORD_IN:
1983 len = sprintf(buf, "%s\n", session->password_in);
1984 break;
1945 default: 1985 default:
1946 return -ENOSYS; 1986 return -ENOSYS;
1947 } 1987 }