summaryrefslogtreecommitdiff
path: root/source3/smbwrapper
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-12-20 03:22:51 +0000
committerAndrew Tridgell <tridge@samba.org>2000-12-20 03:22:51 +0000
commitabb9a2de72073a8a6f332b60d74af9eb6c3d6f25 (patch)
treed7814a9822c7c0481e227a5620db122d595264c2 /source3/smbwrapper
parent7bf9d8ce4bb7e96a4c72f674e21d015b1ef1481e (diff)
downloadsamba-abb9a2de72073a8a6f332b60d74af9eb6c3d6f25.tar.gz
samba-abb9a2de72073a8a6f332b60d74af9eb6c3d6f25.tar.bz2
samba-abb9a2de72073a8a6f332b60d74af9eb6c3d6f25.zip
implemented a much nicer name_status() interface. It now returns a
list of structures rather than the dodgy parsing code we had before this also gets smbw working correctly with no initial workgroup (using name_status_find on __MSBROWSE__ returns) (This used to be commit f2be88a8738a39ca5c98936edb7537cd701348a1)
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r--source3/smbwrapper/smbw.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c
index 65a70c9178..91009af1c5 100644
--- a/source3/smbwrapper/smbw.c
+++ b/source3/smbwrapper/smbw.c
@@ -261,6 +261,7 @@ static char *smbw_find_workgroup(void)
char *p;
struct in_addr *ip_list = NULL;
int count = 0;
+ int i;
/* first off see if an existing workgroup name exists */
p = smbw_getshared("WORKGROUP");
@@ -273,12 +274,21 @@ static char *smbw_find_workgroup(void)
if (!name_resolve_bcast(MSBROWSE, 1, &ip_list, &count)) {
DEBUG(1,("No workgroups found!"));
return p;
-
}
- free((char *)ip_list);
+ for (i=0;i<count;i++) {
+ static fstring name;
+ if (name_status_find(0x1d, ip_list[i], name)) {
+ slprintf(server, sizeof(server), "%s#1D", name);
+ if (smbw_server(server, "IPC$")) {
+ free(ip_list);
+ return name;
+ }
+ }
+ }
+
+ free(ip_list);
- DEBUG(0,("Need to do node status code"));
return p;
}