1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

849 Commits

Author SHA1 Message Date
Stefan Metzmacher
4c6cde99c0 s3:winbindd: correctly retry if the netlogon pipe gets disconnected during a logon call
This fixes hopefully the last part of bug #7295.

metze
2010-03-29 22:15:13 +02:00
Stefan Metzmacher
6bd5a2a373 s3:winbindd_reconnect: don't only reconnect on NT_STATUS_UNSUCCESSFUL
metze
2010-03-29 18:11:19 +02:00
Stefan Metzmacher
94a4bcd2f0 s3:winbindd_cm: invalidate connection if cm_connect_netlogon() fails
metze
2010-03-29 18:11:18 +02:00
Stefan Metzmacher
4f391fedac s3:winbindd: consistently use TALLOC_FREE(conn->foo_pipe) is we create a new connection
metze
2010-03-29 18:11:18 +02:00
Stefan Metzmacher
d980c06a99 s3:winbindd_cm: use rpccli_is_connected() helper function
metze
2010-03-29 18:11:18 +02:00
Stefan Metzmacher
408a3eb35a s3:winbindd_cm: use cli_state_is_connected() helper function
metze
2010-03-29 18:11:17 +02:00
Volker Lendecke
8b1651cb50 s3: Fix bug 7212, "getent group does not return group members" 2010-03-29 15:03:18 +02:00
Andreas Schneider
a6f25fc635 s3-smbd: Don't close stdout if we want to log to stdout. 2010-03-26 14:48:54 +01:00
Stefan Metzmacher
7d977da925 s3:ntlmssp: pass names and use_ntlmv2 to ntlmssp_client_start() and store them
Inspired by the NTLMSSP merge work by Andrew Bartlett.

metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:55 +01:00
Volker Lendecke
13400a6589 s3: Fix a bad memleak in winbind 2010-03-22 16:47:52 +01:00
Volker Lendecke
89c785c47a s3: Fix a long-standing problem with recycled PIDs
When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker
2010-03-10 16:07:10 +01:00
Stefan Metzmacher
31293c64a3 s3:winbindd: add DEBUG(10,...) for the end of each top level
That will hopefully make debugging a bit easier (at least for me).

metze
2010-03-05 14:03:55 +01:00
Bo Yang
aaafadb7d5 s3: Fix unnecessary traversing winbindd_cache.tdb in SIGHUP handler.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-03-06 20:58:23 +08:00
Volker Lendecke
5c40aa59d7 s3: Remove unused count_all_current_connections() 2010-02-28 20:45:21 +01:00
Volker Lendecke
0e9882a65e s3: Fix but 7145 -- duplicate sam and unix accounts
For me this survives the

TESTS=posix_s3 POSIX_SUBTESTS="RPC-SAMR-LARGE-DC LOCAL-NSS-WRAPPER" make test

reproducer. Günther, please check!

Volker
2010-02-28 14:40:25 +01:00
Roel van Meer
cfc79f222d Fix one of the valgrind warnings from bug #6814 - Fixes for problems reported by valgrind
The timeval passed to event_add_to_select_args() must be initialized
as event_add_to_select_args() uses a timeval_min() on this and next_event.
2010-02-26 14:54:22 -08:00
Simo Sorce
61b7a24f16 s3 move the sitename cache in its own file 2010-02-23 12:46:26 -05:00
Volker Lendecke
752bffc53f s3: Consolidate server_id_self into the equivalent procid_self() 2010-02-23 15:30:00 +01:00
Stefan Metzmacher
f924b77492 s3:winbindd: never mark external domains as internal!
This way we can endup with silently using builtin_passdb_methods
for an ad domain without an inbound trust.

This fixes bug #7170.

metze
2010-02-23 10:23:32 +01:00
Lars Müller
94074eb2e6 s3: go straight to winbindd_dual_pam_auth() in case of !NT_STATUS_OK
At the formerly used process_result statement we have alone one
NT_STATUS_IS_OK() which never could be hit in our case as we only go here
if NT_STATUS_EQUAL is not ok.
2010-02-17 19:00:01 +01:00
Bo Yang
9fed9011ff s3: Don't invalidate cache for uninitialized domains.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-02-09 17:06:14 +08:00
Karolin Seeger
1396345638 s3/winbind_ccache: Fix typo in debug message.
Karolin
2010-01-28 15:10:54 +01:00
Volker Lendecke
6ba9bf004f s3: Add the session key to the ccache_ntlm_auth response 2010-01-24 20:32:16 +01:00
Volker Lendecke
7d18d058a1 s3: Add wbinfo --ccache-save
With this command you can give winbind your password for later use by
the automatic ntlm_auth
2010-01-24 20:32:16 +01:00
Kai Blin
932d4a874b s3 winbindd: Return number of groups in data.num_entries for WINBINDD_LIST_GROUPS
This allows to test if there's something wrong with the group list in
extra_data or if there's simply no groups in the database.

Volker, please check.
2010-01-14 15:18:34 +01:00
Kai Blin
36db924446 s3 winbindd: Get WINBINDD_CHECK_MACHACC torture test to work again.
WINBINDD_CHECK_MACHACC used to report an NTSTATUS error and appropriate error
strings. Make this work again.
2010-01-14 15:18:34 +01:00
Volker Lendecke
026b23062e s3: Fix a winbind segfault in "trusted_domains"
We have to initialize domain->backend by calling "get_cache" before doing a
query

Thanks to Christian Ambach to find this :-)
2010-01-13 12:22:31 +01:00
Volker Lendecke
fd1b6bdef9 s3: Fix some nonempty blank lines 2010-01-10 20:56:16 +01:00
Volker Lendecke
3ea64e0ad8 s3: Replace most calls to sid_append_rid() by sid_compose() 2010-01-10 20:56:16 +01:00
Volker Lendecke
fd92db55eb s3: Remove a pointless "else" branch from add_ccache_to_list() 2010-01-09 20:37:40 +01:00
Volker Lendecke
fc1757369f s3: Slightly simplify winbindd_store_creds 2010-01-09 20:37:39 +01:00
Volker Lendecke
43c841b6bd s3: Fix a segfault in winbindd_dual_ccache_ntlm_auth()
ntlmssp_update allocates the reply_blob as a child of ntlmssp_state. This means
with ntlmss_end() it will be gone. winbindd_dual_ccache_ntlm_auth used the blob
after the ntlmssp_end().
2010-01-09 20:37:39 +01:00
Bo Yang
d06fb8e027 s3: List trusted domains from wcache when domain is offline.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-01-06 19:19:52 +08:00
Bo Yang
133638c8ae s3: Make winbindd_cache.c aware of domain offline to avoid unnecessary backend query.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-01-06 19:19:43 +08:00
Bo Yang
36493bf2f6 s3: Fix infinite loop in NCACN_IP_TCP asa there is no timeout. Assume lsa_pipe_tcp is ok but network is down, then send request is ok, but select() on writeable fds loops forever since there is no response.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-01-06 19:19:35 +08:00
Volker Lendecke
41a5149981 s3: Slightly simplify winbindd_dual_ccache_ntlm_auth
data_blob_const can't fail
2010-01-03 11:38:22 +01:00
Volker Lendecke
063900ae63 s3: Fix a typo 2010-01-02 12:09:05 +01:00
Volker Lendecke
a66341b993 s3: simplify find_root_domain, find_our_domain() never fails 2010-01-02 12:09:05 +01:00
Volker Lendecke
133f023d58 s3: Use global_sid_Builtin in find_builtin_domain 2010-01-02 12:09:05 +01:00
Volker Lendecke
92345f49e3 s3: Avoid adding a domain twice
If we found a match with sid==NULL, we ended up adding the domain twice
2010-01-02 12:09:05 +01:00
Volker Lendecke
22a4a000ce s3: Make free_domain_list() static 2010-01-02 12:09:05 +01:00
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
Jim McDonough
3a271a89b5 Prevent NULL dereference if group has no members 2009-12-30 15:06:07 -05:00
Volker Lendecke
e5fbff0963 s3: Check for lp_winbind_trusted_domains_only in wb_gettoken()
This avoids one walk of the domain list
2009-12-28 23:35:07 +01:00
Volker Lendecke
c0289d63c3 s3: Move a lp_winbind_trusted_domains_only() check to wb_getgrsid()
winbindd_getgrgid was not protected by this.
2009-12-28 23:20:02 +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
Volker Lendecke
2c49678ce5 s3: Remove some unused code
Watch the #if 0 -- we never stored this in the cache anymore
2009-12-28 14:59:46 +01:00
Volker Lendecke
d53cfb7675 s3: Simplify winbindd_list_trusted_domains() slightly 2009-12-28 14:59:45 +01:00
Volker Lendecke
2daa084da4 s3: Simplify "setup_domain_child" slightly 2009-12-28 14:59:45 +01:00