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

208 Commits

Author SHA1 Message Date
Jeremy Allison
cfde5c8d47 Get rid of "shadowed local var" warnings with gcc.
Jeremy.
(This used to be commit 0bc18967aa)
2008-05-22 14:19:14 -07:00
Steven Danneman
96653e1ff7 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.
(This used to be commit 037b9689d9)
2008-05-22 13:55:57 -05:00
Michael Adam
03dcad0b27 winbindd: freeze winbindd_proto.h
Michael
(This used to be commit 467b8f0f4d)
2008-05-18 23:09:34 +02:00
Jeremy Allison
5e70a25116 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.
(This used to be commit 8d701a142b)
2008-05-14 14:10:39 -07:00
Jim McDonough
a6b0ea8ee3 Enable winbind child processes to do something with signals,
in particular closing and reopening logs on SIGHUP.

Conflicts:

	source/winbindd/winbindd.c
(This used to be commit 0f7b11acce)
2008-05-13 16:57:01 -04:00
coffeedude
34933a5c23 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.
(This used to be commit 31614cd5e0)
2008-05-13 12:58:52 -05:00
Günther Deschner
67c644aa59 dsgetdcname: use existing messaging_context if possible.
Guenther
(This used to be commit 7889516a38)
2008-05-09 14:59:20 +02:00
Günther Deschner
f11acf3582 Use strip_hostname after dsgetdcname/getdcname calls.
Guenther
(This used to be commit 82cbb3269b)
2008-05-09 14:59:19 +02:00
Günther Deschner
9be17e2187 dsgetdcname: mailslot replies are identical to the cldap ones, use cldap everywhere.
Guenther
(This used to be commit fe904ee77a)
2008-05-09 14:59:19 +02:00
Günther Deschner
1f6065765c mailslot/cldap: use nt_version bits in queries.
Guenther
(This used to be commit b261f06312)
2008-05-06 09:41:41 +02:00
Gerald W. Carter
c413c97ff4 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.
(This used to be commit b379b5b5d8)
2008-04-30 10:09:43 -05:00
Günther Deschner
b77601a4b7 mailslot: allow to give back struct nbt_ntlogon_packet.
Guenther
(This used to be commit 2b178dcae6)
2008-04-24 22:01:52 +02:00
Günther Deschner
e66d452466 mailslot: allow to define nt_version in send_getdc_request().
Guenther
(This used to be commit ce3728191b)
2008-04-24 22:01:51 +02:00
Volker Lendecke
0c4093a234 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 :-)
(This used to be commit 4f4781c6d1)
2008-04-23 22:18:26 +02:00
Gerald W. Carter
de154dcf92 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.
(This used to be commit 59cfba2c3d)
2008-04-23 08:47:50 -05:00
Michael Adam
65c0fd5920 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
(This used to be commit e489f3d988)
2008-04-23 14:55:51 +02:00
Holger Hetterich
7a407d5927 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.
(This used to be commit fcd35232e1)
2008-04-23 13:57:14 +02:00
Volker Lendecke
9ffcc7966f 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.
(This used to be commit 5df75578ef)
2008-04-22 15:42:09 +02:00
Günther Deschner
bcbac69d1a cldap: avoid duplicate definitions so remove ads_cldap.h.
Guenther
(This used to be commit 538eefe22a)
2008-04-21 20:21:40 +02:00
Günther Deschner
1eca3f138c winbind: pass down existing talloc context.
Guenther
(This used to be commit 675bf42cff)
2008-04-21 20:21:39 +02:00
Andrew Bartlett
154f4837b3 Add in a nice big comment explaining why SamLogonEx matters.
Andrew Bartlett
(This used to be commit 87232351b5)
2008-04-21 17:48:31 +02:00
Günther Deschner
937091161b winbind: Use libnbt for NTLOGON SAMLOGON mailslot request and reply.
Guenther
(This used to be commit 2d6a1c5da6)
2008-04-21 11:03:32 +02:00
Volker Lendecke
e73e8297f5 Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
(This used to be commit 99fc3283c4)
2008-04-20 14:08:16 +02:00
Volker Lendecke
e1102b8f48 Introduce rpccli_set_timeout()
Reduce dependency on "cli" member of rpc_pipe_client struct
(This used to be commit 2e4c1ba389)
2008-04-20 00:14:26 +02:00
Volker Lendecke
2a2188591b Add "desthost" to rpc_pipe_client
This reduces the dependency on cli_state
(This used to be commit 783afab9c8)
2008-04-20 00:13:09 +02:00
Stefan Metzmacher
913cd26b2b winbindd: create the messaging conntext earlier
metze
(This used to be commit 2e1b913063)
2008-04-18 15:00:20 +02:00
Stefan Metzmacher
94b603648f winbindd: call reinit_after_fork() in the child processes
metze
(This used to be commit 8e9fdef792)
2008-04-18 15:00:20 +02:00
Günther Deschner
bbded540b6 Move GETDC mailslot out of winbindd.
Guenther
(This used to be commit b003ba65e3)
2008-04-17 15:17:29 +02:00
Stefan Metzmacher
e21b283d67 dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
metze
(This used to be commit 64450cc1e4)
2008-04-12 09:14:10 +02:00
Michael Adam
b884db5c47 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
(This used to be commit 641b5e3fec)
2008-04-10 13:23:30 +02:00
Volker Lendecke
0f37cd0c8e 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.
(This used to be commit 79bc6796b8)
2008-04-10 11:53:43 +02:00
Volker Lendecke
9fa04934e0 Try anonymous session setup
... if there's no trust password

Attempt to fix bug 5350
(This used to be commit 99f6b63f3c)
2008-04-09 10:01:53 +02:00
Michael Adam
bc5f19cb28 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
(This used to be commit c1b60cdecf)
2008-04-07 16:38:14 +02:00
Bo Yang
66dad54c72 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.
(This used to be commit 8671f9767d)
2008-04-07 09:51:42 -04:00
Günther Deschner
bea4541e11 Use sid_array_from_info3 in lookup_usergroups_cached().
Guenther
(This used to be commit 65b4cb20ea)
2008-04-04 02:53:40 +02:00
Simo Sorce
a123abdb91 Fix trusted users on a DC that uses the old idmap syntax. There was no default backend therefore on IDs were mapped by default.
(This used to be commit f6069126e5)
2008-04-03 00:26:35 +02:00
Günther Deschner
99d3590455 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
(This used to be commit 0970369ca0)
2008-04-02 11:12:47 +02:00
Gerald W. Carter
5414a21ba3 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().
(This used to be commit 3414eac439)
2008-03-31 13:40:58 -05:00
Steven Danneman
2b70174e1b 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
(This used to be commit e7827bb6af)
2008-03-31 13:40:58 -05:00
Steven Danneman
223071f01d 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
(This used to be commit 6aac972d79)
2008-03-31 13:40:58 -05:00
Michael Adam
2487f0c88c winbindd_cache: add missing validation function for pwinfo cache entry
Michael
(This used to be commit 6d3fc63bfa)
2008-03-29 02:10:41 +01:00
Günther Deschner
4ce88f719e Don't let winbind getgroups crash when we have no gids in the token.
Guenther
(This used to be commit 6a576cfe9b)
2008-03-29 00:47:42 +01:00
Volker Lendecke
26fead2c6e Make some fns static
(This used to be commit e04fc36f22)
2008-03-28 13:44:30 +01:00
Günther Deschner
1b9c4763ee Fix typo.
Guenther
(This used to be commit fed6443729)
2008-03-27 18:05:02 +01:00
Gerald W. Carter
9c169e9e42 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.
(This used to be commit 4de4949e3b)
2008-03-27 11:56:29 -05:00
Volker Lendecke
2198058624 Fix wbinfo -a trusted\\user%password on a Samba DC with trusts
Winbind can't be allowed to connect to the local smbd.
(This used to be commit 0d617f639a)
2008-03-27 13:11:10 +01:00
Günther Deschner
cba8dcf759 Move LOGON_KRB5_FAIL_CLOCK_SKEW to winbindd_pam.
Guenther
(This used to be commit fa64c76ac8)
2008-03-27 13:06:43 +01:00
Günther Deschner
06772e7f65 Fix winbind NETLOGON cred chain on a samba dc for w2k8 trusts.
Guenther
(This used to be commit 2586dc34e0)
2008-03-26 21:11:53 +01:00
Volker Lendecke
689cd9e101 Fix a segfault
When we get a NT_STATUS_WRONG_PASSWORD for example, my_info3 is not initialized
at all. So first check that we have NT_STATUS_IS_OK(status) before we
dereference my_info3.
(This used to be commit 559cd9e5a7)
2008-03-25 23:36:06 +01:00
Volker Lendecke
04cd5c6bd8 Fix typo
(This used to be commit 38683a7301)
2008-03-25 21:35:41 +01:00