Allow setting the CHAP username/password via environment variables
so that the password will not be showing up in log where the application logs the "filename/iscsi url" or in ps aux output. LIBISCSI_CHAP_USERNAME and LIBISCSI_CHAP_PASSWORD environment variables are available to set these outside of the url. If hte username/password is ALSO set in the URL, the settings in the URL will override the environment variables.
This commit is contained in:
@@ -262,6 +262,9 @@ iscsi_parse_full_url(struct iscsi_context *iscsi, const char *url)
|
|||||||
}
|
}
|
||||||
portal = str;
|
portal = str;
|
||||||
|
|
||||||
|
user = getenv("LIBISCSI_CHAP_USERNAME");
|
||||||
|
passwd = getenv("LIBISCSI_CHAP_PASSWORD");
|
||||||
|
|
||||||
tmp = index(portal, '@');
|
tmp = index(portal, '@');
|
||||||
if (tmp != NULL) {
|
if (tmp != NULL) {
|
||||||
user = portal;
|
user = portal;
|
||||||
|
|||||||
Reference in New Issue
Block a user