summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-01-06 12:15:46 +0000
committerRichard Sharpe <sharpe@samba.org>2001-01-06 12:15:46 +0000
commita0feaf62b7a25f05978b90f3b11b7e7f882e07dd (patch)
tree76564562de9f86969a0efdf86ba5fbc16c9f13f8 /source3/libsmb
parentc29e85cf89409a7ecbf8316af5d796f812d6be34 (diff)
downloadsamba-a0feaf62b7a25f05978b90f3b11b7e7f882e07dd.tar.gz
samba-a0feaf62b7a25f05978b90f3b11b7e7f882e07dd.tar.bz2
samba-a0feaf62b7a25f05978b90f3b11b7e7f882e07dd.zip
Fix a minor problem with listing servers in a workgroup and add a
gtk+ test application that tests out some of this stuff ... (This used to be commit 606c4aeceac0bd1823ec6376df3ca5016007ab38)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/libsmbclient.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index d0461f2257..50d330e363 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -206,6 +206,13 @@ smbc_parse_path(const char *fname, char *server, char *share, char *path)
if (*p == (char)0)
return 0;
+ if (*p == '/') {
+
+ strncpy(server, lp_workgroup(), 16); /* FIXME: Danger here */
+ return 0;
+
+ }
+
/* ok, its for us. Now parse out the server, share etc. */
if (!next_token(&p, server, "/", sizeof(fstring))) {
@@ -1356,6 +1363,7 @@ int smbc_opendir(const char *fname)
/* Check to see if <server><1D> translates, or <server><20> translates */
if (resolve_name(server, &rem_ip, 0x1d)) { /* Found LMB */
+ pstring buserver;
smbc_file_table[slot]->dir_type = SMBC_SERVER;
@@ -1363,13 +1371,13 @@ int smbc_opendir(const char *fname)
* Get the backup list ...
*/
- cli_get_backup_server(my_netbios_name, server, server, sizeof(server));
+ cli_get_backup_server(my_netbios_name, server, buserver, sizeof(buserver));
/*
* Get a connection to IPC$ on the server if we do not already have one
*/
- srv = smbc_server(server, "IPC$");
+ srv = smbc_server(buserver, "IPC$");
if (!srv) {
@@ -1383,7 +1391,7 @@ int smbc_opendir(const char *fname)
/* Now, list the servers ... */
- if (!cli_NetServerEnum(&srv->cli, lp_workgroup(), 0x0000FFFE, list_fn,
+ if (!cli_NetServerEnum(&srv->cli, server, 0x0000FFFE, list_fn,
(void *)smbc_file_table[slot])) {
if (smbc_file_table[slot]) free(smbc_file_table[slot]);