diff options
author | Richard Sharpe <sharpe@samba.org> | 2001-01-14 00:11:29 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2001-01-14 00:11:29 +0000 |
commit | 552d6bce08fdf98c50c3dbc7b873a49bd72baac5 (patch) | |
tree | e7280a572273f6070db1503ef172b52d34c11606 /source3/libsmb | |
parent | 93261949f5f1f96c513d4651117ee0c462a46e63 (diff) | |
download | samba-552d6bce08fdf98c50c3dbc7b873a49bd72baac5.tar.gz samba-552d6bce08fdf98c50c3dbc7b873a49bd72baac5.tar.bz2 samba-552d6bce08fdf98c50c3dbc7b873a49bd72baac5.zip |
Fixed bugs relating to Win2K and the need for a codepage so that unicode
strings can be handled correctly.
(This used to be commit 5629b097d4f04ad45c66f270bd58f08d7c717353)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/libsmbclient.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index de0653588c..f51ae42280 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/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; |