[SCM] Samba Shared Repository - branch v4-15-test updated
Jule Anger
janger at samba.org
Fri Apr 15 14:04:02 UTC 2022
The branch, v4-15-test has been updated
via 4f3c5b21db6 s3:winbind: Remove no longer used domain's private_data pointer
via f9e1cd4e9a6 s3:winbind: Do not use domain's private data to store the ADS_STRUCT
via 29ec750566d s3:winbind: Simplify open_cached_internal_pipe_conn()
via 46f331e2196 s3:winbind: Do not use domain's private data to store the SAMR pipes
via ef96b255edc s3: smbget: Fix auth_fn, order of //server/share parameters is mixed in prompt.
from 799aa4e8892 s3:auth: Fix user_in_list() for UNIX groups
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-15-test
- Log -----------------------------------------------------------------
commit 4f3c5b21db6a83662c3c097e203e66295a7a4fa1
Author: Samuel Cabrero <scabrero at samba.org>
Date: Wed Apr 13 11:34:18 2022 +0200
s3:winbind: Remove no longer used domain's private_data pointer
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046
Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit a6d6ae3cfcd64a85f82ec5b12253ca0e237d95bb)
Autobuild-User(v4-15-test): Jule Anger <janger at samba.org>
Autobuild-Date(v4-15-test): Fri Apr 15 14:03:44 UTC 2022 on sn-devel-184
commit f9e1cd4e9a67ef9e7bd414606d7f4dd31813a2ce
Author: Samuel Cabrero <scabrero at samba.org>
Date: Wed Apr 13 11:31:45 2022 +0200
s3:winbind: Do not use domain's private data to store the ADS_STRUCT
The ADS_STRUCT is not allocated using talloc and there are many places
casting this pointer directly so use a typed pointer.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046
Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit 3cb256439e9ceece26c2de82293c43486543e0cb)
commit 29ec750566d2e7208afff6a97f319553c6431efd
Author: Samuel Cabrero <scabrero at samba.org>
Date: Wed Apr 13 11:15:35 2022 +0200
s3:winbind: Simplify open_cached_internal_pipe_conn()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046
Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit 91395e660a2b1b69bf74ca0b77aee416e2ac1db3)
commit 46f331e219611798cb0e9379d2ec05a84ff15f8a
Author: Samuel Cabrero <scabrero at samba.org>
Date: Wed Apr 13 11:01:00 2022 +0200
s3:winbind: Do not use domain's private data to store the SAMR pipes
The domain's private_data pointer is also used to store a ADS_STRUCT,
which is not allocated using talloc and there are many places casting
this pointer directly.
The recently added samba.tests.pam_winbind_setcred was randomly failing
and after debugging it the problem was that kerberos authentication was
failing because the time_offset passed to kerberos_return_pac() was
wrong. This time_offset was retrieved from ads->auth.time_offset, where
the ads pointer was directly casted from domain->private_data but
private_data was pointing to a winbind_internal_pipes struct.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046
Signed-off-by: Samuel Cabrero <scabrero at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit e1f29b0970f4cac52a9cd517be6862cf69a1433a)
commit ef96b255edcf0f4e398ca6617830c2affcc1642b
Author: Jeremy Allison <jra at samba.org>
Date: Tue Apr 5 13:24:19 2022 -0700
s3: smbget: Fix auth_fn, order of //server/share parameters is mixed in prompt.
Found by <voetelink at nrg.eu>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14831
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
(cherry picked from commit f1765f91b015d64122e74c01c7c6d0984cc7af87)
-----------------------------------------------------------------------
Summary of changes:
source3/utils/smbget.c | 2 +-
source3/winbindd/winbindd.h | 10 +++++++---
source3/winbindd/winbindd_ads.c | 10 +++++-----
source3/winbindd/winbindd_ndr.c | 7 ++++++-
source3/winbindd/winbindd_pam.c | 6 ++----
source3/winbindd/winbindd_samr.c | 22 +++++++---------------
6 files changed, 28 insertions(+), 29 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 19958f35afa..3e7c5687d83 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -129,7 +129,7 @@ static void get_auth_data(const char *srv, const char *shr, char *wg, int wglen,
rc = asprintf(&prompt,
"Password for [%s] connecting to //%s/%s: ",
- un, shr, srv);
+ un, srv, shr);
if (rc == -1) {
return;
}
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index dac4a1fa927..fe286a9a686 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -43,6 +43,9 @@
#define WB_REPLACE_CHAR '_'
+struct winbind_internal_pipes;
+struct ads_struct;
+
struct winbindd_cli_state {
struct winbindd_cli_state *prev, *next; /* Linked list pointers */
int sock; /* Open socket from client */
@@ -153,9 +156,10 @@ struct winbindd_domain {
*/
struct winbindd_methods *backend;
- /* Private data for the backends (used for connection cache) */
-
- void *private_data;
+ struct {
+ struct winbind_internal_pipes *samr_pipes;
+ struct ads_struct *ads_conn;
+ } backend_data;
/* A working DC */
char *dcname;
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 6f01ef6e334..d350f160223 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -269,10 +269,10 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
}
DEBUG(10,("ads_cached_connection\n"));
- ads_cached_connection_reuse((ADS_STRUCT **)&domain->private_data);
+ ads_cached_connection_reuse(&domain->backend_data.ads_conn);
- if (domain->private_data) {
- return (ADS_STRUCT *)domain->private_data;
+ if (domain->backend_data.ads_conn != NULL) {
+ return domain->backend_data.ads_conn;
}
/* the machine acct password might have change - fetch it every time */
@@ -303,7 +303,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
}
status = ads_cached_connection_connect(
- (ADS_STRUCT **)&domain->private_data,
+ &domain->backend_data.ads_conn,
domain->alt_name,
domain->name, NULL,
password, realm,
@@ -322,7 +322,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
return NULL;
}
- return (ADS_STRUCT *)domain->private_data;
+ return domain->backend_data.ads_conn;
}
/* Query display info for a realm. This is the basic user list fn */
diff --git a/source3/winbindd/winbindd_ndr.c b/source3/winbindd/winbindd_ndr.c
index 157ce1bff27..b393586a692 100644
--- a/source3/winbindd/winbindd_ndr.c
+++ b/source3/winbindd/winbindd_ndr.c
@@ -143,7 +143,12 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr,
ndr_print_time_t(ndr, "startup_time", r->startup_time);
ndr_print_bool(ndr, "startup", r->startup);
ndr_print_winbindd_methods(ndr, "backend", r->backend);
- ndr_print_ptr(ndr, "private_data", r->private_data);
+ ndr_print_ptr(ndr,
+ "backend_data.samr_pipes",
+ r->backend_data.samr_pipes);
+ ndr_print_ptr(ndr,
+ "backend_data.ads_conn",
+ r->backend_data.ads_conn);
ndr_print_string(ndr, "dcname", r->dcname);
ndr_print_sockaddr_storage(ndr, "dcaddr", &r->dcaddr);
ndr_print_time_t(ndr, "last_seq_check", r->last_seq_check);
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 1a2628b50ba..5505220335f 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -677,7 +677,6 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
fstring name_namespace, name_domain, name_user;
time_t ticket_lifetime = 0;
time_t renewal_until = 0;
- ADS_STRUCT *ads;
time_t time_offset = 0;
const char *user_ccache_file;
struct PAC_LOGON_INFO *logon_info = NULL;
@@ -716,9 +715,8 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
/* 2nd step:
* get kerberos properties */
- if (domain->private_data) {
- ads = (ADS_STRUCT *)domain->private_data;
- time_offset = ads->auth.time_offset;
+ if (domain->backend_data.ads_conn != NULL) {
+ time_offset = domain->backend_data.ads_conn->auth.time_offset;
}
diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c
index 5e23ff8217b..20b5d758d1a 100644
--- a/source3/winbindd/winbindd_samr.c
+++ b/source3/winbindd/winbindd_samr.c
@@ -128,9 +128,10 @@ static NTSTATUS open_cached_internal_pipe_conn(
struct rpc_pipe_client **lsa_pipe,
struct policy_handle *lsa_hnd)
{
- struct winbind_internal_pipes *internal_pipes = NULL;
+ struct winbind_internal_pipes *internal_pipes =
+ domain->backend_data.samr_pipes;
- if (domain->private_data == NULL) {
+ if (internal_pipes == NULL) {
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -156,15 +157,12 @@ static NTSTATUS open_cached_internal_pipe_conn(
return status;
}
- domain->private_data = talloc_move(domain, &internal_pipes);
+ domain->backend_data.samr_pipes =
+ talloc_steal(domain, internal_pipes);
TALLOC_FREE(frame);
-
}
- internal_pipes = talloc_get_type_abort(
- domain->private_data, struct winbind_internal_pipes);
-
if (samr_domain_hnd) {
*samr_domain_hnd = internal_pipes->samr_domain_hnd;
}
@@ -188,23 +186,17 @@ static bool reset_connection_on_error(struct winbindd_domain *domain,
struct rpc_pipe_client *p,
NTSTATUS status)
{
- struct winbind_internal_pipes *internal_pipes = NULL;
struct dcerpc_binding_handle *b = p->binding_handle;
- internal_pipes = talloc_get_type_abort(
- domain->private_data, struct winbind_internal_pipes);
-
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
NT_STATUS_EQUAL(status, NT_STATUS_IO_DEVICE_ERROR))
{
- TALLOC_FREE(internal_pipes);
- domain->private_data = NULL;
+ TALLOC_FREE(domain->backend_data.samr_pipes);
return true;
}
if (!dcerpc_binding_handle_is_connected(b)) {
- TALLOC_FREE(internal_pipes);
- domain->private_data = NULL;
+ TALLOC_FREE(domain->backend_data.samr_pipes);
return true;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list