USERNAME / PASSWORD
When failing iscsi-ls due to a missing url, print the url syntax in the error message before aborting
This commit is contained in:
@@ -234,7 +234,7 @@ iscsi_parse_full_url(struct iscsi_context *iscsi, const char *url)
|
||||
char *tmp;
|
||||
|
||||
if (strncmp(url, "iscsi://", 8)) {
|
||||
iscsi_set_error(iscsi, "Invalid URL %s\niSCSI URL must be of the form \"iscsi://[<username>[%<password>]@]<host>[:<port>]/<target-iqn>/<lun>\"\n", url);
|
||||
iscsi_set_error(iscsi, "Invalid URL %s\niSCSI URL must be of the form \"iscsi://[<username>[%%<password>]@]<host>[:<port>]/<target-iqn>/<lun>\"\n", url);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -192,9 +192,14 @@ int main(int argc, const char *argv[])
|
||||
exit(10);
|
||||
}
|
||||
|
||||
if (url == NULL) {
|
||||
fprintf(stderr, "You must specify the URL\n");
|
||||
fprintf(stderr, " iscsi://[<username>[%%<password>]@]<host>[:<port>]/<target-iqn>/<lun>\n");
|
||||
exit(10);
|
||||
}
|
||||
iscsi_url = iscsi_parse_full_url(iscsi, url);
|
||||
if (iscsi_url == NULL) {
|
||||
fprintf(stderr, "Failed to parse URL : %s\n", url);
|
||||
fprintf(stderr, "Failed to parse URL : %s %s\n", url, iscsi_get_error(iscsi));
|
||||
exit(10);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user