mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
Opps, last one did not commit the correct changes ... Here they are.
This now uses a lookup on <DOMAIN><1D> and then does a name status query to
the IP address returned to find the name of the server. Seems to work well
against Samba, Win9X, WinNT and Win2K.
(This used to be commit debb723194
)
This commit is contained in:
parent
0ea6c2473b
commit
2e99f0f8d3
@ -1471,7 +1471,7 @@ static void
|
||||
dir_list_fn(file_info *finfo, const char *mask, void *state)
|
||||
{
|
||||
|
||||
fprintf(stderr, "Finfo->name=%s, mask=%s\n", finfo->name, mask);
|
||||
/* fprintf(stderr, "Finfo->name=%s, mask=%s, mode=%0X\n", finfo->name, mask, finfo->mode);*/
|
||||
if (add_dirent((struct smbc_file *)state, finfo->name, "",
|
||||
(finfo->mode&aDIR?SMBC_DIR:SMBC_FILE)) < 0) {
|
||||
|
||||
@ -1561,14 +1561,30 @@ int smbc_opendir(const char *fname)
|
||||
|
||||
/* We have server and share and path empty ... so list the workgroups */
|
||||
|
||||
/* fprintf(stderr, "Workgroup is: %s\n", lp_workgroup()); */
|
||||
cli_get_backup_server(my_netbios_name, lp_workgroup(), server, sizeof(server));
|
||||
/*cli_get_backup_server(my_netbios_name, lp_workgroup(), server, sizeof(server));*/
|
||||
|
||||
if (!resolve_name(lp_workgroup(), &rem_ip, 0x1d)) {
|
||||
|
||||
errno = EINVAL; /* Something wrong with smb.conf? */
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
smbc_file_table[slot]->dir_type = SMBC_WORKGROUP;
|
||||
|
||||
/*
|
||||
* Get a connection to IPC$ on the server if we do not already have one
|
||||
*/
|
||||
/* find the name of the server ... */
|
||||
|
||||
if (!name_status_find(0, rem_ip, server)) {
|
||||
|
||||
fprintf(stderr, "Could not get the name of local master browser ...\n");
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a connection to IPC$ on the server if we do not already have one
|
||||
*/
|
||||
|
||||
srv = smbc_server(server, "IPC$", lp_workgroup(), user, password);
|
||||
|
||||
@ -1618,7 +1634,15 @@ int smbc_opendir(const char *fname)
|
||||
* Get the backup list ...
|
||||
*/
|
||||
|
||||
cli_get_backup_server(my_netbios_name, server, buserver, sizeof(buserver));
|
||||
/*cli_get_backup_server(my_netbios_name, server, buserver, sizeof(buserver)); */
|
||||
|
||||
if (!name_status_find(0, rem_ip, buserver)) {
|
||||
|
||||
fprintf(stderr, "Could not get name of local master browser ...\n");
|
||||
errno = EPERM; /* FIXME, is this correct */
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a connection to IPC$ on the server if we do not already have one
|
||||
|
Loading…
Reference in New Issue
Block a user