1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
Stefan Metzmacher
a5f35ed5cf s3:winbindd: avoid invalid pointer type warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:45 +01:00
Andrew Bartlett
91d6f603b1 s3-winbindd: Pass the whole winbindd_domain to invalidate_cm_connection()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-08 01:09:50 +02:00
Günther Deschner
1839417bcc s3-winbindd: use wcache_query_user_fullname after inspecting samlogon cache.
The reason for this followup query is that very often the samlogon cache only
contains a info3 netlogon user structure that has been retrieved during a
netlogon samlogon authentication using "network" logon level. With that logon
level only a few info3 fields are filled in; the user's fullname is never filled
in that case. This is problematic when the cache is used to fill in the user's
gecos field (for NSS queries). When we have retrieved the user's fullname during
other queries, reuse it from the other caches.

Thanks to Matt Rogers <mrogers@redhat.com>.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440

Guenther

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-07-15 16:00:40 +02:00
Andrew Bartlett
af7f88721a winbindd: Use a remote RPC server when we are an RODC when needed
This allows us to operate against the local cache where possible, but
to forward some operations to the read-write DC.

Andrew Bartlett

Change-Id: Idc78ae379a402969381758919fcede17568f094e
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-07-04 02:52:35 +02:00
Jeremy Allison
f799f63e43 CVE-2013-4408:s3:Ensure LookupRids() replies arrays are range checked.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon Dec  9 09:00:41 CET 2013 on sn-devel-104
2013-12-09 09:00:41 +01:00
Jeremy Allison
0de6282e00 Fix bug #10187 - Missing talloc_free can leak stackframe in error path.
Fix error path.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Oct  9 03:50:56 CEST 2013 on sn-devel-104
2013-10-09 03:50:56 +02:00
Günther Deschner
7a49c96693 s3-winbindd: rework reconnect logic in winbindd_lookup_names().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-30 11:49:53 +01:00
Günther Deschner
cd51774316 s3-winbindd: rework reconnect logic in winbindd_lookup_sids().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-30 11:49:50 +01:00
Günther Deschner
82ace10492 s3-winbindd: remove lookup_sids_fn_t.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-30 11:49:47 +01:00
Günther Deschner
d9243815b4 s3-winbindd: remove lookup_names_fn_t.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-30 11:49:44 +01:00
David Disseldorp
9195792a38 Revert "s3-winbindd: make sure we obey the -n switch also for samlogon cache access."
This reverts commit ae6a779bf9.

Bug 9125 analysis from Volker:

The problem is that there are no network calls possible at all that
would do what the samlogon cache does for us. There is just no way to
retrieve the group membership in a complex trusted environment. If you
have just a single domain with Samba as domain controller it might be
possible, but even within a single domain it is not possible to
correctly retrieve all group memberships using LDAP calls due to ACLs on
directory objects. The call to get that is called NetSamLogon on the
NETLOGON pipe. But this call requires user credentials and might trigger
updating counts on the server. So to correctly implement wbinfo -r after
a user has logged in, you have two alternatives: Save the info3 struct
or the PAC in the netsamlogon cache. If you insist on doing network
calls, you need to cache the user credentials somewhere to re-do the
NetSamLogon call every time the wbinfo -r is requested.

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-09 16:41:05 +01:00
Günther Deschner
8a4c8e3f85 s3-smbldap: move ldap_open_with_timeout out of smb_ldap.h to ads where it lives.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Nov 17 03:47:53 CET 2011 on sn-devel-104
2011-11-17 03:47:53 +01:00
Günther Deschner
21691b38bc s3-winbindd: no need to globally include ldap headers in winbindd.
Guenther
2011-11-17 02:11:46 +01:00
Volker Lendecke
12f0624a85 s3: Fix a typo 2011-09-08 13:38:27 +02:00
Volker Lendecke
fd65e5eb8c s3: Make winbindd_lookup_names static
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Sep  6 20:03:56 CEST 2011 on sn-devel-104
2011-09-06 20:03:56 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Günther Deschner
ae6a779bf9 s3-winbindd: make sure we obey the -n switch also for samlogon cache access.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jun  8 14:44:31 CEST 2011 on sn-devel-104
2011-06-08 14:44:31 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Andrew Bartlett
a427652010 s3-libads: Use ldap_init_fd() to connect to AD server in socket_wrapper
This means that we control the connection setup, don't rely on signals
for timeouts and the connection uses socket_wrapper where that is
required in our test environment.

According to bug reports, this method is also used by curl and other
tools, so we are not the first to (ab)use the OpenLDAP libs in this
way.

It is ONLY enabled for socket_wrapper at this time, as this is the
best way to get 'make test' working for S3 winbind tests in an S4
domain.

Andrew Bartlett
2011-04-28 05:30:21 +02:00
Stefan Metzmacher
f7bc84409a s3:rpc_client: map fault codes to NTSTATUS with dcerpc_fault_to_nt_status()
Most fault codes have a NTSTATUS representation, so use that.

This brings the fault handling in common with the source4/librpc/rpc code,
which make it possible to share more highlevel code, between source3 and
source4 as the error checking can be the same now.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Apr 24 10:44:53 CEST 2011 on sn-devel-104
2011-04-24 10:44:53 +02:00
Stefan Metzmacher
e7cf7204e6 s3:winbindd: let winbindd_lookup_names() use dcerpc_binding_handle functions
metze
2011-04-24 09:53:54 +02:00
Stefan Metzmacher
7309daa532 s3:winbindd: let winbindd_lookup_sids() dcerpc_binding_handle functions
metze
2011-04-24 09:53:52 +02:00
Andreas Schneider
d9ad60f0dc s3-winbindd: Use the correct enums for samr_QueryDomainInfo. 2011-03-31 17:20:25 +02:00
Volker Lendecke
0764e72051 s3: Fix Coverity ID 2237: REVERSE_INULL 2011-03-30 09:58:33 +02:00
Günther Deschner
cc94bcb952 s3-winbindd: copy acct_info to wb_acct_info so we dont need passdb for it.
Guenther
2011-03-30 01:13:08 +02:00
Andreas Schneider
bf18403c81 s3-rpc_client: Move client pipe functions to own header. 2011-02-28 18:15:04 +01:00
Stefan Metzmacher
255f2e0699 s3:winbindd: catch lookup_names/sids schannel errors over ncacn_ip_tcp (bug #7944)
If winbindd connects to a domain controller it doesn't establish the lsa
connection over ncacn_ip_tcp direct. This happens only on demand.

If someone does a 'net rpc testjoin' and then a
wbinfo -n DOMAIN\\administrator, we'll get DCERPC faults with
ACCESS_DENIED/SEC_PKG_ERROR, because winbindd's in memory copy
of the schannel session key is invalidated.

This problem can also happen on other calls, but the
lookup_names/sids calls on thet lsa ncacn_ip_tcp connection
are the most important ones.

The long term fix is to store the schannel client state in a
tdb, but for now it's enough to catch the error and invalidate
the all connections to the dc and reestablish the schannel
session key.

The fix for bug 7568 (commit be396411a4)
made this worse, as it assumes winbindd's in memory session key is
always the current one.

metze
2011-02-02 15:45:19 +01:00
Günther Deschner
e026685b7c s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_msrpc.c.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Feb  2 14:14:43 CET 2011 on sn-devel-104
2011-02-02 14:14:43 +01:00
Günther Deschner
49969e6aeb s3-winbind: no need to include ../librpc/gen_ndr/cli_lsa.h in
winbindd/winbindd_msrpc.c.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jan 19 00:37:46 CET 2011 on sn-devel-104
2011-01-19 00:37:46 +01:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Günther Deschner
b7683a2c9d samr: for correctness, rename samr_RidTypeArray to samr_RidAttrArray.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Oct  7 12:04:32 UTC 2010 on sn-devel-104
2010-10-07 12:04:32 +00:00
Volker Lendecke
1d90227c3c s3: Remove a pointless if-statement 2010-09-21 11:09:46 -07:00
Andreas Schneider
57ebc8af80 s3-winbind: Set status before we leave in some msrpc functions. 2010-07-13 19:17:41 +02:00
Andreas Schneider
66fc77e886 s3-winbind: Use same format for all msrpc debug messages. 2010-07-06 18:38:14 +02:00
Andreas Schneider
3323e88f74 s3-winbind: Rename lookup_groupmem to msrpc_lookup_groupmem. 2010-07-05 15:59:15 +02:00
Andreas Schneider
973ef399e3 s3-winbind: Use rpc_trusted_domains in msrpc. 2010-07-05 15:59:15 +02:00
Andreas Schneider
49dc713957 s3-winbind: Use rpc_sequence_number in msrpc. 2010-07-05 15:59:14 +02:00
Andreas Schneider
1f2fe8dee9 s3-winbind: Use rpc_lookup_useraliases in msrpc. 2010-07-05 15:59:13 +02:00
Andreas Schneider
ad8c912563 s3-winbind: Use rpc_lookup_usergroups in msrpc. 2010-07-05 15:59:12 +02:00
Andreas Schneider
64f1052c7f s3-winbind: Use rpc_query_user in msrpc. 2010-07-05 15:59:12 +02:00
Andreas Schneider
44c6432d64 s3-winbind: Use rpc_enum_local_groups in msrpc. 2010-07-05 15:59:10 +02:00
Andreas Schneider
e44d7e1582 s3-winbind: Use rpc_query_user_list in msrpc. 2010-07-05 15:59:09 +02:00
Andreas Schneider
11610a4e99 s3-winbind: Use rpc_enum_dom_groups in msrpc. 2010-07-05 15:59:09 +02:00
Andreas Schneider
692cc06f0c s3-winbind: Rename winbindd_rpc.c to winbindd_msrpc.c. 2010-07-05 15:59:08 +02:00