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

1848 Commits

Author SHA1 Message Date
Christof Schmitt
c134171e39 winbind: Print error code on connection error in ping_dc
For debugging, it is useful to include the error code in the message.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat May 25 23:11:23 CEST 2013 on sn-devel-104
2013-05-25 23:11:23 +02:00
Björn Jacke
f08205be70 winbind/idmap_ad: be verbose about the user that we fail to map
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-14 19:53:29 +02:00
Volker Lendecke
8c1283a89f winbind: Fix bug 9854 -- NULL pointer dereference
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue May  7 14:49:07 CEST 2013 on sn-devel-104
2013-05-07 14:49:07 +02:00
Michael Adam
7bc9563c96 s3:idmap:autorid: add a comment block explaining the calculations
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:40 +02:00
Michael Adam
9c6594dadb s3:idmap:autorid: simplify the id->sid calculation
To make it more intutive.

rid = reduced_rid + domain_range_index * range_size

where

reduced_rid = (id - id_low) % range_size

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:40 +02:00
Michael Adam
7b9a567b89 s3:idmap:autorid: calculate the range's low_id in idmap_autorid_get_domainrange()
This way, the calculation needs to be don only in one central place and
the formulas get simpler.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:39 +02:00
Michael Adam
30a27ba428 s3:idmap:autorid: make calculation in idmap_autorid_sid_to_id much more obvious
This is my attempt to make the sid->unix-id calculation much more obvious.
Especially with the introduction of the multi-range support an the originally
named "multiplier", the calculation

id = low_id + range_size * domain_number + rid - range_size * multiplier

was rather opaque to me.

What really happens here is this:
The rid is split into a reduced_rid part that is < rangesize and
a multiple of rangesize. This is given by the formula

rid = rid % range_size + (rid / range_size) * range_size

We define
 reduced_rid := rid % range_size
and
 domain_range_index := rid / range_size ( == the original multiplier)

and the original formula is equivalent to:

id = reduced_rid + low_id + range_number * range_size;

and reads

id = reduced_rid + range_minvalue

if we set range_minvalue := low_id + range_number * range_size.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:39 +02:00
Michael Adam
a0ea6c2536 s3:idmap:autorid: rename range.multiplier to domain_range_index
The name multiplier is very confusing (at least for me).
This is an index that is used to reference the various
per-domain ranges.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:39 +02:00
Michael Adam
196aa1dea7 s3:idmap:autorid: rename autorid_range_config.sid to domsid, along with instances
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:39 +02:00
Michael Adam
2a258747b6 s3:idmap:autorid: rename autorid_domain_config --> autorid_range_config and instances to "range"
This describes it better with the new support for multiple ranges for domains.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:39 +02:00
Michael Adam
11b9b7d051 s3:idmap:autorid: rename domainnum to rangenum
Now ranges don't correspond to domains any more, but
multiple ranges are associated to a domain. So the name
is misleading.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-05-06 16:33:39 +02:00
Abhidnya Joshi
b384c55bf3 s3:winbindd/autorid multiple range support
when a mapping request for a RID comes in that is larger
than the rangesize, allocate an extension range to be able
to map this one

This is especially important for large installations which
might have large RIDs being used in a trusted domain that
the administrator was not aware of when planning for autorid
usage and so those objects could not be mapped up to now.
As it is not possible to change the rangesize after the first
start of autorid, this would lead to big trouble.

Signed-off-by: Abhidnya Joshi <achirmul@in.ibm.com>
Reviewed-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-05-06 16:33:39 +02:00
Volker Lendecke
0a2910152a idmap: Store negative cache entries if the backend fails
This changes the behaviour for out-of-range queries: The tdb backend
(probably all backends) returns NT_STATUS_NONE_MAPPED and does not set the
map.status value to ID_UNMAPPED. This means that we did an early error
exit, not setting a negative cache value. This makes smbd ask winbind
over and over again for out-of-range gids, which can be a performance
problem in certain scenarios.

The new code makes us fall through to the code setting the negative
cache entry in all cases.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May  3 14:48:35 CEST 2013 on sn-devel-104
2013-05-03 14:48:35 +02:00
Volker Lendecke
1966e28d15 idmap: Print error from idmap_backends_unixid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-05-03 12:58:35 +02:00
Stefan Metzmacher
450ebe97d1 s3:winbindd: avoid usage of procid_self()
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-18 13:15:10 +02:00
Volker Lendecke
28da1af476 winbindd: Avoid a fd leak when we can not fork
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jim McDonough <jmcd@samba.org>

Autobuild-User(master): Jim McDonough <jmcd@samba.org>
Autobuild-Date(master): Tue Apr  9 20:27:27 CEST 2013 on sn-devel-104
2013-04-09 20:27:27 +02:00
Andreas Schneider
045c446b5a BUG 9766: Cache name_to_sid/sid_to_name correctly.
If there is no domain_name specified we still need to set to for
caching else we will not find the entry later if we lookup the entry
with the domain_name.

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Apr  9 16:32:44 CEST 2013 on sn-devel-104
2013-04-09 16:32:44 +02:00
Christof Schmitt
6aa739a219 s3-winbindd: Add new module idmap_rfc2307
This module allows querying id mappings from LDAP servers as described
in RFC 2307. The LDAP records can be queried from an Active Directory
Server or from a stand-alone LDAP server.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Christof Schmitt
ad1fbe29fb s3-winbindd: Move connection to AD server from idmap_ad
Having this in a common place allows reuse by other idmap modules.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Christof Schmitt
baf9b78d47 s3-winbindd: Use common helper function for connecting to ADS
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Christof Schmitt
0c4e467c1c s3-winbindd: Move code for verifying ADS connection to common helper function
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Christof Schmitt
c07c167edb s3-winbindd: Move idmap_fetch_secret to idmap_utils.c for reuse
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Christof Schmitt
86d09ce779 s3-winbindd: Move common code for LDAP id mapping to idmap_utils
idmap_ad and idmap_ldap use the same helper functions and the same
maximum query size. Move the code to idmap_utils so that it can be
shared by every module issuing LDAP queries.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:22 +01:00
Michael Adam
5372571fde s3:idmap: fix a debug message and lower its level
It is not an error to be logged at level 1 when a
domain has no explicitly configured idmap backend.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar  8 03:16:54 CET 2013 on sn-devel-104
2013-03-08 03:16:54 +01:00
Andreas Schneider
69f22e17d7 winbind: Fix no memory check in _wbint_PingDc().
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:56 +01:00
Andreas Schneider
3c134bcf86 winbind: Fix samba3.winbind.struct test.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:40 +01:00
Andreas Schneider
659dd65f8f winbind: Correctly use names in the domain struct.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:29 +01:00
Andreas Schneider
14bae61ba3 winbind: Use talloc for allocating domain, dns, forest and dc name.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:11 +01:00
Andreas Schneider
b055798c56 winbind: Don't leak centry memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:14 +01:00
Andreas Schneider
d555f6d789 winbind: Don't leak memory on return.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:13 +01:00
Andreas Schneider
03cf4bedf0 winbind: Correctly cast name to messaging_send_buf().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Andreas Schneider
de14fd942a winbind: Use uint8_t type and use const where needed.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Andreas Schneider
45671747f0 winbind: Make domain_name const in wcache_ndr_key().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Stefan Metzmacher
fdf9da96c5 s3:winbindd: s/event_add_timed/tevent_add_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:48:02 +01:00
Stefan Metzmacher
3ae2ed4504 s3:winbindd: s/struct timed_event/struct tevent_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:55 +01:00
Stefan Metzmacher
b946b45799 s3:winbindd: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:50 +01:00
Stefan Metzmacher
5a2aaafee7 s3:winbindd: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:49 +01:00
Michael Adam
19c68f8025 s3:idmap_autorid: fix freeing of non-talloced memory (uninitialized pointer) (bug #9653)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Feb 13 09:51:53 CET 2013 on sn-devel-104
2013-02-13 09:51:53 +01:00
Volker Lendecke
beb6c13e9a winbind: Fix an incompatible pointer type warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb  8 15:27:51 CET 2013 on sn-devel-104
2013-02-08 15:27:50 +01:00
Michael Adam
394622ef8c s3:winbindd: change getpwsid() to return a passwd struct for a group sid id-mapped with ID_TYPE_BOTH
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 29 23:46:19 CET 2013 on sn-devel-104
2013-01-29 23:46:19 +01:00
Michael Adam
b7095e9818 s3:winbindd: check the correct variable for talloc success in rpc_query_user()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:57:18 +01:00
Michael Adam
40e3df7c37 s3:winbindd:getgrnam: also produce a group struct for a user with ID_TYPE_BOTH
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:56:58 +01:00
Michael Adam
d2360fe56c s3:winbindd: create group structs for gids that are coming from a user sid id-mapped with ID_TYPE_BOTH
This "fake" group contains exctly one member, namely the user that the sid is
actually belonging to.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:54:48 +01:00
Michael Adam
729e2c3630 s3:winbindd: factor add_wbint_Principal_to_dict() out of wb_group_members_done()
for later reuse

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:48:01 +01:00
Michael Adam
3680cc4a11 s3:winbindd: fix a cut'n'paste comment typo in wb_fill_pwent
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:45:59 +01:00
Michael Adam
c0f47d43ec s3:winbindd: rename winbindd_getgrnam_lookupsid_done to winbindd_getgrnam_lookupname_done
That's what it is.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:45:46 +01:00
Günther Deschner
d56b4560b5 s3-winbind: fix the build of idmap_ldap.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jan 22 14:43:40 CET 2013 on sn-devel-104
2013-01-22 14:43:40 +01:00
Volker Lendecke
15596a8d9c winbind: Handle child requests in a tevent_fd
This enables the use of standard tevent_loop_once in the child, which
now also uses epoll where available.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
Volker Lendecke
5e75564377 winbind: Introduce "struct child_handler_state"
This will make the next patch simpler. child_handler_state contains the
information that the handler for the parent fde needs to pass to
process_child_request

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
Volker Lendecke
3e830e44d3 winbind: Use standard tevent_context_init
This makes winbind use epoll instead of poll

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00