diff options
author | Tim Potter <tpot@samba.org> | 2001-08-10 06:00:33 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-08-10 06:00:33 +0000 |
commit | 2ccfea3de7b2b7dc0be2438c3adb3f7be82a2dfc (patch) | |
tree | 7c6072ae27cf5ed587989c8006ba948eaa0f59c6 /source3/libsmb/clirap.c | |
parent | 4bbd1ddb274438e00f83fffa2051d8f7d6c2b17c (diff) | |
download | samba-2ccfea3de7b2b7dc0be2438c3adb3f7be82a2dfc.tar.gz samba-2ccfea3de7b2b7dc0be2438c3adb3f7be82a2dfc.tar.bz2 samba-2ccfea3de7b2b7dc0be2438c3adb3f7be82a2dfc.zip |
A rewrite of the error handling in the libsmb client code. I've separated
out the error handling into a bunch of separate functions rather than all
being handled in one big function.
Fetch error codes from the last received packet:
void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
uint32 cli_nt_error(struct cli_state *);
Convert errors to UNIX errno values:
int cli_errno_from_dos(uint8 eclass, uint32 num);
int cli_errno_from_nt(uint32 status);
int cli_errno(struct cli_state *cli);
Detect different kinds of errors:
BOOL cli_is_dos_error(struct cli_state *cli);
BOOL cli_is_nt_error(struct cli_state *cli);
BOOL cli_is_error(struct cli_state *cli);
This also means we now support CAP_STATUS32 as we can decode and understand
NT errors instead of just DOS errors. Yay!
Ported a whole bunch of files in libsmb to use this new API instead of the
just the DOS error.
(This used to be commit 6dbdb0d813f3c7ab20b38baa1223b0b479aadec9)
Diffstat (limited to 'source3/libsmb/clirap.c')
-rw-r--r-- | source3/libsmb/clirap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index c649aedfba..bfbe478191 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -329,7 +329,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char clistr_push(cli, dos_new_password, new_password, -1, STR_TERMINATE); - if (!make_oem_passwd_hash(dos_new_password, old_pw_hash, False, data)) + if (!make_oem_passwd_hash( data, dos_new_password, old_pw_hash, False)) return False; /* @@ -408,12 +408,12 @@ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, cli_receive_trans(cli, SMBtrans2, &rparam, ¶m_len, &rdata, &data_len)); - if (!ret) { + if (!ret && cli_is_dos_error(cli)) { /* we need to work around a Win95 bug - sometimes it gives ERRSRV/ERRerror temprarily */ uint8 eclass; uint32 ecode; - cli_error(cli, &eclass, &ecode, NULL); + cli_dos_error(cli, &eclass, &ecode); if (eclass != ERRSRV || ecode != ERRerror) break; msleep(100); } |