1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

214 Commits

Author SHA1 Message Date
Jeremy Allison
82b3656b4b r25020: Fix coverity #374, possible null deref.
Jeremy.
2007-10-10 12:30:34 -05:00
Günther Deschner
9df961914c r24954: Fix the build without krb5.
Guenther
2007-10-10 12:30:30 -05:00
Günther Deschner
800645d538 r24952: Set the kdc locator env vars. This makes the krb5 locator plugin fully
operational (from within winbindd and outside).

Guenther
2007-10-10 12:30:30 -05:00
Günther Deschner
46dbd6034e r24807: Add WINBINDD_LOCATOR_KDC_ADDRESS env which will be used for the case when the
locator gets called from within winbindd.

Guenther
2007-10-10 12:30:23 -05:00
Günther Deschner
d8197aca5a r24785: Put checks in parentheses.
Guenther
2007-10-10 12:30:21 -05:00
Günther Deschner
fb9228b8d1 r24778: Make sure krb5 locator requests go to a separate locator winbind child.
Guenther
2007-10-10 12:30:20 -05:00
Gerald Carter
98fb5bcd57 r24722: Squashed commit of the following:
commit fb52f971986dd298abbcd9745ddf702820ce0184
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Mon Aug 27 13:50:26 2007 -0500

    Check correct return type for pam_winbind_request_log() wnibind_upn_to_username

    which is an int and not NSS_STATUS.

commit 7382edf6fc0fe555df89d5b2a94d12b35049b279
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Mon Aug 27 13:30:26 2007 -0500

    Allow wbinfo -n to convert a UPN to a SID

commit 8266c0fe1ccf2141e5a983f3213356419e626dda
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Fri Aug 3 09:53:16 2007 -0500

    Merge some of Guenther UPN work for pam_winbind.c (check the winbind separator

    and better pam logging when converting a upn to a username).

commit 15156c17bc81dbcadf32757015c4e5158823bf3f
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Fri Aug 3 08:52:50 2007 -0500

    Include Universal groups from the cached PAC/SamLogon info when

    generating the list of domain group SIDs for a user's token.

commit 979053c0307b051954261d539445102c55f309c7
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Thu Aug 2 17:35:41 2007 -0500

    merge upnlogon patch from my tree
2007-10-10 12:30:15 -05:00
Stefan Metzmacher
12440efe0b r24017: merge from http://samba.org/~tridge/samba_3_2_ctdb/:
add add_trusted_domain() can return NULL

metze
2007-10-10 12:28:56 -05:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Gerald Carter
5e0f8b114b r23601: BUG 4579: Don't mark the SAM domain on a Samba DC as an internal domain or else all network connections from the local winbindd will fail 2007-10-10 12:23:35 -05:00
James Peach
171dc060e2 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
2007-10-10 12:23:23 -05:00
Gerald Carter
bcc8a3290a r23244: Fix loop with nscd and NSS recusive calls.
> Here's the problem I hit:
>
> getgrnam("foo") -> nscd -> NSS -> winbindd ->
>   winbindd_passdb.c:nam_to_sid() -> lookup_global_sam_name() ->
>   getgrnam("foo") -> nscd -> ....
>
> This is in the SAMBA_3_0 specifically but in theory could happen
> SAMBA_3_0_25 (or 26) for an unknown group.
>
> The attached patch passes down enough state for the
> name_to_sid() call to be able to determine the originating
> winbindd cmd that came into the parent.  So we can avoid
> making more NSS calls if the original call came in trough NSS
> so we don't deadlock ?  But you should still service
> lookupname() calls which are needed for example when
> doing the token access checks for a "valid groups" from
> smb.conf.
>
> I've got this in testing now.  The problem has shown up with the
> DsProvider on OS X and with nscd on SOlaris and Linux.
2007-10-10 12:22:58 -05:00
Gerald Carter
2c64638934 r23074: Remove duplicate code blocks from bad merge 2007-10-10 12:22:18 -05:00
Gerald Carter
f53aa56998 r23054: Move the check for the lookup_domain of S-1-22-{1,2} before the
check for IS_DC.  Otherwise we will for example fail to lookup a
sid of S-1-22-1-780 because it has no valid struct winbindd_domain*
in the list.   Thanks to Simo for the catch.
2007-10-10 12:22:17 -05:00
Gerald Carter
d70cec3196 r23048: Simo is correct in that winbind_lookup{sid,name}_async() needs
to be able to handle SIDs in the S-1-22-{1,2} domain in order
for winbindd_sid_to_uid(), et. al. to succeed.  For 3.0.25a,
we will short circuit in the sid_to_uid() family of functions
so that smbd is ok.

For 3.0.26, we need to allow winbindd to handle all types of SIDs.
2007-10-10 12:22:17 -05:00
Gerald Carter
3d48a7e72d r23046: Few missing merges from cleaning out the Centeris winbindd tree.
Nothing of major interest.  Will fix a few problems with one way trusts.
2007-10-10 12:22:17 -05:00
Gerald Carter
dee2bce2af r22710: Support one-way trusts.
* Rely on the fact that name2sid will work for any name
  in a trusted domain will work against our primary domain
  (even in the absense of an incoming trust path)

* Only logons will reliably work and the idmap backend
  is responsible for being able to manage id's without contacting
  the trusted domain

* "getent passwd" and "getent group" for trusted users and groups
  will work but we cannot get the group membership of a user in any
  fashion without the user first logging on (via NTLM or krb5)
  and the netsamlogon_cache being updated.
2007-10-10 12:21:49 -05:00
Gerald Carter
4b4148a964 r22705: Implement new set_dc_type_and_flags() called based on the
information return from our DC in the DsEnumerateDomainTrusts()
call.   If the fails, we callback ot the older
connect-to-the-remote-domain method.

Note that this means we can only reliably expect the native_mode
flag to be set for our own domain as this information in not
available outside our primary domain from the trusted information.
This is ok as we only really need the flag when trying to
determine to enumerate domain local groups via RPC.

Use the AD flag rather than the native_mode flag when using
ldap to obtain the seq_num for a domain.
2007-10-10 12:21:47 -05:00
Gerald Carter
9cf6068f1e r22704: Implement three step method for enumerating domain trusts.
(a) Query our primary domain for trusts
(b) Query all tree roots in our forest
(c) Query all forest roots in trusted forests.

This will give us a complete trust topology including
domains via transitive Krb5 trusts.  We also store the
trust type, flags, and attributes so we can determine
one-way trusted domains (outgoing only trust path).
Patch for one-way trusts coming in a later check-in.

"wbinfo -m" now lists all domains in the domain_list() as held
by the main winbindd process.
2007-10-10 12:21:47 -05:00
Gerald Carter
b442644bac r22702: Convert both lookup name and lookup sid to follow the
same heuristic.  First try our DC and then try a DC in the
root of our forest.  Use a temporary state since
winbindd_lookupXXX_async() is called from various winbindd
API entry points.

Note this will break the compile.  That will be fixed in the
next commit.
2007-10-10 12:21:47 -05:00
Günther Deschner
5b149967cc r22647: Avoid leaking a full info3 structure on each winbindd cached login by making
netsamlogon_cache_get() return a talloc'ed structure.

Guenther
2007-10-10 12:19:52 -05:00
James Peach
e027322b76 r22507: Wrap the method of obtaining sockets to listen on. 2007-10-10 12:19:40 -05:00
Gerald Carter
2abeec5768 r22283: Remove very old bug where we assigned the online mode of
the domain to queried to our own domain.
2007-10-10 12:19:24 -05:00
Jeremy Allison
2d951c91a5 r21927: Removed unused variable.
Jeremy.
2007-10-10 12:18:49 -05:00
Gerald Carter
add225e1c8 r21918: Reverting this change as it is now causing aborts() in
find_builtin_domain().    This all needs more testing
before anyone starts changing these lookup routines again.
2007-10-10 12:18:48 -05:00
Gerald Carter
c63bc30037 r21913: fix one bug in build 717: correctly check the return from sid_peek_check_rid() when trying to find a matching domain 2007-10-10 12:18:48 -05:00
James Peach
86a70adb6a r21881: Make sure we are very specific when testing whether a backand can handle a
particular SID. Make sure that the passdb backend will accept the same set
range of local SIDs that the idmap system sends it.

Simo, Jerry - this is a 3_0_25 candidate. Can you please review?
2007-10-10 12:18:43 -05:00
Günther Deschner
16c90f30b9 r21308: Fix some typos and ensure to null terminate the correct strings.
Guenther
2007-10-10 12:17:54 -05:00
Gerald Carter
bd8238417b r21070: * Add the new boolean 'winbind normalize names' option as discussed
on the samba-technical ml.  The replacement character is hardcoded
  as a '_' for now.
2007-10-10 12:17:32 -05:00
Günther Deschner
ccd4812c0b r21018: Removing the set_domain_online_request again in trustdom_recv().
Jeremy, we really can't do that. There are setups with hundred and more
trusted domains out there, I have one customer who tells me it takes
more then half an hour for him after winbind is up and running. That
request registers the check_domain_online_handler which in turn forks
off the child immediately. Also discussed with Volker.

Guenther
2007-10-10 12:17:27 -05:00
Jeremy Allison
68c4fbcf33 r20530: Don't want this call to get inadvertently re-added :-).
Jeremy.
2007-10-10 12:16:54 -05:00
Gerald Carter
7b2bf0e5a6 r20488: When joined to a child domain in a multi-domain/single domain tree,
the child domain cannot always resolve SIDs in sibling domains.
Windows tries to contact a DC in its own domain and then the root
domain in the forest.  This async changes makes winbindd's name2sid()
call do the same.
2007-10-10 12:16:52 -05:00
Gerald Carter
ccea7155bc r20287: Allow a NULL sid when setting up the list of trusted domains. 2007-10-10 12:16:39 -05:00
Jeremy Allison
b3c98057fb r20270: Even with the dual daemon mode the parent winbindd
still needs to contact the DC's for non async requests
like enumerate users/groups etc. Now that online
DC detection is tied to async events we must enable
the processing of events in the main loop of winbindd.
Finally got rid of the last hard coded domain->initialized = 1
code in init_child_recv() - now all domain->initialized = True
gets done only in the connection manager code when either
we're online and have spoken to the DC or are offline and
we know we can't talk to the DC.
Jeremy.
2007-10-10 12:16:38 -05:00
Simo Sorce
a28cdd6e74 r20150: better memory handling for some functions, make sure we don't
leak memory by using the wrong(long lived)  mem context
2007-10-10 12:16:27 -05:00
Herb Lewis
ac3eb7813e r20124: clean up nested extern declaration warnings 2007-10-10 12:16:26 -05:00
Simo Sorce
50cd8bffee r20116: Start merging in the work done to create the new idmap subsystem.
Simo.
2007-10-10 12:16:25 -05:00
Jeremy Allison
0ffca7559e r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
2007-10-10 12:16:24 -05:00
Jeremy Allison
369c9e4138 r20057: Attempt to fix connect timeouts when connected on
a network but not one on which any home DC's can
be found (hotel network problem). Still testing
but this is getting close.
Jeremy.
2007-10-10 12:16:23 -05:00
Volker Lendecke
28ac023581 r19686: Fix the build 2007-10-10 12:15:46 -05:00
Jeremy Allison
acf5419d62 r19413: Now we're calling init_dc_connection, this code
is completely useless (and in fact harmful :-) in
that it causes a winbindd error where there should
be none.
Jeremy.
2007-10-10 12:15:33 -05:00
Jeremy Allison
e4d5e1d90b r19212: Make sure domains marked internal don't do
network queries.
Jeremy.
2007-10-10 12:15:22 -05:00
Jeremy Allison
dbd2454d33 r19207: Properly canonicalize incoming names to the
NSS protocols auth, chauthtok, logoff, ccache_ntlm_auth.
That way we ensure winbindd only deals with fully
qualified names internally. The NSS protocols
auth_crap and chng_pswd_auth_crap should be fixed
to do the same thing.
Jeremy.
2007-10-10 12:15:21 -05:00
Jeremy Allison
40a455db78 r19148: Finish last nights patch - make offline
work again. Still under test.
Jeremy.
2007-10-10 12:15:16 -05:00
Volker Lendecke
c53e2e5475 r19066: Fix a memleak 2007-10-10 12:15:07 -05:00
Günther Deschner
7db6ce295a r18703: Fix the annoying effect that happens when nscd is running:
We usually do not get the results from user/group script modifications
immediately. A lot of users do add nscd restart/refresh commands into
their scripts to workaround that while we could flush the nscd caches
directly using libnscd.

Guenther
2007-10-10 12:00:49 -05:00
Jeremy Allison
205aa2b70d r18509: We must always canonicalise the usernames to be UPPERCASE DOMAIN,
lowercase username. We cache names as keys in this form, and we weren't
always returning this....
Jeremy.
2007-10-10 11:51:45 -05:00
Gerald Carter
3da9f80c28 r18271: Big change:
* autogenerate lsa ndr code
* rename 'enum SID_NAME_USE' to 'enum lsa_SidType'
* merge a log more security descriptor functions from
  gen_ndr/ndr_security.c in SAMBA_4_0

The most embarassing thing is the "#define strlen_m strlen"
We need a real implementation in SAMBA_3_0 which I'll work on
after this code is in.
2007-10-10 11:51:18 -05:00
Volker Lendecke
05268d7a73 r17605: Some C++ warnings 2007-10-10 11:38:42 -05:00