The branch, master has been updated via 948e010 s3-libsmb/passchange.c: remove some cli_nt_error() calls via aef5fcb s3-winbindd/winbindd_cm.c: remove cli_nt_error() via 6003deb s3-libsmb/clidfs.c: remove cli_nt_error() via c64ebcf s3:winbindd_cm: remove unused ads_status via 773abaa s3-torture: remove all cli_nt_error() calls in torture via 9430fbf s3-torture: replace cli_errstr() with nt_errstr() via e4934a1 s3-libsmb: introduce option to disable dos error mapping from af1a2ee s3:smbd: calculate the negprot signing flags from the signing_state
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 948e010f20b537f66baf20bb77e9095d88adcbb9 Author: Björn Baumbach <b...@sernet.de> Date: Wed Nov 16 16:57:25 2011 +0100 s3-libsmb/passchange.c: remove some cli_nt_error() calls Signed-off-by: Stefan Metzmacher <me...@samba.org> Autobuild-User: Stefan Metzmacher <me...@samba.org> Autobuild-Date: Wed Nov 16 20:36:11 CET 2011 on sn-devel-104 commit aef5fcbfc74ab1e078d7133169215aeef1fab30e Author: Björn Baumbach <b...@sernet.de> Date: Wed Nov 16 16:52:38 2011 +0100 s3-winbindd/winbindd_cm.c: remove cli_nt_error() Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 6003debf7e0df7b61df03d2b55551715180329c4 Author: Björn Baumbach <b...@sernet.de> Date: Wed Nov 16 16:37:24 2011 +0100 s3-libsmb/clidfs.c: remove cli_nt_error() Signed-off-by: Stefan Metzmacher <me...@samba.org> commit c64ebcf64322f6b98e0e17076da8d63f6f79c114 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Nov 16 16:48:37 2011 +0100 s3:winbindd_cm: remove unused ads_status metze commit 773abaa2ef9521250cc51657c2ce15ce99850890 Author: Björn Baumbach <b...@sernet.de> Date: Wed Nov 16 16:21:13 2011 +0100 s3-torture: remove all cli_nt_error() calls in torture Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 9430fbf9225c60976c27cf3e3f7d1fdae88ebfb0 Author: Björn Baumbach <b...@sernet.de> Date: Wed Nov 16 15:03:49 2011 +0100 s3-torture: replace cli_errstr() with nt_errstr() Signed-off-by: Stefan Metzmacher <me...@samba.org> commit e4934a1e427ec01576beb4fe21d2775b75adeb0b Author: Björn Baumbach <b...@sernet.de> Date: Wed Nov 16 14:45:01 2011 +0100 s3-libsmb: introduce option to disable dos error mapping Signed-off-by: Stefan Metzmacher <me...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/include/client.h | 1 + source3/libsmb/async_smb.c | 3 ++- source3/libsmb/clidfs.c | 4 ++-- source3/libsmb/clientgen.c | 1 + source3/libsmb/passchange.c | 2 -- source3/torture/torture.c | 39 +++++++++++++++++++++------------------ source3/winbindd/winbindd_cm.c | 13 ++----------- 7 files changed, 29 insertions(+), 34 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/client.h b/source3/include/client.h index 65da738..293138d 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -44,6 +44,7 @@ struct cli_state { struct cli_state *prev, *next; int rap_error; NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */ + bool map_dos_errors; /* The credentials used to open the cli_state connection. */ char *domain; diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 08b6c35..574ca3b 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -897,7 +897,8 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, } state->cli->raw_status = cli_pull_raw_error(state->inbuf); - if (NT_STATUS_IS_DOS(state->cli->raw_status)) { + if (NT_STATUS_IS_DOS(state->cli->raw_status) && + state->cli->map_dos_errors) { uint8_t eclass = NT_STATUS_DOS_CLASS(state->cli->raw_status); uint16_t ecode = NT_STATUS_DOS_CODE(state->cli->raw_status); /* diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index b066b8b..4d0e97a 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -173,8 +173,8 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx, lp_workgroup()))) { d_printf("session setup failed: %s\n", nt_errstr(status)); - if (NT_STATUS_V(cli_nt_error(c)) == - NT_STATUS_V(NT_STATUS_MORE_PROCESSING_REQUIRED)) + if (NT_STATUS_EQUAL(status, + NT_STATUS_MORE_PROCESSING_REQUIRED)) d_printf("did you forget to run kinit?\n"); cli_shutdown(c); return status; diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index bc544af..215ad3f 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -208,6 +208,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, goto error; } cli->raw_status = NT_STATUS_INTERNAL_ERROR; + cli->map_dos_errors = true; /* remove this */ cli->timeout = 20000; /* Timeout is in milliseconds. */ cli->case_sensitive = false; diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index b959bcd..83fd9eb 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -74,7 +74,6 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } - result = cli_nt_error(cli); cli_shutdown(cli); return result; } @@ -189,7 +188,6 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } - result = cli_nt_error(cli); cli_shutdown(cli); return result; } diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 4a5f790..20ee6bc 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -1553,8 +1553,7 @@ static bool tcon_devtest(struct cli_state *cli, myshare, devtype); ret = False; } else { - if (NT_STATUS_EQUAL(cli_nt_error(cli), - expected_error)) { + if (NT_STATUS_EQUAL(status, expected_error)) { ret = True; } else { printf("Returned unexpected error\n"); @@ -4348,17 +4347,19 @@ static bool run_deletetest(int dummy) } /* Now try open for delete access. */ - if (NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, FILE_READ_ATTRIBUTES|DELETE_ACCESS, - 0, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - FILE_OVERWRITE_IF, 0, 0, &fnum1))) { + status = cli_ntcreate(cli1, fname, 0, + FILE_READ_ATTRIBUTES|DELETE_ACCESS, + 0, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + FILE_OVERWRITE_IF, 0, 0, &fnum1); + if (NT_STATUS_IS_OK(status)) { printf("[11] open of %s succeeded should have been denied with ACCESS_DENIED!\n", fname); cli_close(cli1, fnum1); goto fail; correct = False; } else { - NTSTATUS nterr = cli_nt_error(cli1); - if (!NT_STATUS_EQUAL(nterr,NT_STATUS_ACCESS_DENIED)) { - printf("[11] open of %s should have been denied with ACCESS_DENIED! Got error %s\n", fname, nt_errstr(nterr)); + if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) { + printf("[11] open of %s should have been denied with ACCESS_DENIED! Got error %s\n", fname, nt_errstr(status)); goto fail; correct = False; } else { @@ -6347,6 +6348,9 @@ static bool run_error_map_extract(int dummy) { return False; } + c_nt->map_dos_errors = false; + c_dos->map_dos_errors = false; + for (error=(0xc0000000 | 0x1); error < (0xc0000000| 0xFFF); error++) { fstr_sprintf(user, "%X", error); @@ -6359,11 +6363,11 @@ static bool run_error_map_extract(int dummy) { } /* Case #1: 32-bit NT errors */ - if (cli_is_nt_error(c_nt)) { - nt_status = cli_nt_error(c_nt); + if (!NT_STATUS_IS_DOS(status)) { + nt_status = status; } else { printf("/** Dos error on NT connection! (%s) */\n", - cli_errstr(c_nt)); + nt_errstr(status)); nt_status = NT_STATUS(0xc0000000); } @@ -6376,12 +6380,13 @@ static bool run_error_map_extract(int dummy) { } /* Case #1: 32-bit NT errors */ - if (!cli_is_dos_error(c_dos)) { + if (NT_STATUS_IS_DOS(status)) { printf("/** NT error on DOS connection! (%s) */\n", - cli_errstr(c_dos)); + nt_errstr(status)); errnum = errclass = 0; } else { - cli_dos_error(c_dos, &errclass, &errnum); + errclass = NT_STATUS_DOS_CLASS(status); + errnum = NT_STATUS_DOS_CODE(status); } if (NT_STATUS_V(nt_status) != error) { @@ -7592,10 +7597,8 @@ static bool run_streamerror(int dummy) return false; } - cli_qpathinfo1(cli, streamname, &change_time, &access_time, &write_time, - &size, &mode); - status = cli_nt_error(cli); - + status = cli_qpathinfo1(cli, streamname, &change_time, &access_time, + &write_time, &size, &mode); if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { printf("pathinfo returned %s, expected " "NT_STATUS_OBJECT_NAME_NOT_FOUND\n", diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index edc6579..7cfcaba 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -832,8 +832,6 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, cli_state_protocol(*cli) >= PROTOCOL_NT1 && cli_state_capabilities(*cli) & CAP_EXTENDED_SECURITY) { - ADS_STATUS ads_status; - result = get_trust_creds(domain, &machine_password, &machine_account, &machine_krb5_principal); @@ -894,7 +892,6 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, nt_errstr(result))); } - result = ads_ntstatus(ads_status); if (NT_STATUS_IS_OK(result)) { /* Ensure creds are stored for NTLMSSP authenticated pipe access. */ result = cli_init_creds(*cli, machine_account, lp_workgroup(), machine_password); @@ -945,8 +942,8 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, "connection for DC %s\n", controller )); - if (NT_STATUS_IS_OK(cli_session_setup(*cli, "", NULL, 0, - NULL, 0, ""))) { + result = cli_session_setup(*cli, "", NULL, 0, NULL, 0, ""); + if (NT_STATUS_IS_OK(result)) { DEBUG(5, ("Connected anonymously\n")); result = cli_init_creds(*cli, "", "", ""); if (!NT_STATUS_IS_OK(result)) { @@ -955,13 +952,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, goto session_setup_done; } - result = cli_nt_error(*cli); - - if (NT_STATUS_IS_OK(result)) - result = NT_STATUS_UNSUCCESSFUL; - /* We can't session setup */ - goto done; session_setup_done: -- Samba Shared Repository