summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-11-09 12:44:47 -0800
committerJeremy Allison <jra@samba.org>2009-11-09 12:44:47 -0800
commit5d516181617419b9b078b4f375753afc3b785ced (patch)
tree2e12629eff2a6a4ed5df9bab90b13785f7b5317d /source3
parentd7ce873391f215f4f3785abcd13b9d120b87e744 (diff)
downloadsamba-5d516181617419b9b078b4f375753afc3b785ced.tar.gz
samba-5d516181617419b9b078b4f375753afc3b785ced.tar.bz2
samba-5d516181617419b9b078b4f375753afc3b785ced.zip
Fix bug 6880 - cannot list workgroup servers
reported by Alban Browaeys <prahal@yahoo.com> with fix. Revert 2e989bab0764c298a2530a2d4c8690258eba210c with extra comments - this broke workgroup enumeration. Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/libsmb_dir.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 436b3e8e03..6a4613c3c3 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -617,7 +617,11 @@ SMBC_opendir_ctx(SMBCCTX *context,
!is_ipaddress(server) &&
(resolve_name(server, &rem_ss, 0x1d, false) || /* LMB */
resolve_name(server, &rem_ss, 0x1b, false) )) { /* DMB */
-
+ /*
+ * "server" is actually a workgroup name,
+ * not a server. Make this clear.
+ */
+ char *wgroup = server;
fstring buserver;
dir->dir_type = SMBC_SERVER;
@@ -625,12 +629,17 @@ SMBC_opendir_ctx(SMBCCTX *context,
/*
* Get the backup list ...
*/
- if (!name_status_find(server, 0x20, 0x20,
+ if (!name_status_find(wgroup, 0, 0,
&rem_ss, buserver)) {
+ char addr[INET6_ADDRSTRLEN];
+ print_sockaddr(addr, sizeof(addr), &rem_ss);
DEBUG(0,("Could not get name of "
- "local/domain master browser "
- "for server %s\n", server));
+ "local/domain master browser "
+ "for workgroup %s from "
+ "address %s\n",
+ wgroup,
+ addr));
if (dir) {
SAFE_FREE(dir->fname);
SAFE_FREE(dir);
@@ -663,7 +672,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
dir->srv = srv;
/* Now, list the servers ... */
- if (!cli_NetServerEnum(srv->cli, server,
+ if (!cli_NetServerEnum(srv->cli, wgroup,
0x0000FFFE, list_fn,
(void *)dir)) {