mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s4-torture: allow host-only in unc lists in smbtorture
Allow UNC lists like this: 192.168.2.1 192.168.2.2 192.168.2.3 the share name will be taken from the command line
This commit is contained in:
parent
3f2415c9bf
commit
580f955664
@ -238,13 +238,13 @@ bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
|
||||
{
|
||||
char *p;
|
||||
|
||||
*hostname = *sharename = NULL;
|
||||
|
||||
if (strncmp(unc_name, "\\\\", 2) &&
|
||||
strncmp(unc_name, "//", 2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*hostname = *sharename = NULL;
|
||||
|
||||
*hostname = talloc_strdup(mem_ctx, &unc_name[2]);
|
||||
p = terminate_path_at_separator(*hostname);
|
||||
|
||||
|
@ -548,8 +548,11 @@ _PUBLIC_ bool torture_get_conn_index(int conn_index,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!smbcli_parse_unc(unc_list[conn_index % num_unc_names],
|
||||
mem_ctx, host, share)) {
|
||||
p = unc_list[conn_index % num_unc_names];
|
||||
if (p[0] != '/' && p[0] != '\\') {
|
||||
/* allow UNC lists of hosts */
|
||||
(*host) = talloc_strdup(mem_ctx, p);
|
||||
} else if (!smbcli_parse_unc(p, mem_ctx, host, share)) {
|
||||
DEBUG(0, ("Failed to parse UNC name %s\n",
|
||||
unc_list[conn_index % num_unc_names]));
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user