1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

A few fixes towards libsmbclient and rpcclient - get pointer types right and

try to keep to functions inside libsmbclient.

Andrew Bartlett
(This used to be commit 340bc31fdb031d79fa87de27c2c46215dd8113a3)
This commit is contained in:
Andrew Bartlett 2002-08-22 00:51:00 +00:00
parent bad6e2dbe2
commit 2749f5e998
2 changed files with 10 additions and 12 deletions

View File

@ -180,14 +180,13 @@ smbc_parse_path(SMBCCTX *context, const char *fname, char *server, char *share,
static int smbc_errno(SMBCCTX *context, struct cli_state *c) static int smbc_errno(SMBCCTX *context, struct cli_state *c)
{ {
int ret; int ret = cli_errno(c);
if (cli_is_dos_error(c)) { if (cli_is_dos_error(c)) {
uint8 eclass; uint8 eclass;
uint32 ecode; uint32 ecode;
cli_dos_error(c, &eclass, &ecode); cli_dos_error(c, &eclass, &ecode);
ret = cli_errno_from_dos(eclass, ecode);
DEBUG(3,("smbc_error %d %d (0x%x) -> %d\n", DEBUG(3,("smbc_error %d %d (0x%x) -> %d\n",
(int)eclass, (int)ecode, (int)ecode, ret)); (int)eclass, (int)ecode, (int)ecode, ret));
@ -195,10 +194,9 @@ static int smbc_errno(SMBCCTX *context, struct cli_state *c)
NTSTATUS status; NTSTATUS status;
status = cli_nt_error(c); status = cli_nt_error(c);
ret = cli_errno_from_nt(status);
DEBUG(3,("smbc errno %s -> %d\n", DEBUG(3,("smbc errno %s -> %d\n",
get_nt_error_msg(status), ret)); nt_errstr(status), ret));
} }
return ret; return ret;

View File

@ -324,15 +324,15 @@ static void sam_account_from_delta(SAM_ACCOUNT *account,
static void apply_account_info(SAM_ACCOUNT_INFO *sam_acct_delta) static void apply_account_info(SAM_ACCOUNT_INFO *sam_acct_delta)
{ {
SAM_ACCOUNT sam_acct; SAM_ACCOUNT *sam_acct;
BOOL result; BOOL result;
ZERO_STRUCT(sam_acct); if (!NT_STATUS_IS_OK(pdb_init_sam(&sam_acct))) {
return;
}
pdb_init_sam(&sam_acct); sam_account_from_delta(sam_acct, sam_acct_delta);
result = pdb_add_sam_account(sam_acct);
sam_account_from_delta(&sam_acct, sam_acct_delta);
result = pdb_add_sam_account(&sam_acct);
} }
/* Apply an array of deltas to the SAM database */ /* Apply an array of deltas to the SAM database */
@ -544,7 +544,7 @@ static void user_callback(poptContext con,
const struct poptOption *opt, const struct poptOption *opt,
const char *arg, const void *data) const char *arg, const void *data)
{ {
char *p, *ch; const char *p, *ch;
if (!arg) if (!arg)
return; return;