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

501 Commits

Author SHA1 Message Date
Volker Lendecke
a93d0f6f4e Do not create a new mapping if a domain with an explicit config fails
(This used to be commit 2c27de4426)
2008-08-12 11:28:29 +02:00
Volker Lendecke
18bc97287c Some doxygen comments for idmap
(This used to be commit adecc6d913)
2008-08-12 11:28:29 +02:00
Volker Lendecke
8d25729705 Fix prototypes
(This used to be commit 8b9d127146)
2008-08-12 11:28:29 +02:00
Volker Lendecke
2a3698e5c0 Remove "idmap alloc config : range" parameter
This was overwritten by "idmap uid/gid" anyway. These are now the range
parameters for the alloc backend.
(This used to be commit d563a7b80d)
2008-08-12 11:28:29 +02:00
Volker Lendecke
340ab6a256 idmap rewrite
(This used to be commit 30a180f2fc)
2008-08-12 11:28:29 +02:00
Volker Lendecke
8d4bd2d960 Remove the multi-ID lookup code and the 3.2.0 version of idmap_cache
(This used to be commit 1bd98521dc)
2008-08-12 11:28:29 +02:00
Volker Lendecke
0c1e27abf6 Directly call backends from idmap_[ugs]_to_[ugs]id
(This used to be commit f955407042)
2008-08-12 11:28:28 +02:00
Volker Lendecke
1bdbe772ad Move the gid2sid cache to the parent winbind process
(This used to be commit a86a6835e2)
2008-08-12 11:28:28 +02:00
Volker Lendecke
08f7c2d0fc Move the uid2sid cache to the parent winbind process
(This used to be commit 6e885aeabb)
2008-08-12 11:28:28 +02:00
Andrew Tridgell
8fed76b73e fixed a fd leak when trying to regain contact to a domain controller
in winbind

When a w2k3 DC is rebooted the 139/445 ports come up before the
udp/389 cldap port. During this brief period, winbind manages to
connect to 139/445 but not to udp 389. It then enters a tight loop
where it leaks one fd each time. In a couple of seconds it runs out of
file descriptors, and leaves winbind crippled after the DC does
finally come up
(This used to be commit 57187cafbc)
2008-08-06 10:50:16 +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
Volker Lendecke
0fdffbc959 Fix an incompatible pointer warning
(cherry picked from commit 3282f7289b)
(This used to be commit fc86414439)
2008-07-25 23:35:00 +02:00
Volker Lendecke
0f9c30c114 Fix a race condition in winbind leading to a crash
When SIGCHLD handling is delayed for some reason, sending a request to a child
can fail early because the child has died already. In this case
async_main_request_sent() directly called the continuation function without
properly removing the malfunctioning child process and the requests in the
queue. The next request would then crash in the DLIST_ADD_END() in
async_request() because the request pending for the child had been
talloc_free()'ed and yet still was referenced in the list.

This one is *old*...

Volker
(cherry picked from commit 8691709626)
(This used to be commit c70e2b6476)
2008-07-25 12:12:49 +02:00
Volker Lendecke
8ea3ce5342 Remove unused request_finished_cont()
(This used to be commit 865ea6fcbc)
2008-07-24 15:01:04 +02:00
Volker Lendecke
d7b87cdce2 Make use of TALLOC_FREE when freeing the per-winbindrequest memory context
(This used to be commit 9e49d390f7)
2008-07-24 14:50:22 +02:00
Zach Loafman
06d0790c07 Fix various build warnings
This fixes various build warnings on our platform. I'm sure I haven't
caught them all, but it's a start.
(This used to be commit 6b73f259cb)
2008-07-22 15:00:48 +02:00
Volker Lendecke
ba2cb35ca5 Refactoring: Change calling conventions for cli_rpc_pipe_open_schannel_with_key
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit 78e9c937ff)
2008-07-20 17:37:13 +02:00
Volker Lendecke
e0be03d8d5 Refactoring: Change calling conventions for cli_rpc_pipe_open_ntlmssp
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit a13f059955)
2008-07-20 17:37:11 +02:00
Volker Lendecke
1335da2a7c Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit 9abc9dc4dc)
2008-07-20 17:37:11 +02:00
Jeremy Allison
1484b7f3b5 From Jim McDonough
In reloading the smb.conf, if a "log file" is specified in smb.conf,
winbind children will overwrite the logfile name to be the same as the
parent.

Jeremy.
(This used to be commit 62d319cc1a)
2008-07-17 20:10:18 -07:00
Simo Sorce
9669411d1e Fix regression introduced with 4086ef15b3
We must not return an error here just because we are offline.
We must instead fix the mappings to the best of our knowledge
(ie mark as mapped, expired ones, and as unmapped, unknown ones)
(This used to be commit 4436272dd4)
2008-07-12 21:42:23 -04:00
Simo Sorce
8812606c43 Remove one nested level by reversing if condition
(This used to be commit 657a2f20dd)
2008-07-12 21:41:55 -04:00
Simo Sorce
eda1a267e1 Add back mem leak fixes
(This used to be commit 2adea093c5)
2008-07-12 21:40:33 -04:00
Simo Sorce
02e592486f Make again idmap_init static
(This used to be commit e113b7c13f)
2008-07-12 21:40:28 -04:00
Volker Lendecke
343c7ff3d2 Revert "Fix two memory leaks in an error path in idmap.c"
This reverts commit 7cec389e19.
(This used to be commit d0b34cbb4e)
2008-07-11 17:53:26 +02:00
Volker Lendecke
622d36aa41 Revert "Make idmap_init() static"
This reverts commit c8d1bbfddc.
(This used to be commit 5cded3da00)
2008-07-11 17:53:26 +02:00
Volker Lendecke
025689ad18 Revert "Fix typo"
This reverts commit fe58926283.
(This used to be commit fe216bff1d)
2008-07-11 17:53:26 +02:00
Volker Lendecke
b76fb9ac73 Revert "Fix a debug msg, this was probably a leftover from gencache"
This reverts commit daa171552d.
(This used to be commit b826420c3a)
2008-07-11 17:53:26 +02:00
Volker Lendecke
a25278a522 Revert "Fix indentation"
This reverts commit 954556b527.
(This used to be commit 1b1124bcb9)
2008-07-11 17:53:26 +02:00
Volker Lendecke
be187b787f Revert "Fix nonempty whitespace only lines"
This reverts commit 0da9d0d0f9.
(This used to be commit b2f7bd6a05)
2008-07-11 17:53:25 +02:00
Volker Lendecke
979496d5c1 Revert "fix typos"
This reverts commit e0957c6f4b.
(This used to be commit 0d2fc3c394)
2008-07-11 17:53:25 +02:00
Volker Lendecke
0439d4ba61 Revert "Fix nonempty whitespace only lines"
This reverts commit cc77db2acb.
(This used to be commit ed5b516c20)
2008-07-11 17:53:25 +02:00
Volker Lendecke
f7ee7d2fe9 Revert "Tiny logic simplification: Remove an unnecessary else branch"
This reverts commit 6009ae3293.
(This used to be commit b71ce00796)
2008-07-11 17:53:25 +02:00
Volker Lendecke
0948a5cda8 Revert "Fix typo"
This reverts commit fe79c8a5b7.
(This used to be commit 62835f8d7e)
2008-07-11 17:53:25 +02:00
Volker Lendecke
f70c8ecde2 Revert "Fix indentation"
This reverts commit c4e6de9e34.
(This used to be commit fa9b128e93)
2008-07-11 17:53:25 +02:00
Volker Lendecke
d1edba537f Revert "Simplify idmap_cache_build_[s]idkey a bit"
This reverts commit 80932c0266.
(This used to be commit 847609a148)
2008-07-11 17:53:24 +02:00
Volker Lendecke
ebb9437f4f Revert "Simplify idmap_cache_set() a bit"
This reverts commit 55b976ba93.
(This used to be commit 23edc4ec0a)
2008-07-11 17:53:24 +02:00
Volker Lendecke
50a84acc40 Revert "IDMAP_READ_CACHE_DATA_FMT_TEMPLATE is unused, remove it"
This reverts commit 2396d5d5d2.
(This used to be commit 447d77949f)
2008-07-11 17:53:24 +02:00
Volker Lendecke
b6dcc24987 Revert "Convert idmap_cache to gencache"
This reverts commit 0bf0434f22.
(This used to be commit cc53667773)
2008-07-11 17:53:24 +02:00
Volker Lendecke
ebb2d70a60 Revert "Make use of ADD_TO_ARRAY"
This reverts commit 81f334bd6d.
(This used to be commit d4d106776a)
2008-07-11 17:53:24 +02:00
Volker Lendecke
6c3c068716 Revert "Tiny logic simplification -- remove an else branch"
This reverts commit 01c8c7bbf6.
(This used to be commit b0fe0c7ac1)
2008-07-11 17:53:24 +02:00
Jeremy Allison
06b3a79d1f Allow authentication and memory credential refresh after password change from gdm/xdm. Patch from boyang <boyang@novell.com>.
Jeremy.
(This used to be commit 8cfc6afc7b)
2008-07-07 11:26:16 -07:00
Simo Sorce
4be7a83a2c Clean up winbindd_group.c too
(This used to be commit 50a347f550)
2008-07-06 12:55:07 -04:00
Simo Sorce
fae6a4e79b Clean up the rest of the file too
(This used to be commit f6c92c4759)
2008-07-06 12:27:34 -04:00
Simo Sorce
632e42e165 More clean up, indentation and trailing space removal
(This used to be commit d17d401603)
2008-07-06 12:17:22 -04:00
Simo Sorce
d0a71a00bb Make code more readable, fix indentation and traling spaces.
(This used to be commit e19e12d5cb)
2008-07-06 12:03:35 -04:00
Volker Lendecke
4dbfa7a211 Tiny logic simplification -- remove an else branch
(This used to be commit 01c8c7bbf6)
2008-07-05 12:19:13 +02:00
Volker Lendecke
ca34287063 Make use of ADD_TO_ARRAY
(This used to be commit 81f334bd6d)
2008-07-05 12:19:13 +02:00
Volker Lendecke
0234276af8 Convert idmap_cache to gencache
(This used to be commit 0bf0434f22)
2008-07-05 12:19:13 +02:00
Volker Lendecke
9c7e12d9f7 IDMAP_READ_CACHE_DATA_FMT_TEMPLATE is unused, remove it
(This used to be commit 2396d5d5d2)
2008-07-03 21:19:09 +02:00
Volker Lendecke
60582d1fb4 Simplify idmap_cache_set() a bit
sid_check_is_in_unix_* will only give true if it is of the corresponding type,
so the check if the struct idmap actually represents a user or group is
unnecessary.
(This used to be commit 55b976ba93)
2008-07-03 21:19:09 +02:00
Volker Lendecke
8857affd3c Simplify idmap_cache_build_[s]idkey a bit
(This used to be commit 80932c0266)
2008-07-03 21:19:09 +02:00
Volker Lendecke
47f1090de7 Fix indentation
(This used to be commit c4e6de9e34)
2008-07-03 15:17:58 +02:00
Volker Lendecke
ec7aa52a3b Fix typo
(This used to be commit fe79c8a5b7)
2008-07-02 15:13:14 +02:00
Volker Lendecke
7207b41a5e Tiny logic simplification: Remove an unnecessary else branch
(This used to be commit 6009ae3293)
2008-07-02 15:13:01 +02:00
Volker Lendecke
e467fae948 Fix nonempty whitespace only lines
(This used to be commit cc77db2acb)
2008-07-02 15:04:46 +02:00
Volker Lendecke
ec77a06a5d fix typos
(This used to be commit e0957c6f4b)
2008-07-02 14:54:59 +02:00
Volker Lendecke
62dddd04f4 Fix nonempty whitespace only lines
(This used to be commit 0da9d0d0f9)
2008-07-02 14:18:15 +02:00
Volker Lendecke
69b9cffe6e Fix indentation
(This used to be commit 954556b527)
2008-07-02 14:18:10 +02:00
Volker Lendecke
d6ab71f06c Fix a debug msg, this was probably a leftover from gencache
(This used to be commit daa171552d)
2008-07-02 14:18:05 +02:00
Volker Lendecke
dd7691ce68 Fix typo
(This used to be commit fe58926283)
2008-07-02 14:18:01 +02:00
Volker Lendecke
1999791b7c Make idmap_init() static
This is called only from idmap_alloc_init, which feels kindof weird.

Digging deeper in the code...
(This used to be commit c8d1bbfddc)
2008-07-02 13:34:09 +02:00
Volker Lendecke
ab57861686 Fix two memory leaks in an error path in idmap.c
(This used to be commit 7cec389e19)
2008-07-02 13:34:09 +02:00
Darshan Purandare
065760ede0 MSG_DEBUG now forwarded to all the winbindd children by parent.
smbcontrol winbindd debug level would only set the debug level of the
parent winbindd process and not the child processes. This patch adds
the functionality of broadcasting the debug message to all winbindd
children. Now the debug level message is propagated to all the winbindd
processes that includes parent and children.
(This used to be commit cfbcfc3ffe)
2008-07-01 17:52:24 -07:00
Karolin Seeger
3b1de7f7f4 Revert "winbind cache: Don't create SN cache entries during name-to-sid queries."
This reverts commit b58e4f6b3d.

Details can be found on the samba-technical mailing list.

Karolin
(This used to be commit 534a445df4)
2008-07-01 10:34:22 +02:00
Jeremy Allison
4aaa3a0fac Fix from Atte Peltomki - atte.peltomaki@f-secure.com to correctly check
error code in winbindd group expansion.
Jeremy.
(This used to be commit e321377174)
2008-06-30 09:20:05 -07:00
Gerald W. Carter
9ff1ffcbee libads: Add API call to connect to a global catalog server.
Extends ads_connect() to a new call ads_connect_gc() which connects on port
3268 rather than port 389.  Also makes ads_try_connect() static and
only used internally to ldap.c
(This used to be commit f4c37dbe2c)
2008-06-27 10:26:11 -04:00
Jeremy Allison
120c09b125 From Steve Danneman @ Isilon.
Attached is the companion patch to
(037b9689d9), which
made handling of WINBINDD_LIST_GROUPS asynchronous.

Because most all of the list_groups code was reusable, I abstracted it,
and implemented both list_groups and list_users on top of it.

On my large test domain a "wbinfo -u" call went from 70 seconds to 30
seconds with this patch.  Plus, the parent process is no longer blocked
from receiving new requests during that time.

Steven Danneman | Software Development Engineer
Isilon Systems    P +1-206-315-7500     F +1-206-315-7501
www.isilon.com
(This used to be commit 5188f28611)
2008-06-26 14:02:39 -07:00
Michael Adam
89ce05bb14 winbind: remove duplicate debug message for failing messaging_init().
Leave the message inside winbind_messaging_context() for now.
There might be callers, where this debug message could prove useful...

Michael
(This used to be commit e9177ec56a)
2008-06-26 12:31:10 +02:00
Michael Adam
b33d226a61 winbind: untangle logic in winbind_messaging_context() slightly.
Michael
(This used to be commit e710a9b73e)
2008-06-26 12:31:10 +02:00
Michael Adam
7f8df9c217 winbindd: don't panic if messaging_init() fails - return NULL instead.
Leave appropriate handling to the callers.

Michael
(This used to be commit 3e0c24323a)
2008-06-26 12:31:10 +02:00
Jeremy Allison
9f71be1250 Merge branch 'v3-3-test' of ssh://jra@git.samba.org/data/git/samba into v3-3-test
(This used to be commit 9075c5f2ad)
2008-06-25 15:24:18 -07:00
Jeremy Allison
ae16606a90 Part of fix for #5551. Split out the group enumeration functions to a BUILTIN and a Domain
specific version. Stops the domain groups appearing twice.
Jeremy.
(This used to be commit 77b99530e0)
2008-06-25 15:23:32 -07:00
Günther Deschner
14d500c0e7 rename rpccli_samr_chgpasswd3 to rpccli_samr_chgpasswd_user3.
Guenther
(This used to be commit b1209a039b)
2008-06-25 23:58:50 +02:00
Günther Deschner
059293cbf4 rename rpccli_samr_chgpasswd_user to rpccli_samr_chgpasswd_user2.
Guenther
(This used to be commit 5b4650d56c)
2008-06-25 23:58:50 +02:00
Jeremy Allison
7687a22510 Final (hopefully :-) part of fix for bug #5551. Allow passdb backend to enumerate domain groups.
Jeremy
(This used to be commit 2181770e45)
2008-06-25 12:44:18 -07:00
Jeremy Allison
2a4b8fa664 Fix bug #5533. Winbindd fails to cope correctly with a workgroup name containing a '.'.
Jeremy.
(This used to be commit 96325ff44d)
2008-06-20 12:49:14 -07:00
Volker Lendecke
ee281b7479 Revert "Fix a memleak caused by a crappy get_sorted_dc_list() API"
This reverts commit 2ea03a1e95.
(This used to be commit 80c2e8295a)
2008-06-17 12:21:03 +02:00
Karolin Seeger
a7cf0bd32a idmap: Fix typos in comments.
Karolin
(This used to be commit 94a4d7fa32)
2008-06-17 10:30:19 +02:00
Karolin Seeger
98ed31a107 Fix typo.
arguements -> arguments

Karolin
(This used to be commit 16b5b772d2)
2008-06-17 09:46:17 +02:00
Karolin Seeger
13eab02679 winbind cache: Don't create SN cache entries during name-to-sid queries.
Clients can request name-to-sid queries for different combinations of
upper and lower case names. We don't want to create the reverse caching
entries for each combination used.

This avoids inconsistent answers on sid-to-name queries.

Please review!

Karolin
(This used to be commit b58e4f6b3d)
2008-06-16 15:21:28 +02:00
Jeremy Allison
1db2dc1931 Bugfix noticed by Herb. On using the again: tag as a
goto target we were not reinitializing the array counts.

From Herb:

This is in the file nsswitch/winbindd_cm.c (samba-3.0.30) line 1236

We have a label again: where we keep trying to find the name of the DC
from the list of IPs returned by get_dcs. If we fail to figure out the
name we do a goto again at the end of the function. The problem is we
don't reset the num_dcs, num_addrs, etc and free the memory in the
various arrays. This seems wrong to me. I have a winbindd core where
I have 9 IPs returned for the DCs but at the time of the crash num_dcs
is 87 and if I look through the array dcs it keeps repeating entries
from the same group of 9

Jerry, Volker and Guenther please check.

Jeremy.
(This used to be commit 15f464321a)
2008-06-08 14:19:44 -07:00
Volker Lendecke
bde7cbf4a7 Fix a memleak caused by a crappy get_sorted_dc_list() API
(This used to be commit 2ea03a1e95)
2008-06-05 10:56:18 +02:00
Gerald W. Carter
dd7cf3464d winbindd_cm: Replace the use of lp_realm() with our_domain->alt_name.
Reduce the use of config parameters with run time information after discussion
with Guenther.
(This used to be commit 57d596395d)
2008-06-03 11:21:02 -05:00
Jeremy Allison
11ef7d202a Fix by Bo Yang <boyang@novell.com> for bug with winbindd trusted domain child
not keeping primary domain online status up to date.
Jeremy.
(This used to be commit 0621c7c816)
2008-06-02 15:26:37 -07:00
Jeremy Allison
346dbc62b8 Split the winbindd_passdb backend into a 'builtin' and a 'sam'
backend. This allows winbindd when running on a Samba PDC to
correctly answer wbinfo -u lists and other queries.
Jeremy.
(This used to be commit e61ad0c158)
2008-05-30 23:49:36 -07:00
Jeremy Allison
4408fdaf29 Fix valgrind bug in debug statement. Don't reference uninitialized memory.
Jeremy.
(This used to be commit 25e76a19f2)
2008-05-30 17:53:16 -07:00
Jeremy Allison
908812e98d Fix bug #5504. winbindd children and parent were handing SIGTERM in the same way - deleting the socket!
Jeremy.
(This used to be commit 3ab5a3883e)
2008-05-30 17:52:54 -07:00
Jeremy Allison
433a05c1ab Fix winbindd on a PDC by reverting : 83b04c60fac76ccd2d5aecb14f8896a07d488b1f..6e66512d5beb256a44c6703cdb8c7fa7e0fd8537.
We still need to address https://bugzilla.redhat.com/show_bug.cgi?id=429024, but this
will come later.
Jeremy.
(This used to be commit 41e20becf3)
2008-05-29 10:37:52 -07:00
Michael Adam
c5a030a38a 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
(This used to be commit a5a51ca8e5)
2008-05-26 16:42:25 +02:00
Volker Lendecke
1a1fc2f814 Fix two c++ warnings
(This used to be commit 3b1dae7c31)
2008-05-25 13:53:45 +02:00
Gerald W. Carter
4d2f71e53f Manually merge Steven Danneman's patch for SPNEGO auth to a trusted
Win2008 domain (merged from v3-0-test).

   commit 8dc4e97977
   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.
(This used to be commit b78b14c88e)
2008-05-23 16:01:45 -05:00
Gerald W. Carter
b72fc49f44 Manually port Steven Dannenman fix for using the correct machine domain when
looking up trust credentials in our tdb.

   commit fd0ae47046
   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.
(This used to be commit 69b37ae607)
2008-05-23 15:19:58 -05:00
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
Volker Lendecke
ca63c6e079 Merge dd9e0bea31751 from 3-0-ctdb -- use NetSamLogonEx when possible
NetSamLogonEx has the advantage that it does not use the credential chain
(This used to be commit cfceb063f5)
2008-03-19 17:00:53 +01:00
Volker Lendecke
bf10e7f939 Fix some "nexted extern" warnins
(This used to be commit 32fc759d94)
2008-03-19 16:23:28 +01:00
Volker Lendecke
1ebfc66b2c Use a separate tdb for mutexes
Another preparation to convert secrets.c to dbwrap: The dbwrap API does not
provide a sane tdb_lock_with_timeout abstraction. In the clustered case the DC
mutex is needed per-node anyway, so it is perfectly fine to use a local mutex
only.
(This used to be commit f94a63cd8f)
2008-03-10 21:08:45 +01:00
Stefan Metzmacher
76de025c72 winbind: use a struct element for WBFLAG_PAM_UNIX_NAME
To not conflict with WBFLAG_PAM_INFO3_TEXT.

This should fix pam_winbind.

metze
(This used to be commit 1b8ed6c0ff)
2008-02-28 23:00:42 +01:00
Günther Deschner
0d8985f2da Let dsgetdcname() return a struct netr_DsRGetDCNameInfo.
Guenther
(This used to be commit b1a4b21f8c)
2008-02-28 12:40:55 +01:00
Günther Deschner
7269a504fd Add my copyright.
Guenther
(This used to be commit d078a87571)
2008-02-27 19:38:48 +01: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
c6f82f1cc4 Getting rid of net_io_user_info3() when sending an NDR encoded netr_SamInfo3.
Guenther
(This used to be commit f22ba8aee2)
2008-02-17 02:12:00 +01:00
Stefan Metzmacher
3649f728ed winbindd: add rids and other_sids arrays in WBFLAG_PAM_INFO3_TEXT mode
metze
(This used to be commit c5e6dd1ca9)
2008-02-13 13:30:15 +01:00
Günther Deschner
ce7d5975b4 Convert last caller (in winbindd) to rpccli_samr_EnumDomainAliases.
Guenther
(This used to be commit 33a97b447c)
2008-02-13 11:18:36 +01:00
Günther Deschner
55a8d956d1 Convert last caller (in winbindd) to rpccli_samr_EnumDomainGroups.
Guenther
(This used to be commit 8890bc481f)
2008-02-13 11:18:36 +01:00
Günther Deschner
cdc07216e4 Convert last caller (in winbindd) to rpccli_samr_LookupRids.
Guenther
(This used to be commit 34c2566f02)
2008-02-13 10:56:56 +01:00
Stefan Metzmacher
cedfcaec0c nsswitch: convert winbind_env_set(), winbind_on() and winbind_off() into macros
metze
(This used to be commit 5f623f54a9)
2008-02-13 10:44:52 +01:00
Günther Deschner
9673162236 Fix the build of winbindd, sorry.
Guenther
(This used to be commit c62c89c8f0)
2008-02-13 01:29:52 +01:00
Günther Deschner
0ba3d44f73 Use rpccli_lsa_EnumTrustDom all over the place.
Guenther
(This used to be commit a25e7ffbca)
2008-02-13 00:29:37 +01:00
Günther Deschner
4c42f7999a Use rpccli_samr_QueryUserInfo in net and winbindd.
Guenther
(This used to be commit a9ff676090)
2008-02-12 18:16:56 +01:00
Günther Deschner
e88eb3ed16 Use rpccli_netr_DsRGetDCName() in rpcclient and winbindd.
Guenther
(This used to be commit 4f3e97cbae)
2008-02-08 23:38:13 +01:00
Günther Deschner
7329bd24f9 Fix winbindd msrpc_lookup_useraliases.
Guenther
(This used to be commit e196e527ae)
2008-02-08 10:59:31 +01:00
Günther Deschner
7520439dca Use rpccli_lsa_QueryInfoPolicy() all over the place.
Guenther
(This used to be commit ce22abcea3)
2008-02-08 10:26:20 +01:00
Günther Deschner
ec9281fcac Use rpccli_lsa_QueryInfoPolicy2 in winbindd.
Guenther
(This used to be commit ccf79cfa88)
2008-02-08 10:15:50 +01:00
Günther Deschner
781776d864 Use rpccli_samr_QueryDisplayInfo() all over the place.
Guenther
(This used to be commit 66b79add35)
2008-02-08 00:10:55 +01:00
Günther Deschner
1c788bc365 Use rpccli_samr_GetGroupsForUser() all over the place.
Guenther
(This used to be commit d1c669920e)
2008-02-07 14:25:18 +01:00
Günther Deschner
bca0ef0ed7 Use rpccli_netr_GetAnyDCName and rpccli_netr_GetDCName everywhere.
Guenther
(This used to be commit 8abeea9922)
2008-02-07 10:29:26 +01:00
Günther Deschner
9c22a27aad Let rpccli_samr_chgpasswd3 use rpccli_samr_ChangePasswordUser3 internally.
Guenther
(This used to be commit ffbfd19ad7)
2008-02-07 10:07:00 +01:00
Günther Deschner
742fd39b7a Use rpccli_samr_QueryDomainInfo() in winbindd.
Guenther
(This used to be commit dd9fa33e96)
2008-02-06 02:09:44 +01:00
Jeremy Allison
497eb77099 Small whitespace cleanup + check for null returns on talloc_strdup.
Jeremy.
(This used to be commit 654484b9a2)
2008-02-05 16:51:46 -08:00
Günther Deschner
2823c1eab1 Use rpccli_samr_QueryGroupMember() all over the place.
Guenther
(This used to be commit 1793ed10df)
2008-02-05 13:19:47 +01:00
Günther Deschner
0c6b6b461c Use rpccli_samr_GetAliasMembership() in winbindd and rpcclient.
Guenther
(This used to be commit 5c16716285)
2008-02-05 10:13:08 +01:00
Günther Deschner
270ba9c238 Use rpccli_samr_Connect2() all over the place.
Guenther
(This used to be commit bdf8d56262)
2008-02-04 22:12:40 +01:00
Michael Adam
30dcc73d96 Fix a typo in a debug message.
Michael
(This used to be commit 3865a7e6a1)
2008-02-04 16:42:08 +01:00
Volker Lendecke
b42a5d68a3 Convert read_data() to NTSTATUS
(This used to be commit af40b71023)
2008-02-02 11:03:23 +01:00
Simo Sorce
2fffc9a1b1 Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit 7dbfc7bdc6)
2008-02-01 14:24:31 -05:00
Simo Sorce
93a3c5b3f9 Fix winbindd running on a Samba DC,
This patch make sure we do not try to contact smbd in the main dameon
to avoid deadlocks.
All the operations that require connecting to smbd are performed in
the domain child anyway.
(This used to be commit 9347d34b50)
2008-02-01 14:23:43 -05:00
Günther Deschner
37b56c0113 Use rpccli_samr_OpenUser() all over the place.
Guenther
(This used to be commit da90eb7653)
2008-02-01 12:30:15 +01:00
Günther Deschner
482eaa8e5c Use rpccli_samr_OpenGroup() all over the place.
Guenther
(This used to be commit d019fc69a9)
2008-02-01 12:29:35 +01:00
Günther Deschner
42960f817a Use rpccli_samr_OpenDomain() all over the place.
Guenther
(This used to be commit e4e9d72724)
2008-02-01 12:29:10 +01:00
Günther Deschner
5334b364c2 Remove rpccli_samr_close and use pidl generated function instead.
Guenther
(This used to be commit 64f0889401)
2008-01-31 11:09:11 +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
Günther Deschner
53c6009928 Use pidl generated call to enumerate ds trusted domains in winbindd.
Guenther
(This used to be commit 3a3c1aed9b)
2008-01-29 15:17:42 +01:00
Günther Deschner
5ab43ae0d8 Eliminate remote tree of dsgetdcname (which will happen in libnetapi then).
Guenther
(This used to be commit fd490d236b)
2008-01-29 15:09:56 +01:00
Gerald W. Carter
235deb1b66 Always trust the domain flags in the wcache trusted domain cache.
Use the flags stored in the tdb when determining if a domain can
be contacted.  The tdb should be considered authoratative anyways unless
you know the flags in the winbindd_domain are correct (such as when
first enumerating trusts).

Original suggestion and patch from Steven Danneman <steven.danneman@isilon.com>.
Manually rewritten by me for 3.2.
(This used to be commit f53658a20d)
2008-01-25 12:29:47 -06:00
Gerald W. Carter
fda9247770 Use the correct domain name when looking up the trust password.
On a DC, we always use the domain name given.  On a domain member,
we use lp_workgroup().  This fixes a bug supporting trusted domains.
(This used to be commit 8b063a4141)
2008-01-25 12:27:16 -06:00
Michael Adam
3ca606731b Fix winbindd_can_contact_domain() on a samba DC.
The check for inbound trusts is invalid when samba is a DC
and has a trust with an active directory domain.

This effectively prevented tusts with an AD domain on a
samba DC from working (unless using "winbindd rpc only"),
because an ads_connect() was never performed. Only the
rpc-based winbindd methods were working properly.

Jerry: Please check!

Michael
(This used to be commit dcd42a1e06)
2008-01-25 16:43:21 +01:00
Günther Deschner
05ff7fd46e Use generated DSSETUP client & server rpc functions and remove the hand-written ones.
Guenther
(This used to be commit d5ebfccebb)
2008-01-25 15:30:43 +01:00
Michael Adam
9912f82067 Add debug message: show which domain_child is being forked.
Michael
(This used to be commit 373a00ae0d)
2008-01-25 01:42:22 +01:00
Michael Adam
2a542ce772 Add a debug message winbindd_can_contact_domain()
explaining the reason for failure.

Michael
(This used to be commit ba5373ed7f)
2008-01-25 01:42:22 +01:00
Michael Adam
614ba32b22 Fix assignment to request->data.init_conn.is_primary in init_child_connection().
The present assignment
"request->data.init_conn.is_primary = domain->internal ? False : True"
simply feels wrong. This seems to be the thing right to do:
"request->data.init_conn.is_primary = domain->primary ? true : false".

The question is: Does this have any purpose at all?
data.init_conn.is_primary seems to be used nowhere
in the whole code at all.

Is it (still) needed?

Michael
(This used to be commit 8bb21b8b38)
2008-01-25 01:42:22 +01:00
Günther Deschner
6b1c45a5c2 Fix winbindd build w/o ADS.
Guenther
(This used to be commit 40daef4c3d)
2008-01-24 17:40:35 +01:00
Günther Deschner
fcf42bb19c Add winbind_msg_dump_domain_list to winbindd.
Guenther
(This used to be commit 54ad97bd83)
2008-01-24 16:22:04 +01:00
Günther Deschner
af7f24d979 Add winbindd debugging ndr_print helpers.
Guenther
(This used to be commit 4389e4dadb)
2008-01-24 16:21:59 +01:00
Andreas Schneider
691c4b1a41 Windows 2008 (Longhorn) auth2 flag fixes.
Interop fixes for AD specific flags. Original patch from Todd Stetcher.
(This used to be commit 5aadfcdaac)
2008-01-23 14:55:22 -08:00
Michael Adam
2051243132 Fix panic: Don't free the logfilename in winbind_child_died().
The child struct is immediately reused, and this results
in a panic when child->logfilename == NULL.

Michael
(This used to be commit da131d089d)
2008-01-23 14:33:22 +01:00
Michael Adam
3b83f49158 Initialize _domain_list to NULL.
Just to be sure the "if (!_domain_list)" in domain_list() test always works.

Michael
(This used to be commit 1f49065d44)
2008-01-23 13:52:42 +01:00
Günther Deschner
5f962d9b98 Fix get_trust_creds() to return always an upper-cased krb5 principal (this
fixes winbind krb5 session at least with heimdal).

Guenther
(This used to be commit 9cf3a98eac)
2008-01-23 12:05:01 +01:00
Stefan Metzmacher
2b9ed4700a winbindd: remove useless strcpy
metze
(This used to be commit df08708fc1)
2008-01-21 13:15:10 +01:00
Volker Lendecke
611609ee25 Fix a segfault
Pointed out by Steven Danneman on irc, thanks!

Jerry, Günther, please check!
(This used to be commit 9e71c89ac6)
2008-01-20 09:05:42 +01:00
Günther Deschner
a92eb76688 Finally enable pidl generated SAMR & NETLOGON headers and clients.
Guenther
(This used to be commit f7100156a7)
2008-01-17 16:54:46 +01:00
Alexander Bokovoy
024741500a Convert old sid-string handling in idmap_tdb2 to a new one
(This used to be commit ee851730ce)
2008-01-16 16:50:46 +03:00
Alexander Bokovoy
3bd3483fab idmap TDB2 backend, used for clustered Samba setups.
This uses 2 tdb files. One is permanent, and is in shared storage
   on the cluster (using "tdb:idmap2.tdb =" in smb.conf). The other is a
   temporary cache tdb on local storage.


Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit b6df7e7709)
2008-01-16 12:27:29 +03:00
Günther Deschner
c920764b19 Apply const to rpccli_lsa_query_info_policy() and rpccli_lsa_query_info_policy2().
Guenther
(This used to be commit 7a3fe68bef)
2008-01-15 16:40:22 +01:00
Jeremy Allison
6fa81523f8 Ensure we don't access an uninitialized variable
(CID 535 - actually false but easy to shut up :-).
Jeremy.
(This used to be commit 4038bb3a94)
2008-01-11 22:44:33 -08:00
Günther Deschner
c79ce2ffa3 As long as DsGetDcName is not part of libnetapi, lowercase the fn name.
Guenther
(This used to be commit 19a980f520)
2008-01-11 15:32:20 +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
Michael Adam
de53e47c76 Fix prototype: Add a void to an empty function parameter list.
Michael
(This used to be commit 3f89aea8e4)
2008-01-09 01:47:10 +01:00
Günther Deschner
cab9aa525d Fix build warning.
Guenther
(This used to be commit 73233a06d6)
2008-01-07 14:53:16 +01:00
Michael Adam
d82702c218 Use the proper boolean constants.
Michael
(This used to be commit 6f673b7f10)
2008-01-07 11:27:54 +01:00
Michael Adam
0818d41697 Fix a comment.
Michael
(This used to be commit 62d6d4fff2)
2008-01-07 11:19:27 +01:00
Michael Adam
696cf4d3c0 Make wcache_invalidate_cache() return bool, not int.
Michael
(This used to be commit dba24ceae7)
2008-01-07 10:59:14 +01:00
Michael Adam
c4d3f1b0f5 Add some braces to if statement.
Michael
(This used to be commit 66fc1db1d1)
2008-01-07 10:41:09 +01:00
Andreas Schneider
18699d003b Prevent winbindd from segfaulting due to corrupted cache tdb.
If we try to flush the caches and due to a corrupted tdb we and have no tdb
context close the tdb and validate it. Initialize the cache afterwards again.
(This used to be commit d0c0f91fb9)
2008-01-07 10:24:34 +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
Gerald (Jerry) Carter
4093b0632c Add a missing check for dealing with a one-way trust in query_user().
(This used to be commit f89e356bda)
2008-01-04 13:34:10 -06:00
Gerald (Jerry) Carter
bcc2a6a9d7 Ensure that winbindd_getgroups() can deal with a UPN name.
A user logging in via GDM was not getting a complete list of supplementary
groups in his/her token.  This is because getgroup() was not able to
find the winbindd_domain* using the DNS name.  Fallback to matching the DNS
name is the short name match failes.
(This used to be commit 2030a8de19)
2008-01-04 13:32:58 -06:00
Gerald (Jerry) Carter
9a45dcef4d When connecting to an AD DC, use the DsGetDCName variant.
This allows us to deal with child domains in transitive forest trusts.
It also allows us to fill in the forest name to the target domain to the
struct winbindd_domain *.
(This used to be commit ed30516bb0)
2008-01-04 13:31:07 -06:00
Jeremy Allison
f10074e84b Use correct size value for linearize call.
Jeremy.
(This used to be commit a5df44f5b7)
2007-12-29 14:43:32 -08:00
Volker Lendecke
a59280792c Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
(This used to be commit 8aec5d09ba)
2007-12-29 23:12:51 +01:00
Jeremy Allison
98bc591c4f Add NT error to debug to try and track this down.
Jermey.
(This used to be commit a1482b0915)
2007-12-21 16:43:02 -08:00
Günther Deschner
8ded1df767 Kill fstring in getdcname & getanydcname return.
Guenther
(This used to be commit b738381816)
2007-12-21 15:12:40 +01:00
Michael Adam
e3bb148b94 Only retrieve password policies in pam_auth when WBFLAG_PAM_GET_PWD_POLICY is set.
This essentially re-establishes r14496 (2155bb0535)
which was undone in r17723 (43bd8c00ab) for
reasons that are unclear to me. Maybe I am being too naive.

Now we do again only retrieve the password policy when called from
the pam_winbind module. This fixes logons delegated to AD trusted
domain controllers: We need to connect to the sam to retrieve the
password policy. But auhtenticated session setup is not possible
when contacting the trusted domain dc and afterwards, SamrConnect
also fails with whatever credentials and method used.

Michael
(This used to be commit 6d765e0de5)
2007-12-20 02:05:55 +01:00
Volker Lendecke
e518e19bc0 Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc
(This used to be commit 735f593154)
2007-12-19 21:09:10 +01:00
Michael Adam
a62cc94443 Fix logic error in cm_connect_sam().
Don't fall back to schannel when trust creds could be obtained.
This is still not complete, but I am getting closer.

Michael
(This used to be commit 7c9fa597d6)
2007-12-18 01:55:48 +01:00
Gerald (Jerry) Carter
d9553e8fd1 Fix a segv in winbindd caused by trying to free an fstring.
Make a copy of the machine_password and machine_account strings
in all conditional paths so that SAFE_FREE() will always be valid.
(This used to be commit 194c4640b1)
2007-12-17 17:33:48 -06:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba776)
2007-12-15 22:47:30 +01:00
Volker Lendecke
14ef4cdec1 Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is
still far better than a static one.
(This used to be commit c7c885078b)
2007-12-15 22:09:37 +01:00
Volker Lendecke
d899b8c56a Use sid_to_string directly
It seems a bit pointless to do a fstrcpy(dst, sid_string_static(src))
(This used to be commit c221c246b1)
2007-12-15 22:09:36 +01:00
Volker Lendecke
54ae9dfcbc Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit 0a911d38b8)
2007-12-15 22:09:36 +01: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
Volker Lendecke
105635e23c Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit f00ab810d2)
2007-12-15 22:09:35 +01:00
Stefan Metzmacher
873f14ae40 winbindd: move domain child specific stuff into its own file
metze
(This used to be commit 075d315e0f)
2007-12-14 08:28:35 +01:00
Michael Adam
9104d2bf79 Make cm_connect_sam() try harder to connect autheticated.
Even if the session setup was anonymous, try and collect
trust creds with get_trust_creds() and use these before
falling back to schannel.

This is the first attempt to fix interdomain trusts.
(get password policy and stuff)

Michael
(This used to be commit e180bbd454)
2007-12-13 10:15:20 +01:00
Michael Adam
13e0e4bdf2 Refactor out assembling of trust creds (pw, account name, principal).
Michael
(This used to be commit 481f18b20d)
2007-12-13 10:15:20 +01:00
Michael Adam
a493c7baac Streamline and fix logic of cm_prepare_connection().
Do not attempt to do a session setup when in a trusted domain
situation (this gives STATUS_NOLOGON_TRUSTED_DOMAIN_ACCOUNT).

Use get_trust_pw_clear to get machine trust account.
Only call this when the results is really used.
Use the proper domain and account name for session setup.

Michael
(This used to be commit 18c66a364e)
2007-12-13 10:15:20 +01:00
Michael Adam
31f221ed93 Rename get_trust_pw() to get_trust_pw_hash().
Michael
(This used to be commit 0cde7ac9cb)
2007-12-13 10:15:19 +01:00
Michael Adam
f793c99ca5 Let get_trust_pw() determine the machine_account_name to use.
Up to now each caller used its own logic.

This eliminates code paths where there was a special treatment
of the following situation: the domain given is not our workgroup
(i.e. our own domain) and we are not a DC (i.e. it is not a typical
trusted domain situation). In situation the given domain name was
previously used as the machine account name, resulting in an account
name of DOMAIN\\DOMAIN$, which does not seem very reasonable to me.
get_trust_pw would not have obtained a password in this situation
anyways.

I hope I have not missed an important point here!

Michael
(This used to be commit 6ced4a7f88)
2007-12-13 10:15:17 +01:00
Michael Adam
5d9c977034 Streamline logic in cm_connect_netlogon()
by retrieving trust password only, when it will be used.

Michael
(This used to be commit cdc60d8ae8)
2007-12-13 10:15:16 +01:00
Michael Adam
4884f5d23a In cm_prepare_connection(), only get auth user creds if we need to.
Michael
(This used to be commit 164bfb25d7)
2007-12-13 10:15:14 +01:00
Andreas Schneider
d818a93d07 Don't restart winbind if a corrupted tdb is found during initialization.
The tdb is validated before it gets initialized. Since then sighandlers changed
a restart isn't needed anymore.
(This used to be commit aabe9b33fc)
2007-12-12 13:51:13 +01:00
Stefan Metzmacher
38f8d32d10 winbindd: remove unused WINBINDD_DUMP_MAPS support
Also the design of this function was really bad,
instead do the dump into a file, the client should get
back the list of mappings.

metze
(This used to be commit ce7fe8acf4)
2007-12-12 10:07:05 +01:00
Stefan Metzmacher
3728c8b6d9 winbindd: remove unused WINBINDD_DUAL_NAME2*ID and WINBINDD_DUAL_*ID2NAME calls
WINBINDD_DUAL_UID2NAME
WINBINDD_DUAL_NAME2UID
WINBINDD_DUAL_GID2NAME
WINBINDD_DUAL_NAME2GID

metze
(This used to be commit fd4499ee43)
2007-12-12 09:34:20 +01:00
Stefan Metzmacher
af3cc957f0 winbindd: pass const char *logfile to winbindd_dump_maps_async()
metze
(This used to be commit a52237e3a1)
2007-12-11 16:51:44 +01:00
Stefan Metzmacher
35608af51d winbindd: rename child table struct elements
Add struct_ prefix to struct based protocol specific
elemetens struct winbindd_child_dispatch_table.

metze
(This used to be commit 4ab9a8aab7)
2007-12-11 12:56:24 +01:00
Stefan Metzmacher
92482e5667 idmap: add a const to idmap_dump_maps()
metze
(This used to be commit de31913f0a)
2007-12-11 12:56:23 +01:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Jeremy Allison
42cfffae80 Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings.
Jeremy.
(This used to be commit ec003f3936)
2007-12-07 17:32:32 -08:00
Jeremy Allison
acf15ae730 Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
(This used to be commit 4c32a22ac5)
2007-12-07 12:26:32 -08:00
Michael Adam
c436c5aa0f Improve a debug message.
Michael
(This used to be commit 1ea3ec9271)
2007-12-06 01:51:53 +01:00