1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-18 19:17:08 +03:00

212 Commits

Author SHA1 Message Date
Michael Adam
a5a51ca8e5 winbind: correctly omit check for trusted domain support in cm_prepare_connection
when checking for a trusted domain situation.
This is how it was meant to be:

Otherwise, with a dc-trusted-domain situation but trusted domains disabled,
we would attempt to do a session setup and fail (wouldn't even get a trust
password).

Michael
2008-05-26 16:42:25 +02:00
Volker Lendecke
3b1dae7c31 Fix two c++ warnings 2008-05-25 13:53:45 +02:00
Gerald W. Carter
b78b14c88e Manually merge Steven Danneman's patch for SPNEGO auth to a trusted
Win2008 domain (merged from v3-0-test).

   commit 8dc4e979776aae0ecaa74b51dc1eac78a7631405
   Author: Steven Danneman <sdanneman@isilon.com>
   Date:   Wed May 7 13:34:26 2008 -0700

      spnego SPN fix when contacting trusted domains

      cli_session_setup_spnego() was not taking into consideration the situation
      where we're connecting to a trusted domain, specifically one (like W2K8)
      which doesn't return a SPN in the NegTokenInit.

      This caused two problems:

      1) When guessing the SPN using kerberos_get_default_realm_from_ccache() we
      were always using our default realm, not the realm of the domain we're
      connecting to.

      2) When falling back on NTLMSSP for authentication we were passing the name
      of the domain we're connecting to for use in our credentials when we should be
      passing our own workgroup name.

      The fix for both was to split the single "domain" parameter into
      "user_domain" and "dest_realm" parameters.  We use the "user_domain"
      parameter to pass into the NTLM call, and we used "dest_realm" to create an SPN
      if none was returned in the NegTokenInit2 packet.  If no "dest_realm" is
      provided we assume we're connecting to our own domain and use the credentials
      cache to build the SPN.

      Since we have a reasonable guess at the SPN, I removed the check that defaults
      us directly to NTLM when negHint is empty.
2008-05-23 16:01:45 -05:00
Gerald W. Carter
69b37ae607 Manually port Steven Dannenman fix for using the correct machine domain when
looking up trust credentials in our tdb.

   commit fd0ae47046d37ec8297396a2733209c4d999ea91
   Author: Steven Danneman <sdanneman@isilon.com>
   Date:   Thu May 8 13:34:49 2008 -0700

      Use machine account and machine password from our domain when
      contacting trusted domains.
2008-05-23 15:19:58 -05:00
Jeremy Allison
0bc18967aa Get rid of "shadowed local var" warnings with gcc.
Jeremy.
2008-05-22 14:19:14 -07:00
Steven Danneman
037b9689d9 Make WINBINDD_LIST_GROUPS handler asynchronous.
Previously WINBINDD_LIST_GROUPS requests (ex: wbinfo -g) were handled by the
winbindd parent process in a sequential fashion.  This patch, delegates the work
to the winbindd children so that the request is handled much faster in large
domain topologies, and doesn't block the parent from receiving new requests.

The core group enumeration and conversion that was handled in
winbindd_list_groups() has been moved into winbindd_dual_list_groups() to be
done by the child.

The parent winbindd_list_groups() simply calls each of the children
asynchronously.

listgroups_recv() aggregates the final group list that will be returned to the
client and tracks how many of the children have returned their lists.

The domain name of the child is passed back through the callbacks to be used in
debugging messages.

There are also several fixes to typos in various comments.
2008-05-22 13:55:57 -05:00
Michael Adam
467b8f0f4d winbindd: freeze winbindd_proto.h
Michael
2008-05-18 23:09:34 +02:00
Jeremy Allison
8d701a142b Fix bug #5464. Pointed out by Herb @ Connectathon. In fork_domain_child() we call :
CatchChild();

*before* we fork the domain child. This call establishes a signal handler that
eats SIGCLD signals and doesn't call sys_select_signal() as the main daemon
SIGCLD handler should do. This causes the parent to ignore dead children and
time out, instead of calling winbind_child_died() on receipt of the signal. The
correct fix is to move the CatchChild call into the child code after the fork.

Jeremy.
2008-05-14 14:10:39 -07:00
Jim McDonough
0f7b11acce Enable winbind child processes to do something with signals,
in particular closing and reopening logs on SIGHUP.

Conflicts:

	source/winbindd/winbindd.c
2008-05-13 16:57:01 -04:00
coffeedude
31614cd5e0 libwbclient: Abstract the DS_XXX flags for DsGetDcName().
The wbcLookupDomainController() call supports a set of flags
defined in wbclient.h.  Add a mapping function between these
flags and the original DS_XXX flags in order to prevent having
to include the generated RPC headers in wbclient.h.
2008-05-13 12:58:52 -05:00
Günther Deschner
7889516a38 dsgetdcname: use existing messaging_context if possible.
Guenther
2008-05-09 14:59:20 +02:00
Günther Deschner
82cbb3269b Use strip_hostname after dsgetdcname/getdcname calls.
Guenther
2008-05-09 14:59:19 +02:00
Günther Deschner
fe904ee77a dsgetdcname: mailslot replies are identical to the cldap ones, use cldap everywhere.
Guenther
2008-05-09 14:59:19 +02:00
Günther Deschner
b261f06312 mailslot/cldap: use nt_version bits in queries.
Guenther
2008-05-06 09:41:41 +02:00
Gerald W. Carter
b379b5b5d8 Winbind: Prevent cycle in children list when reaping dead child processes.
Thanks to Glenn Curtis and Kyle Stemen @ Likewise.  Their explanation is:

    In winbindd_dual.c, there is a list of children processes that
    is maintained using macros DTLIST_ADD and DTLIST_REMOVE. In the
    case when a scheduled_async_request fails, the particular child
    was located in the list, and its attributes were cleared out
    and it was reused for a subsequent async request. The bug was that
    the new request would queue the same node into the doubly-linked
    list and would result in list->next pointing to the same node as
    list itself. This would set up an infinite loop in the processing of
    the for loop when the list of children was referenced.

    Solution was to fully remove the child node from the list, such that
    it could be inserted without risk of being inserted twice.

Note that the child is re-added to the list in fork_domain_child() again.
2008-04-30 10:09:43 -05:00
Günther Deschner
2b178dcae6 mailslot: allow to give back struct nbt_ntlogon_packet.
Guenther
2008-04-24 22:01:52 +02:00
Günther Deschner
ce3728191b mailslot: allow to define nt_version in send_getdc_request().
Guenther
2008-04-24 22:01:51 +02:00
Volker Lendecke
4f4781c6d1 Fix CLEAR_IF_FIRST handling of messages.tdb
We now open messages.tdb even before we do the become_daemon. become_daemon()
involves a fork and an immediate exit of the parent, thus the
parent_is_longlived argument must be set to false in this case. The parent is
not really long lived :-)
2008-04-23 22:18:26 +02:00
Gerald W. Carter
59cfba2c3d Mark a domain offline in the wbcDomainInfo structure using the domain_flags.
Use the existing domain_flags fiueld in wbcDomainInfo to set a bit if the
domain is marked as offline by Winbind.
2008-04-23 08:47:50 -05:00
Michael Adam
e489f3d988 winbindd_cache: simplify logic in new key length check for UA keys.
This reduces indentation by combining common code paths,
and wraps long lines.

Holger: sorry, I could not resist. I think it is much easier to
understand what is going on when we only have one check and
determine the max allowed key length in advance.

Michael
2008-04-23 14:55:51 +02:00
Holger Hetterich
fcd35232e1 winbindd_cache: recognize and allow longer UA keys
UA keys consist of a potientally large number of concatenated SID strings which
can grow much larger than 1024 bytes in complex environments. We catch those keys
and allow them exclusivly to be larger.
2008-04-23 13:57:14 +02:00
Volker Lendecke
5df75578ef Fix wbinfo --group-info if the winbind separator set to non \
In getgrsid_lookupsid_recv() we use parse_domain_user which itself looks at
lp_winbind_separator(). Thus when building up that group name we should better
use it as well.
2008-04-22 15:42:09 +02:00
Günther Deschner
538eefe22a cldap: avoid duplicate definitions so remove ads_cldap.h.
Guenther
2008-04-21 20:21:40 +02:00
Günther Deschner
675bf42cff winbind: pass down existing talloc context.
Guenther
2008-04-21 20:21:39 +02:00
Andrew Bartlett
87232351b5 Add in a nice big comment explaining why SamLogonEx matters.
Andrew Bartlett
2008-04-21 17:48:31 +02:00
Günther Deschner
2d6a1c5da6 winbind: Use libnbt for NTLOGON SAMLOGON mailslot request and reply.
Guenther
2008-04-21 11:03:32 +02:00
Volker Lendecke
99fc3283c4 Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct 2008-04-20 14:08:16 +02:00
Volker Lendecke
2e4c1ba389 Introduce rpccli_set_timeout()
Reduce dependency on "cli" member of rpc_pipe_client struct
2008-04-20 00:14:26 +02:00
Volker Lendecke
783afab9c8 Add "desthost" to rpc_pipe_client
This reduces the dependency on cli_state
2008-04-20 00:13:09 +02:00
Stefan Metzmacher
2e1b913063 winbindd: create the messaging conntext earlier
metze
2008-04-18 15:00:20 +02:00
Stefan Metzmacher
8e9fdef792 winbindd: call reinit_after_fork() in the child processes
metze
2008-04-18 15:00:20 +02:00
Günther Deschner
b003ba65e3 Move GETDC mailslot out of winbindd.
Guenther
2008-04-17 15:17:29 +02:00
Stefan Metzmacher
64450cc1e4 dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
metze
2008-04-12 09:14:10 +02:00
Michael Adam
641b5e3fec winbindd: only call winbindd_validate_cache when not in offline logon mode.
originally, the cache was cleared before calling validate, but
this way, we skipt the validation of the database when not in
offline logon mode.

This is put into a new wrapper function winbindd_cache_validate_and_initialize()
which is now called in winbindd.c instead calling validate and
initialize functions separately.

Michael
2008-04-10 13:23:30 +02:00
Volker Lendecke
79bc6796b8 Also accept 0x15 getdc replies
My NT4SP6 which my DC here trusts sends 0x15 instead of 0x13, from looking at
the sniff at least the DC name is at the same place.
2008-04-10 11:53:43 +02:00
Volker Lendecke
99f6b63f3c Try anonymous session setup
... if there's no trust password

Attempt to fix bug 5350
2008-04-09 10:01:53 +02:00
Michael Adam
c1b60cdecf winbindd: fix break out early condition in fill_grent_mem().
if (!&new_glist) would always be skipped, if (new_glist == NULL) is
what must have been meant...

Michael
2008-04-07 16:38:14 +02:00
Bo Yang
8671f9767d Only cache password policy results that worked, otherwise we
cannot login until the cache expires even if a connection
to a DC has been restored.
2008-04-07 09:51:42 -04:00
Günther Deschner
65b4cb20ea Use sid_array_from_info3 in lookup_usergroups_cached().
Guenther
2008-04-04 02:53:40 +02:00
Simo Sorce
f6069126e5 Fix trusted users on a DC that uses the old idmap syntax. There was no default backend therefore on IDs were mapped by default. 2008-04-03 00:26:35 +02:00
Günther Deschner
0970369ca0 Fix NETLOGON credential chain with Windows 2008 all over the place.
In order to avoid receiving NT_STATUS_DOWNGRADE_DETECTED from a w2k8
netr_ServerAuthenticate2 reply, we need to start with the AD netlogon negotiate
flags everywhere (not only when running in security=ads). Only for NT4 we need
to do a downgrade to the returned negotiate flags.

Tested with w2k8, w2ksp4, w2k3r2 and nt4sp6.

Guenther
2008-04-02 11:12:47 +02:00
Gerald W. Carter
3414eac439 Fix enumeration of forest trusts from our root domain.
Do not overwrite the domain->domain_flags when setting infomation
in set_dc_type_and_flags_connect().
2008-03-31 13:40:58 -05:00
Steven Danneman
e7827bb6af Augmented "wbinfo -m" to list additional information about the type, direction, and transitivty of trusts.
* added several helper functions to convert the trust_flags field in the
winbindd_tdc_domain to more useful administrator ideas of trust type, trust
direction, and trust transitivity.

* converted winbindd_list_trusted_domains() to enumerate the trusted domain
cache, instead of the domain list, and return additional trust information to
the calling process

* modified wbinfo to pretty print this additional trust information when a new
--verbose switch is given with -m.  Thus "wbinfo -m" and "wbinfo -all-domains"
output as before, but "wbinfo --verbose -m" prints extra trust info.

* updated some comments and fixed typos
2008-03-31 13:40:58 -05:00
Steven Danneman
6aac972d79 Forest root trust flags won't overwrite child trust flags
* changed the behavior of winbind_ads.c:trusted_domains() to not overwrite
existing trust information if we're joined to a child domain, and querying the
forest root domain.  Previously if we were joined to a child domain, we'd
request all known trust information from this child domain (our primary domain)
and store it in the tdc.  We'd then request all trust information from our tree
root (to get the forests we transitively trust) and overwrite the existing trust
information we already had from the perspective of the tree root.

* updated several comments and fixed typos
2008-03-31 13:40:58 -05:00
Michael Adam
6d3fc63bfa winbindd_cache: add missing validation function for pwinfo cache entry
Michael
2008-03-29 02:10:41 +01:00
Günther Deschner
6a576cfe9b Don't let winbind getgroups crash when we have no gids in the token.
Guenther
2008-03-29 00:47:42 +01:00
Volker Lendecke
e04fc36f22 Make some fns static 2008-03-28 13:44:30 +01:00
Günther Deschner
fed6443729 Fix typo.
Guenther
2008-03-27 18:05:02 +01:00
Gerald W. Carter
4de4949e3b Don't fill password policy structure for any domain other than our own.
The samr connects will fail.  This is not independent of the CONTACT_TRUSTDOM
flag neede by krb5 logins.
2008-03-27 11:56:29 -05:00
Volker Lendecke
0d617f639a Fix wbinfo -a trusted\\user%password on a Samba DC with trusts
Winbind can't be allowed to connect to the local smbd.
2008-03-27 13:11:10 +01:00