summaryrefslogtreecommitdiffstats
path: root/source3/winbindd
Commit message (Collapse)AuthorAgeFilesLines
...
* winbind: Print error code on connection error in ping_dcChristof Schmitt2013-05-251-1/+2
| | | | | | | | | | | | 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
* winbind/idmap_ad: be verbose about the user that we fail to mapBjörn Jacke2013-05-141-2/+3
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbind: Fix bug 9854 -- NULL pointer dereferenceVolker Lendecke2013-05-071-3/+3
| | | | | | | | 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
* s3:idmap:autorid: add a comment block explaining the calculationsMichael Adam2013-05-061-0/+51
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* s3:idmap:autorid: simplify the id->sid calculationMichael Adam2013-05-061-7/+13
| | | | | | | | | | | | | 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>
* s3:idmap:autorid: calculate the range's low_id in ↵Michael Adam2013-05-061-8/+9
| | | | | | | | | | 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>
* s3:idmap:autorid: make calculation in idmap_autorid_sid_to_id much more obviousMichael Adam2013-05-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s3:idmap:autorid: rename range.multiplier to domain_range_indexMichael Adam2013-05-061-15/+17
| | | | | | | | | 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>
* s3:idmap:autorid: rename autorid_range_config.sid to domsid, along with ↵Michael Adam2013-05-061-12/+12
| | | | | | | instances Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* s3:idmap:autorid: rename autorid_domain_config --> autorid_range_config and ↵Michael Adam2013-05-061-37/+37
| | | | | | | | | 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>
* s3:idmap:autorid: rename domainnum to rangenumMichael Adam2013-05-061-12/+13
| | | | | | | | | 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>
* s3:winbindd/autorid multiple range supportAbhidnya Joshi2013-05-061-19/+36
| | | | | | | | | | | | | | | | | 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>
* idmap: Store negative cache entries if the backend failsVolker Lendecke2013-05-031-2/+2
| | | | | | | | | | | | | | | | | | 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
* idmap: Print error from idmap_backends_unixid_to_sidVolker Lendecke2013-05-031-2/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:winbindd: avoid usage of procid_self()Stefan Metzmacher2013-04-181-1/+3
| | | | | | | metze Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* winbindd: Avoid a fd leak when we can not forkVolker Lendecke2013-04-091-0/+2
| | | | | | | | 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
* BUG 9766: Cache name_to_sid/sid_to_name correctly.Andreas Schneider2013-04-091-0/+21
| | | | | | | | | | | | | 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
* s3-winbindd: Add new module idmap_rfc2307Christof Schmitt2013-03-092-0/+880
| | | | | | | | 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>
* s3-winbindd: Move connection to AD server from idmap_adChristof Schmitt2013-03-093-62/+52
| | | | | | Having this in a common place allows reuse by other idmap modules. Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-winbindd: Use common helper function for connecting to ADSChristof Schmitt2013-03-093-86/+87
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-winbindd: Move code for verifying ADS connection to common helper functionChristof Schmitt2013-03-093-45/+41
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-winbindd: Move idmap_fetch_secret to idmap_utils.c for reuseChristof Schmitt2013-03-093-24/+27
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-winbindd: Move common code for LDAP id mapping to idmap_utilsChristof Schmitt2013-03-094-83/+53
| | | | | | | | 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>
* s3:idmap: fix a debug message and lower its levelMichael Adam2013-03-081-1/+2
| | | | | | | | | | | | 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
* winbind: Fix no memory check in _wbint_PingDc().Andreas Schneider2013-03-051-1/+1
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Fix samba3.winbind.struct test.Andreas Schneider2013-03-051-1/+1
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Correctly use names in the domain struct.Andreas Schneider2013-03-057-20/+52
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Use talloc for allocating domain, dns, forest and dc name.Andreas Schneider2013-03-056-61/+142
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Don't leak centry memory.Andreas Schneider2013-02-221-0/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* winbind: Don't leak memory on return.Andreas Schneider2013-02-221-0/+3
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* winbind: Correctly cast name to messaging_send_buf().Andreas Schneider2013-02-221-3/+3
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* winbind: Use uint8_t type and use const where needed.Andreas Schneider2013-02-221-7/+7
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* winbind: Make domain_name const in wcache_ndr_key().Andreas Schneider2013-02-221-1/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3:winbindd: s/event_add_timed/tevent_add_timerStefan Metzmacher2013-02-193-13/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:winbindd: s/struct timed_event/struct tevent_timerStefan Metzmacher2013-02-194-11/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:winbindd: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-193-6/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:winbindd: make use of samba_tevent_context_init()Stefan Metzmacher2013-02-191-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:idmap_autorid: fix freeing of non-talloced memory (uninitialized pointer) ↵Michael Adam2013-02-131-1/+1
| | | | | | | | | | (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
* winbind: Fix an incompatible pointer type warningVolker Lendecke2013-02-081-1/+1
| | | | | | | | 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
* s3:winbindd: change getpwsid() to return a passwd struct for a group sid ↵Michael Adam2013-01-291-9/+43
| | | | | | | | | | 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
* s3:winbindd: check the correct variable for talloc success in rpc_query_user()Michael Adam2013-01-291-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:winbindd:getgrnam: also produce a group struct for a user with ID_TYPE_BOTHMichael Adam2013-01-291-2/+13
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:winbindd: create group structs for gids that are coming from a user sid ↵Michael Adam2013-01-291-0/+49
| | | | | | | | | | 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>
* s3:winbindd: factor add_wbint_Principal_to_dict() out of wb_group_members_done()Michael Adam2013-01-292-17/+47
| | | | | | | for later reuse Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:winbindd: fix a cut'n'paste comment typo in wb_fill_pwentMichael Adam2013-01-291-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:winbindd: rename winbindd_getgrnam_lookupsid_done to ↵Michael Adam2013-01-291-3/+3
| | | | | | | | | winbindd_getgrnam_lookupname_done That's what it is. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-winbind: fix the build of idmap_ldap.Günther Deschner2013-01-221-1/+2
| | | | | | | | | | 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
* winbind: Handle child requests in a tevent_fdVolker Lendecke2013-01-181-105/+65
| | | | | | | 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>
* winbind: Introduce "struct child_handler_state"Volker Lendecke2013-01-181-22/+30
| | | | | | | | 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>
* winbind: Use standard tevent_context_initVolker Lendecke2013-01-183-7/+34
| | | | | | This makes winbind use epoll instead of poll Reviewed by: Jeremy Allison <jra@samba.org>