1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-18 08:23:51 +03:00

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 6dbdb0d813)
This commit is contained in:
Tim Potter
2001-08-10 06:00:33 +00:00
parent 4bbd1ddb27
commit 2ccfea3de7
13 changed files with 284 additions and 183 deletions

View File

@@ -187,8 +187,7 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24)
#endif
}
BOOL make_oem_passwd_hash(const char *passwd, uchar old_pw_hash[16],
BOOL unicode, char data[516])
BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode)
{
int new_pw_len = strlen(passwd) * (unicode ? 2 : 1);