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

43 Commits

Author SHA1 Message Date
Volker Lendecke
d05e17f875 s3: Introduce domain_is_forest_root() helper function
Hopefully this makes the flag tests a bit more understandable
2010-01-02 12:09:05 +01:00
Volker Lendecke
b8fcba9cb8 s3: Pass netr_DomainTrustList instead of names and sids through (*trusted_domains) 2009-12-28 15:54:13 +01:00
Volker Lendecke
0aa8946ce0 s3: Simplify winbindd_ads.c:trusted_domains()
No real code change, this just removes an indentation by turning

if ( NT_STATUS_IS_OK(result) && trusts.count) {

into

if (!NT_STATUS_IS_OK(result)) {
        return result;
}
if (trusts.count == 0) {
        return NT_STATUS_OK;
}
2009-12-28 15:28:43 +01:00
Günther Deschner
3d679a3b5f s3-rpc: Avoid including every pipe's client and server stubs everywhere in samba.
Guenther
2009-11-26 20:03:17 +01:00
Günther Deschner
463b1eb2b5 s3-passdb: cleanup some callers of pdb_get_trusteddom_pw().
Guenther
2009-11-03 22:10:31 +01:00
Günther Deschner
f0b52b8c31 s3-winbindd: add and use winbindd_lookup_sids().
Guenther
2009-09-17 08:54:19 +02:00
Volker Lendecke
99cf696150 s3:winbind: Fix a bug found by RPC-SAMR
We need to enumerate passdb alias members

Thanks to gd for bugging me :-)
2009-08-29 10:44:13 +02:00
Steven Danneman
5469866242 s3/winbindd: Remove unnecessary check for NULL SID
There's a known bug in some Windows implementations of
DsEnumerateDomainTrusts() where domain SIDs are not returned for
transitively trusted domains within the same forest.

Jerry originally worked around this in the winbindd parent by checking
for S-0-0 and converting it to S-1-0 in 8b0fce0b.  Guenter later moved
these checks into the child process in commit 3bdfcbac making the
initial patch unecessary.

I've removed it and added a clarifying comment to the child process.

If ever this SID is needed we could add an extra DsEnumerateDomainTrusts()
call in trusted_domains() as suggested by the Microsoft KB.
2009-08-26 16:34:09 -07:00
Volker Lendecke
c6b36ce573 s3:winbind: WINBIND_USERINFO -> wbint_userinfo 2009-08-16 10:38:24 +02:00
Stefan Metzmacher
1e1445bc76 s3:winbindd: raise the timeout for lsa_Lookup*() calls from 10 to 35 seconds.
metze
2009-08-11 13:53:33 +02:00
Volker Lendecke
7180ae0b8e Add some const to winbind_userinfo 2009-08-03 22:48:45 +02:00
Volker Lendecke
4fa28af91d Fix some nonempty blank lines 2009-08-02 22:33:56 +02:00
Volker Lendecke
4f147388c0 Refactor 9b78af1f: Fix lookupname recursion
Pass a "flags" argument instead of the original winbind command down the
name_to_sid chain. This way we are independent of the winbind commands and
can take the decision at a much higher level
2009-08-02 11:24:48 +02:00
Günther Deschner
05fbe0c7f7 libds: merge the UF<->ACB flag mapping functions.
Guenther
2009-07-13 15:36:07 +02:00
Volker Lendecke
c624a704be Make escape_ldap_string take a talloc context 2009-07-09 22:25:29 +02:00
Volker Lendecke
0dbecbbee5 Make sid_binstring & friends take a talloc context 2009-05-28 11:33:21 +02:00
Andrew Bartlett
2050187673 s3:libads Make ads_get_dn() take a talloc context
Also remove ads_memfree(), which was only ever a wrapper around
SAFE_FREE, used only to free the DN from ads_get_ds().

This actually makes libgpo more consistant, as it mixed a talloc and a
malloc based string on the same element.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 15:54:41 +02:00
Günther Deschner
531af136f9 s3: remove POLICY_HND.
Guenther
2009-03-18 23:22:29 +01:00
Jeremy Allison
bb23f5725f Fix more asprintf and "ignoring return code" warnings from gcc 4.3.
Jeremy.
2008-12-31 16:30:11 -08:00
Michael Adam
e179c41718 s3-winbindd_ads: use the reconnect methods instead of the rpc methods directly
Some of the ads methods just point to the rpc methods.
This makes winbindd_ads use the reconnect methods instead of
calling the rpc methods directly in order to prevent
negative cache entries for e.g. name_to_sid, when the dc
has closed the connection without sending a reset.

Michael
2008-11-21 23:32:29 +01:00
Michael Adam
fa60e4e97d s3-winbindd_ads: prevent negative GM/ cache entries due to broken connections
The ads lookup_groupmem() function calls lda_lookupsids to resolve sids
to names. This is tried only once. So in case the connection was broken,
e.g. closed by the server (without a reset packet), there will be an empty
GM/ cache entry for the requested group which will prevent proper working
of access checks among other checks for the expiry period.

This patch works around this problem by retrying once if the lsa_lookupsids
call fails, re-establishing the dc-connection, as we already do in many other
places (e.g. the winbindd retry methods for the rpc layer).

Michael
2008-11-21 23:32:29 +01:00
Steven Danneman
6d59be1e6d Fix extended DN parse error when AD object does not have a SID.
Some AD objects, like Exchange Public Folders, can be members of Security
Groups but do not have a SID attribute.  This patch adds more granular return
errors to ads_get_sid_from_extended_dn().  Callers can now determine if a parse
error occured because of bad input, or the DN was valid but contained no SID.

I updated all callers to ignore SIDless objects when appropriate.

Also did some cleanup to the out paths of lookup_usergroups_memberof()
2008-11-18 13:02:21 -08:00
Steven Danneman
9a7900fb38 Whitespace and >80 column cleanups. 2008-11-18 13:02:20 -08:00
Michael Adam
49145bfefa [s3]winbindd_ads: honour "winbind use default domain" in lookup_groupmem().
This fixes the output of "getent group" when "winbind use default domain = yes"
with security = ads.

Michael
2008-09-23 10:00:26 +02:00
Günther Deschner
ce9d896781 Revert "winbindd: the ad trusted_domains call should return talloced strings."
This reverts commit b57cbf62e8.
(This used to be commit b2a3f13e5b)
2008-09-05 23:29:54 +02:00
James Ding
72df999759 Fix winbindd crash bug with trusted domains. Bug #5736
(This used to be commit d4f5caa3d3)
2008-09-04 15:13:12 -07:00
Günther Deschner
aac60fead2 winbindd: the ad trusted_domains call should return talloced strings.
Guenther
(This used to be commit b57cbf62e8)
2008-09-02 21:53:04 +02:00
Günther Deschner
52e23fe460 winbindd: fix invalid sid copy (hit when enumerating sibling domains).
Guenther
(This used to be commit 5eee742335)
2008-08-28 12:29:52 +02:00
Günther Deschner
3bdfcbac5c winbindd: handle trusted domains without sid.
Guenther
(This used to be commit 0c1efc6c89)
2008-07-30 17:09:58 +02: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
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
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
Günther Deschner
c25958a046 Use netr_SamInfo3 everywhere in winbindd.
Guenther
(This used to be commit d9502eb753)
2008-02-17 02:12:00 +01:00
Günther Deschner
80b2e330f9 Remove include/rpc_ds.h and all references to it completly.
Jerry, please have a look if you're fine with that.

Guenther
(This used to be commit beae25c808)
2008-01-29 17:51:05 +01:00
Günther Deschner
e629f50a51 Use another pidl generated call to enumerate ds trusted domains in winbindd.
Guenther
(This used to be commit f6397fbeae)
2008-01-29 15:18:41 +01:00
Michael Adam
f3603d5a5a Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
(This used to be commit 6b2b9a60ef)
2008-01-09 01:47:10 +01:00
Gerald (Jerry) Carter
84a50e2154 Fix the inherited trust flags when spidering the trust heirarchy.
Also *do not* clear the trust list when rescanning or else it is possible
to suffer from a race condition where no trusted domains can be found.
(This used to be commit e7164a252b)
2008-01-04 13:35:41 -06:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Jeremy Allison
6b6655edd9 Remove pstrings from everything except srv_spoolss_nt.c.
Jeremy.
(This used to be commit 0002a9e96b)
2007-11-27 14:35:30 -08:00
Jeremy Allison
f88b7a076b This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
(This used to be commit 98e154c312)
2007-10-24 14:16:54 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Michael Adam
6f5869461c r25247: Rename the rpccli_lsa_lookup_sids_all() function to rpccli_lsa_lookup_sids()
and remove the old rpccli_lsa_lookup_sids() function. The old function would
fail due to server limits when requesting to resolve too many sids at once
(20480 for W2k3). The new version passes the list of sids in hunks to the
server. It has up to now been used (and tested) in the winbindd_ads
lookup_groupmem() function, and I think the time has come to replace the actual
function with this correct version.

Michael
(This used to be commit 1194d4f36e)
2007-10-10 12:30:54 -05:00
Stefan Metzmacher
28aa4bff8d r25154: move winbindd code into winbindd/
metze
(This used to be commit 3ac7566ae1)
2007-10-10 12:30:46 -05:00