summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-01-14 00:11:29 +0000
committerRichard Sharpe <sharpe@samba.org>2001-01-14 00:11:29 +0000
commit5629b097d4f04ad45c66f270bd58f08d7c717353 (patch)
tree0256893edf68bc1f5263ef3bae53efe4a4d59adb /source
parentb04bd9ea2409ef02737fd570ce80daf167e41067 (diff)
downloadsamba-5629b097d4f04ad45c66f270bd58f08d7c717353.tar.gz
samba-5629b097d4f04ad45c66f270bd58f08d7c717353.tar.xz
samba-5629b097d4f04ad45c66f270bd58f08d7c717353.zip
Fixed bugs relating to Win2K and the need for a codepage so that unicode
strings can be handled correctly.
Diffstat (limited to 'source')
-rw-r--r--source/client/tree.c42
-rw-r--r--source/libsmb/libsmbclient.c15
2 files changed, 37 insertions, 20 deletions
diff --git a/source/client/tree.c b/source/client/tree.c
index 872ec0f1ab8..eb95511934a 100644
--- a/source/client/tree.c
+++ b/source/client/tree.c
@@ -348,28 +348,36 @@ static void cb_select_child (GtkWidget *root_tree, GtkWidget *child,
if (smbc_stat(path1, &st1) < 0) {
- g_print("cb_select_child: Could not stat file %s, %s\n", path1,
- strerror(errno));
+ if (errno != EBUSY) {
+
+ g_print("cb_select_child: Could not stat file %s, %s\n", path1,
+ strerror(errno));
- gtk_main_quit();
+ gtk_main_quit();
- return;
+ return;
- }
-
- /* Now format each of the relevant things ... */
+ }
+ else {
- snprintf(col2, sizeof(col2), "%s%s%s%s%s%s(%0X)",
- (st1.st_mode&0x20?"A":""),
- (st1.st_mode&0x10?"D":""),
- (st1.st_mode&0x08?"V":""),
- (st1.st_mode&0x04?"S":""),
- (st1.st_mode&0x02?"H":""),
- (st1.st_mode&0x01?"R":""),
- st1.st_mode);
- snprintf(col3, sizeof(col3), "%u", st1.st_size);
- snprintf(col4, sizeof(col4), "%s", ctime(&st1.st_ctime));
+ strncpy(col2, "Device or resource busy", sizeof(col2));
+ }
+ }
+ else {
+ /* Now format each of the relevant things ... */
+
+ snprintf(col2, sizeof(col2), "%s%s%s%s%s%s(%0X)",
+ (st1.st_mode&0x20?"A":""),
+ (st1.st_mode&0x10?"D":""),
+ (st1.st_mode&0x08?"V":""),
+ (st1.st_mode&0x04?"S":""),
+ (st1.st_mode&0x02?"H":""),
+ (st1.st_mode&0x01?"R":""),
+ st1.st_mode);
+ snprintf(col3, sizeof(col3), "%u", st1.st_size);
+ snprintf(col4, sizeof(col4), "%s", ctime(&st1.st_ctime));
+ }
}
break;
diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c
index de0653588cd..f51ae422809 100644
--- a/source/libsmb/libsmbclient.c
+++ b/source/libsmb/libsmbclient.c
@@ -502,6 +502,8 @@ int smbc_init(smbc_get_auth_data_fn fn, const char *wgroup, int debug)
}
+ codepage_initialise(lp_client_code_page()); /* Get a codepage */
+
reopen_logs(); /* Get logging working ... */
/*
@@ -1391,6 +1393,8 @@ int smbc_opendir(const char *fname)
struct smbc_server *srv = NULL;
struct in_addr rem_ip;
int slot = 0;
+ uint8 eclass;
+ uint32 ecode;
if (!smbc_initialized) {
@@ -1444,7 +1448,9 @@ int smbc_opendir(const char *fname)
smbc_file_table[slot]->srv = NULL;
smbc_file_table[slot]->offset = 0;
smbc_file_table[slot]->file = False;
- smbc_file_table[slot]->dir_list = NULL;
+ smbc_file_table[slot]->dir_list =
+ smbc_file_table[slot]->dir_next =
+ smbc_file_table[slot]->dir_end = NULL;
if (server[0] == (char)0) {
@@ -1487,6 +1493,7 @@ int smbc_opendir(const char *fname)
if (smbc_file_table[slot]) free(smbc_file_table[slot]);
smbc_file_table[slot] = NULL;
+ errno = cli_error(&srv->cli, &eclass, &ecode, NULL);
return -1;
}
@@ -1540,6 +1547,7 @@ int smbc_opendir(const char *fname)
if (smbc_file_table[slot]) free(smbc_file_table[slot]);
smbc_file_table[slot] = NULL;
+ errno = cli_error(&srv->cli, &eclass, &ecode, NULL);
return -1;
}
@@ -1567,9 +1575,10 @@ int smbc_opendir(const char *fname)
/* Now, list the servers ... */
- if (!cli_RNetShareEnum(&srv->cli, list_fn,
- (void *)smbc_file_table[slot])) {
+ if (cli_RNetShareEnum(&srv->cli, list_fn,
+ (void *)smbc_file_table[slot]) < 0) {
+ errno = cli_error(&srv->cli, &eclass, &ecode, NULL);
if (smbc_file_table[slot]) free(smbc_file_table[slot]);
smbc_file_table[slot] = NULL;
return -1;